(function(){var t={8648:function(t,e,i){"use strict";var s=i(144),a=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[i("router-view"),t.state.loaded?i("div",[i("md-snackbar",{attrs:{"md-active":t.showMessage,"md-persistent":!0,"md-duration":4e3},on:{"update:mdActive":function(e){t.showMessage=e},"update:md-active":function(e){t.showMessage=e}}},[t._v(t._s(t.message))]),i("md-dialog-alert",{attrs:{"md-active":t.showPopup,"md-content":t.popupMessage,"md-confirm-text":"OK"},on:{"update:mdActive":function(e){t.showPopup=e},"update:md-active":function(e){t.showPopup=e}}})],1):t._e(),t.state.loaded?t._e():i("div",{staticClass:"micrio-loader"}),i("md-dialog-confirm",{attrs:{"md-active":t.confirmDialog.show,"md-title":t.confirmDialog.title,"md-content":t.confirmDialog.content,"md-confirm-text":t.confirmDialog.textYes,"md-cancel-text":t.confirmDialog.textNo},on:{"update:mdActive":function(e){return t.$set(t.confirmDialog,"show",e)},"update:md-active":function(e){return t.$set(t.confirmDialog,"show",e)},"md-cancel":t.confirmCancel,"md-confirm":t.confirmOk}}),i("md-dialog-prompt",{attrs:{"md-active":t.promptDialog.show,"md-title":t.promptDialog.title,"md-content":t.promptDialog.content,"md-confirm-text":"Ok","md-cancel-text":"Cancel"},on:{"update:mdActive":function(e){return t.$set(t.promptDialog,"show",e)},"update:md-active":function(e){return t.$set(t.promptDialog,"show",e)},"md-cancel":t.promptCancel,"md-confirm":t.promptOk},model:{value:t.promptDialog.current,callback:function(e){t.$set(t.promptDialog,"current",e)},expression:"promptDialog.current"}}),t.folderDialog.show?i("SelectFolder",{attrs:{title:t.folderDialog.title,projectId:t.folderDialog.projectId,disabledId:t.folderDialog.disabledId,noSelf:t.folderDialog.noSelf,selfId:t.folderDialog.selfId},on:{cancel:t.folderCancel,selected:t.folderOk}}):t._e()],1)},r=[],o=(i(7658),i(7968)),n=i.n(o);i(6229),i(7330),i(2062);const d={NotStarted:"NotStarted",Downloading:"Downloading",Processing:"Processing",TilingStarted:"TilingStarted",Ready:"Ready",Error:"Error",Storing:"Storing",Resizing:"Resizing"},l=!/micr\.io/.test(location.hostname)&&!/live-api/.test(location.search),c=/local/.test(location.search),m="include",u=new URLSearchParams(location.search),h=u.get("session"),p=c?"https://localhost:5051":l?"https://api.micrio.dev":"https://api.micr.io",g=location.search.match(/uid=([^&]+)/),v=g&&g[1]||void 0,f={async getProject(t){return new Promise((async e=>{e(M.state.projects.find((e=>e.shortId==t)))}))},async addProject(t,e,i,s){let a={title:t,organisationId:M.state.currentOrgId||void 0,subscriptionOrgId:i,isSpaces:s};return e&&(a.description=e),new Promise((t=>{k("/dashboard/newProject",a).then((e=>{M.state.projects.unshift(e),t(e)}))}))},async initialize(){return w("/dashboard/init",{organisationId:M.state.currentOrgId||void 0,userId:v})},async createFolder(t,e){return k("/api/micrio/newFolder",{title:t,parentId:e,organisationId:M.state.currentOrgId||void 0})},async agreeToTerms(){return k("/dashboard/agreeToTerms",null,!0)},async getUser(){return w("/dashboard/getUser",{userId:v})},async updatePaymentMethod(t){return new Promise(((e,i)=>{k("/dashboard/updatePaymentMethod",{paymentMethodId:t,organisationId:M.state.currentOrgId||void 0,userId:v}).then((t=>{M.state.user.hasStripeSource=t.hasStripeSource,M.state.user.isStripeCustomer=t.isStripeCustomer,M.state.organisation&&(M.state.organisation.hasStripeSource=t.hasStripeSource),e(t)})).catch(i)}))},async createSubscription(t,e,i){return new Promise(((s,a)=>{k("/dashboard/createSubscription",{projectId:t,subscriptionOrgId:e,title:i}).then((e=>_(e,t,s))).catch(a)}))},async confirmPaymentIntent(t,e){return new Promise(((i,s)=>{k("/dashboard/confirmPaymentIntent",{intentId:t,projectId:e}).then((t=>_(t,e,i))).catch(s)}))},async upgradeProject(t,e){return k("/dashboard/upgrade",{projectId:t,newOrganisationId:e})},async deactivateProject(t){return new Promise(((e,i)=>{k("/dashboard/deactivate",{id:t}).then((i=>_(i,t,e))).catch(i)}))},async deleteProject(t){return new Promise(((e,i)=>{k("/dashboard/delete",{id:t}).then((s=>{s?(M.state.projects.splice(M.state.projects.findIndex((e=>e.id==t)),1),e()):i("Could not be deleted!")})).catch(i)}))},async requestQuote(t,e){return console.log("request quote...",t,e),e.projectId=t,new Promise(((i,s)=>{k("/dashboard/requestQuote",e).then((e=>_(e,t,i))).catch(s)}))},async action(t,e,i=null,s=null){if(!navigator.sendBeacon)return;const a=new FormData;null!==i&&a.append("data",i),null!==s&&a.append("targetId",s),navigator.sendBeacon(p+"/dashboard/action/"+t+(e?"/"+e:""),a)},async getImage(t){return w("/api/micrio/info/"+t)},async getImageData(t,e){return w("/api/micrio/getJSON",{id:t,culture:e})},async getImagesData(t,e){return w(`/api/micrio/getJSONMultiple?culture=${e}&ids=${t}`)},async setImageData(t,e,i){return fetch(p+"/micrio/setJSON/"+t+"/"+e,{method:"POST",credentials:m,headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8",EditSessionId:h},body:JSON.stringify(i)})},async deleteImage(t){return k("/api/micrio/delete",{id:t})},async renameImage(t,e){return k("/api/micrio/setTitle",{id:t,title:e},!0)},async moveImage(t,e){return k("/api/micrio/moveImage",{id:t,folderId:e})},async upgradeImage(t){return k("/api/micrio/upgradeImage",{id:t})},async retryTiling(t){return k("/api/micrio/retryTiling",{id:t},!0)},async cloneImage(t,e,i){return k("/api/micrio/cloneImage",{id:t,folderId:e,includeData:i})},async createImageFromIIIF(t,e,i,s,a,r){return k("/api/micrio/createFromIIIFManifest",{manifestUrl:t,title:e,folderId:a,organisationId:r,width:i,height:s})},async createImageFromUrl(t,e){return k("/api/micrio/createFromUrl",{folderId:e,url:t})},async renameFolder(t,e){return new Promise(((i,s)=>{k("/api/micrio/renameFolder",{id:t,title:e}).then((a=>{if(a){let s=M.state.folders.find((e=>e.id==t));s&&(s.title=e),i(a)}else s("Could not be renamed!")})).catch(s)}))},async removeFolder(t){return new Promise(((e,i)=>{k("/api/micrio/removeFolder",{id:t}).then((s=>{s?(M.state.folders.splice(M.state.folders.findIndex((e=>e.id==t)),1),e()):i("Could not be deleted!")})).catch(i)}))},async moveFolder(t,e){return new Promise(((i,s)=>{k("/api/micrio/moveFolder",{id:t,parentId:e}).then((a=>{a?(M.state.folders.find((e=>e.id==t)).parentId=e,i()):s("Could not be moved!")})).catch(s)}))},getFullPath(t){let e=[],i=null;while(t&&(i=M.state.folders.find((e=>e.id==t))))e.push(i.slug),t=i.parentId;return e.reverse().join("/")},async set360(t,e){return k("/api/micrio/set360",{id:t,is360:e},!0)},async setSettings(t,e){return k("/api/micrio/setSettings",{id:t,json:JSON.stringify(e)},!0)},async setStartView(t,e){return k("/api/micrio/setStartView",{id:t,view:e},!0)},async setPublished(t,e,i=void 0){let s={id:t};return i&&(s.culture=i),k(e?"/api/micrio/publish":"/api/micrio/unpublish",s,!0)},async resetVersion(t){return k("/api/micrio/resetVersion",{id:t},!0)},async publishShortId(t,e){return k("/api/micrio/publishShortId",{shortId:t,culture:e},!0)},async getInvoices(){return w("/dashboard/getInvoices",{userId:v,organisationId:M.state.currentOrgId||void 0})},async getImages(t,e,i){return w("/api/micrio/",{folderId:t,offset:e,numPerPage:i,organisationId:M.state.currentOrgId||void 0})},async readNotification(t){return k("/dashboard/readNotification",{id:t},!0)},async getLanguages(t){return w("/api/micrio/getLangs",{micrioId:t})},async getAssets(t,e,i=!1,s=!1,a=null,r=null){return"micrio"==e?w("/api/micrio/getEmbeds",{micrioId:t,no360:i,includeMaps:s,searchType:a,query:r}):w("/api/asset/"+e+"/"+t)},async removeAsset(t){return k("/api/asset/remove",{assetId:t},!0)},uploadFile(t,e,i=!1){return new Promise((async(s,a)=>{const r=await k("/api/asset/StartUpload",t).catch((t=>{console.error("Error",t),a&&a(t)}));r?(await S(r.url,e,{"Content-Type":e.type||t.mimeType||"application/octet-stream"}).catch((t=>{console.error("Error",t),a&&a(t)})),"00000000-0000-0000-0000-000000000000"!=r.id&&await k("/api/asset/finishUpload",{id:r.id},!0).catch((t=>{a&&a(t)})),s(i?r.resultUrl:r.id)):a&&a("Nowhere to upload!")}))},async tileAsset(t){const e=M.state.organisation&&M.state.organisation.id;return k("/api/asset/TileAssetImage",{id:t,orgId:e},!1,!0)},async getImageDimensions(t){return w("/api/asset/ImageDimensions?url="+t.src)},async setDefaultLang(t){return k("/dashboard/setDefaultCulture",{culture:t},!0)},async setFolderSorting(t,e){return k("/dashboard/SetFolderSort",{folderId:t,type:e},!0)},async setImagePassword(t,e){return k("/dashboard/SetImagePassword",{imageId:t,password:e},!0)},async setFolderPassword(t,e){return k("/dashboard/SetFolderPassword",{folderId:t,password:e},!0)},async search(t,e){return k("/search",{query:t,organisationId:e})}};var b=f;function _(t,e,i){if(t.id){let i=M.state.projects.find((t=>t.id==e));i?(i.isActive=t.isActive,i.hasStripeSubscription=t.hasStripeSubscription,i.trialDaysLeft=t.trialDaysLeft,i.isTrial=t.isTrial):console.warn("Project not found to update!",e)}i(t)}function y(t){return t.startsWith("/api")&&(t=t.substr(4)),p+t}function k(t,e,i=!1,s=!1){let a=new FormData;for(let r in e)a.append(r,e[r]);return fetch(y(t),{method:"POST",credentials:m,body:a,headers:{EditSessionId:h}}).catch((t=>({ok:!1,error:t,statusText:"An API error occurred"}))).then(i?null:s?t=>t.text():$)}function w(t,e){return e&&(e=JSON.parse(JSON.stringify(e))),fetch(y(t)+(e?"?"+new URLSearchParams(e).toString():""),{method:"GET",credentials:m,headers:{EditSessionId:h}}).catch((t=>({ok:!1,error:t,statusText:"An API error occurred"}))).then($)}function S(t,e,i={}){const s=M.state.organisation&&M.state.organisation.isAzure;return s&&(i["x-ms-blob-type"]="BlockBlob",i["cache-control"]="max-age=31536000"),fetch(t,{method:"PUT",headers:i,body:e})}async function $(t){if(t.ok)return 204!=t.status?t.json():null;if(401!=t.status){let e=t.error||await t.text(),i=t.statusText+(e?`: ${e}`:"");throw console.error(i),Error(i)}location.href=(l?"http://localhost:6200":"https://account.micr.io")+"/login?ReturnUrl="+encodeURIComponent(location.href)}const I=l?"pk_test_einIvYOhPVlvk1GFLQWi8Fl5":"pk_live_kTdQ849bhFCOHmxNqGx5uWMj";async function C(){return new Promise((t=>{if(window.Stripe)t(new window.Stripe(I));else{const e=document.createElement("script");e.type="text/javascript",e.onload=()=>t(new window.Stripe(I)),e.src="https://js.stripe.com/v3/",document.head.appendChild(e)}}))}const P=["ttBWO","IicaE","KLTce","xjQrB","pfhXT","rNIPa","rdFIY","mvRXc"];s["default"].use(n());const x=!/micr\.io/.test(location.hostname)&&!/live/.test(location.search),j="//b.micr.io/",T=new(n().Store)({state:{langs:{en:"English",nl:"Dutch",ar:"Arabic",de:"German",es:"Spanish",fr:"French",id:"Indonesian",it:"Italian",ja:"日本語",ln:"Lingala",pt:"Portugese",se:"Swedish",sk:"Slovak"},isEditor:window._dashboard&&/id=/.test(location.search),loaded:!1,isAdmin:!1,validOrg:!0,currentOrg:null,currentOrgId:null,currentOrgName:null,showOrgDrawer:!1,showUserPrivateAccount:!1,projectsLoaded:!1,organisations:[],projects:[],folders:[],user:null,organisation:null,activeTab:null,editing:!1,baseUrl:j,autoOpenedTrial:!1,isLocalDev:!1,showTutorials:"0"!==localStorage.getItem("editor_showTutorials"),finishedTutorials:[],trialSubId:null,iiifUrl:"https://iiif.micr.io/",hasIIIF:!0,canCreate:!1},getters:{currentCulture(t){return t.user&&t.user.defaultCulture||t.organisation&&t.organisation.defaultLanguage||"en"},showPayments(t){const e=t.projects.every((t=>t.isTrial)),i=!!t.projects.find((t=>t.customInvoiced))||t.organisation&&t.organisation.customPayments,s=!i&&t.projects.every((t=>t.subscription&&!t.subscription.monthlyAmount));return t.isAdmin&&(!t.organisation&&!(e||s)||t.organisation&&(!i&&!t.organisation.isFree||t.organisation.hasStripeSource))},isFreeOrg(t){return t.organisation&&t.organisation.isFree},isSharedLimit(t,e){return e.subscriptionOrg&&t.canCreate&&t.projects.length>1},usage(t){return t.projects.length?{images:t.projects.map((t=>t.numberOfImages)).reduce(((t,e)=>t+e)),bandwidth:t.projects.map((t=>t.bandwidth)).reduce(((t,e)=>t+e)),storage:t.projects.map((t=>t.fileSize)).reduce(((t,e)=>t+e)),visitors:t.projects.map((t=>t.visitors)).reduce(((t,e)=>t+e))}:{}},subscriptionOrg(t){const e=t.organisation?t.organisation.id:t.projects.length?t.projects[0].subscriptionId:null;return e?t.subscriptions.find((t=>t.id==e)):null},isLimitReached(t,e){const i=e.subscriptionOrg,s=e.usage;return i&&i.maxImages>0?s.images>=i.maxImages:null},canUploadJSCSS(t){return t.organisation&&t.organisation.hasCustomJSCSS||t.user&&t.user.canUploadJSCSS}},actions:{async organisation(t,e){let i=t.state;if(i.currentOrg==e)return;i.organisation=i.user.organisations.find((t=>t.slug==e)),i.showUserPrivateAccount=!i.user.isV3&&(i.isLocalDev||!i.user.organisations.find((t=>!t.isShared))),i.showOrgDrawer=!(1==i.user.organisations.length&&!i.showUserPrivateAccount)&&i.user.organisations.length>0,i.validOrg="s"==e&&i.showUserPrivateAccount||i.organisation;const s="editor_orgId-"+i.user.id;if(i.validOrg){i.loaded=!1,i.currentOrg=e,i.currentOrgId=i.organisation?i.organisation.id:null,i.currentOrgName=i.organisation?i.organisation.name:"",i.projectsLoaded=!1;const t=await b.initialize();i.projects=t.projects,i.folders=t.folders,i.subscriptions=t.subscriptions,i.projects.forEach((t=>{!t.subscription||i.subscriptions.find((e=>e.id==t.subscription.id))||i.subscriptions.find((e=>e.id==t.subscription.parentId))||i.subscriptions.push(t.subscription)})),i.isAdmin=!i.organisation||i.organisation.isAdmin,i.hasIIIF=!!i.organisation||!i.user.noIIIF,i.projectsLoaded=!0,i.loaded=!0,i.organisation?(i.baseUrl=i.organisation.baseUrl||j,localStorage.setItem(s,i.organisation.id),document.title=i.organisation.name+" - Micrio Dashboard",i.canCreate=!i.organisation.customPayments):(i.baseUrl=j,localStorage.removeItem(s),localStorage.removeItem("editor_orgId"),document.title="Micrio Dashboard",i.canCreate=!i.user.isV3&&(i.isLocalDev||!i.projects.length))}else console.warn("Invalid organisation: "+e),i.projects=[],i.folders=[],i.subscriptions=[],i.currentOrg=e,i.currentOrgId=null,i.currentOrgName="",i.isAdmin=!1,localStorage.removeItem(s),localStorage.removeItem("editor_orgId"),i.loaded=!0,i.projectsLoaded=!0;if(!i.trialSubId){const t=i.projects.find((t=>t.trialSubOrg));t&&(i.trialSubId=t.subscriptionOrgId)}}}});T.stripe={api:null,style:{base:{color:"#32325d",fontFamily:'"Helvetica Neue", Helvetica, sans-serif',fontSmoothing:"antialiased",fontSize:"16px","::placeholder":{color:"#aab7c4"}},invalid:{color:"#fa755a",iconColor:"#fa755a"}}};var M=T,D=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[i("md-dialog",{attrs:{"md-active":!0}},[i("md-dialog-title",[t._v(t._s(t.title))]),i("md-dialog-content",t._l(t.tree,(function(e){return i("Tree",{key:e.id,attrs:{node:e,main:t.self,noSelf:t.noSelf,self:t.selfId,disabledId:t.disabledId}})})),1),i("md-dialog-actions",[i("md-button",{staticClass:"md-primary",on:{click:function(e){return t.$emit("cancel")}}},[t._v("Cancel")]),i("md-button",{staticClass:"md-primary",attrs:{disabled:!this.selected},on:{click:function(e){return t.$emit("selected",t.selected)}}},[t._v("Move")])],1)],1)],1)},A=[],O=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("ul",{staticClass:"node"},[i("li",[i("md-button",{staticClass:"md-icon-button",attrs:{disabled:!t.hasChildren||t.node.disabled},on:{click:t.toggle}},[i("md-icon",[t._v(" "+t._s(t.hasChildren?t.expanded?"remove":"add":"folder")+" ")])],1),i("md-button",{class:[t.main.selected==t.node.id&&"md-primary"],attrs:{disabled:t.node.id==t.disabledId||t.node.disabled||t.noSelf&&t.isSelf},on:{click:t.select}},[t._v(t._s(t.node.title))]),t.expanded&&t.hasChildren?t._l(t.node.children,(function(e){return i("node",{key:e.id,attrs:{main:t.main,noChildren:t.noChildren,noSelf:t.noSelf,self:t.self,disabledId:t.disabledId,root:!1,node:e}})})):t._e()],2)])},E=[],L={name:"node",props:{node:Object,main:Object,disabledId:String,noChildren:Boolean,noSelf:Boolean,self:String,root:{type:Boolean,default:!0}},data(){return{expanded:!1}},computed:{isSelf(){return this.node.id==this.self},hasChildren(){return this.node.children.length&&!(this.noSelf&&this.isSelf)&&!(this.noChildren&&this.disabledId==this.node.id)}},methods:{select(){this.node.id==this.disabledId||this.noSelf&&this.isSelf||(this.main.selected=this.main.selected==this.node.id?null:this.node.id)},toggle(){this.expanded&&this.deselectChildren(this.node),this.hasChildren&&(this.expanded=!this.expanded)},deselectChildren(t){t.children.forEach((t=>{t.id==this.main.selected&&(this.main.selected=null),this.deselectChildren(t)}))}}},R=L,N=i(1001),V=(0,N.Z)(R,O,E,!1,null,null,null),U=V.exports,z={components:{Tree:U},props:{disabledId:String,noSelf:Boolean,selfId:String,projectId:String,title:{type:String,default:"Projects"}},data(){return{selected:null,self:this,state:M.state}},computed:{tree(){const t=!M.state.organisation||M.state.subscriptions.findIndex((t=>t.id==this.projectId))>=0;return M.state.projects.filter((e=>M.getters.isFreeOrg||!t||e.id==this.projectId)).map((t=>this.getNode(t.id,!0))).filter((t=>!!t))}},methods:{getNode(t,e=!1){let i=M.state.folders.find((e=>e.id==t));if(null==i&&(i=M.state.projects.find((e=>e.id==t))),!i)return null;const s=e&&!i.isActive;return{title:i.title,id:i.id,disabled:s,children:s?[]:M.state.folders.filter((e=>e.parentId==t)).map((t=>this.getNode(t.id))).filter((t=>!!t))}}}},F=z,J=(0,N.Z)(F,D,A,!1,null,null,null),B=J.exports,Z={name:"Dashboard",components:{SelectFolder:B},created(){this.$root.main=this,document.addEventListener("visibilitychange",this.visibilityChange)},data(){return{showMessage:!1,message:null,showPopup:!1,popupMessage:null,state:M.state,confirmDialog:{show:!1,title:null,content:null,textYes:"Yes",textNo:"No",cancel:null,confirm:null},promptDialog:{show:!1,title:null,content:null,cancel:null,confirm:null,current:""},folderDialog:{show:!1,title:null,projectId:null,disabledId:null,noSelf:!1,selfId:null,cancel:null,confirm:null}}},methods:{visibilityChange(){switch(document.visibilityState){case"visible":b.action(42);break;case"hidden":b.action(43);break}},setMessage(t){this.message=t,this.showMessage=!0},setPopup(t){this.popupMessage=t,this.showPopup=!0},async confirm(t,e,i="Yes",s="No"){return this.confirmDialog.title=t,this.confirmDialog.content=e,this.confirmDialog.show=!0,this.confirmDialog.textYes=i,this.confirmDialog.textNo=s,new Promise(((t,e)=>{this.confirmDialog.confirm=t,this.confirmDialog.cancel=e}))},confirmCancel(){this.confirmDialog.show=!1,this.confirmDialog.cancel&&this.confirmDialog.cancel()},confirmOk(){this.confirmDialog.show=!1,this.confirmDialog.confirm&&this.confirmDialog.confirm()},async prompt(t,e){return this.promptDialog.title=t,this.promptDialog.current=e,this.promptDialog.show=!0,new Promise(((t,e)=>{this.promptDialog.confirm=t,this.promptDialog.cancel=e}))},promptCancel(){this.promptDialog.show=!1,this.promptDialog.cancel&&this.promptDialog.cancel(this.promptDialog.current),this.promptDialog.current=""},promptOk(){this.promptDialog.show=!1,this.promptDialog.confirm&&this.promptDialog.confirm(this.promptDialog.current),this.promptDialog.current=""},async folder(t,e,i,s=!1,a){return this.folderDialog.title=t,this.folderDialog.projectId=e,this.folderDialog.disabledId=i,this.folderDialog.noSelf=s,this.folderDialog.selfId=a,this.folderDialog.show=!0,new Promise(((t,e)=>{this.folderDialog.confirm=t,this.folderDialog.cancel=e}))},folderCancel(){this.folderDialog.show=!1,this.folderDialog.cancel&&this.folderDialog.cancel(this.folderDialog.folderId),this.folderDialog.projectId=null,this.folderDialog.disabledId=null,this.folderDialog.noSelf=!1,this.folderDialog.selfId=null},folderOk(t){this.folderDialog.show=!1,this.folderDialog.confirm&&this.folderDialog.confirm(t),this.folderDialog.projectId=null,this.folderDialog.disabledId=null,this.folderDialog.noSelf=!1,this.folderDialog.selfId=null},thumbSrc(t,e=!1){if(t.mapType>0)return"https://static.micr.io/home/img/editor/maptypes/1.png";const i=t.originalShortId||t.shortId;let s=1,a=e?0:-1;for(let r=t.tileSize;r{this.sending=!1,this.$root.main.setMessage("Succesfully agreed to terms. Thank you!"),M.state.user.agreedToTerms=!0}))}}},ot=rt,nt=(0,N.Z)(ot,st,at,!1,null,null,null),dt=nt.exports,lt=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("md-app-toolbar",{staticClass:"md-dense md-primary"},[i("div",{key:t.store.state.currentOrg,staticClass:"md-toolbar-row",class:t.store.state.isEditor&&"editor"},[t.store.state.isEditor?i("div",{staticClass:"md-toolbar-section-start"},[i("md-button",{staticClass:"md-icon-button",attrs:{href:"https://micr.io/",target:"_blank",title:"Micrio"}},[i("img",{staticClass:"logo",attrs:{src:"https://static.micr.io/home/img/icons/logo.svg"}})]),i("span",{ref:"editMenu"})],1):i("div",{staticClass:"md-toolbar-section-start"},[i("router-link",{staticClass:"logo-link",attrs:{to:"/"}},[i("img",{staticClass:"logo",attrs:{src:"https://static.micr.io/home/img/icons/logo.svg"}})]),i("md-button",{staticClass:"organisation-button",on:{click:t.iconClick}},[t.store.state.editing?i("md-icon",{attrs:{title:"Back to dashboard"}},[t._v("arrow_back")]):t.store.state.showOrgDrawer?i("span",[i("span",{staticClass:"org-name"},[t._v(t._s(t.store.state.organisation?t.store.state.organisation.name:"Organisation"))]),i("md-icon",[t._v("expand_more")])],1):t._e()],1),t.store.state.editing?i("span",[i("div",{ref:"editMenu"})]):t._e(),t.store.state.validOrg?i("md-tabs",{staticClass:"md-primary",class:t.store.state.editing&&"toolbar-hidden",attrs:{"md-active-tab":t.store.state.activeTab}},[i("md-tab",{attrs:{id:"tab-projects","md-label":"Projects",to:"/"+t.$route.params.organisation+"/projects/"}}),t.store.getters.showPayments?i("md-tab",{attrs:{id:"tab-payments","md-label":"Payments",to:"/"+t.$route.params.organisation+"/payments/"}}):t._e(),"s"!=t.store.state.currentOrg&&t.store.state.isAdmin&&t.store.state.organisation&&t.store.state.organisation.hasSettings?i("md-tab",{attrs:{id:"tab-org-settings","md-label":"Users & Settings",to:"/"+t.$route.params.organisation+"/settings/"}}):t._e()],1):t._e()],1),i("div",{staticClass:"md-toolbar-section-end"},[i("div",{ref:"editIcons",staticClass:"editor-icons"}),i("md-menu",{attrs:{"md-align-trigger":"","md-direction":"bottom-end"}},[i("md-button",{staticClass:"md-icon-button",attrs:{"md-menu-trigger":""}},[t._v(" "+t._s(t.$route.params.lang)+" ")]),i("md-menu-content",t._l(t.store.state.langs,(function(e,s){return i("md-menu-item",{key:s,on:{click:function(e){return t.setLang(s)}}},[i("md-button",{attrs:{"md-menu-trigger":""}},[t._v(t._s(e))])],1)})),1)],1),!t.store.state.isEditor&&t.store.state.organisation?i("md-menu",{attrs:{"md-align-trigger":"","md-direction":"bottom-end"}},[i("md-button",{staticClass:"md-icon-button",attrs:{"md-menu-trigger":"",title:"Search for images"}},[i("md-icon",[t._v("search")])],1),i("md-menu-content",[i("md-menu-item",[i("Search")],1)],1)],1):t._e(),i("md-menu",{attrs:{"md-align-trigger":"","md-direction":"bottom-end"}},[i("md-button",{staticClass:"md-icon-button",attrs:{href:"http://doc.micr.io/",target:"_blank",title:"Micrio Documentation"}},[i("md-icon",[t._v("help")])],1)],1),t.store.state.isEditor?t._e():i("Notifications"),i("md-menu",{attrs:{"md-align-trigger":"","md-direction":"bottom-end"}},[i("md-button",{staticClass:"md-icon-button",attrs:{"md-menu-trigger":""}},[i("md-icon",[t._v("more_vert")])],1),i("md-menu-content",[t.store.state.isEditor?t._e():i("md-menu-item",[t._v(t._s(t.store.state.user.email))]),i("md-menu-item",[i("a",{attrs:{href:"https://account.micr.io/profile"}},[t._v("Your account")])]),i("md-menu-item",[i("span",{staticStyle:{"margin-right":"20px"}},[t._v("Show hints")]),i("md-switch",{on:{change:t.toggleShowTutorials},model:{value:t.store.state.showTutorials,callback:function(e){t.$set(t.store.state,"showTutorials",e)},expression:"store.state.showTutorials"}})],1),t.store.state.isEditor?t._e():i("md-menu-item",[i("md-button",{staticClass:"md-primary md-accent md-raised",attrs:{href:"https://account.micr.io/logout"},on:{click:t.clearLocalStorage}},[t._v("Log out")])],1)],1)],1)],1)])])},ct=[],mt=function(){var t=this,e=t.$createElement,i=t._self._c||e;return t.notifications.length?i("md-menu",{attrs:{"md-direction":"bottom-end","md-align-trigger":""}},[i("md-button",{staticClass:"md-icon-button",attrs:{"md-menu-trigger":""}},[i("md-icon",[t._v("message")]),i("div",{staticClass:"message-num"},[t._v(t._s(t.notifications.length))])],1),i("md-menu-content",{staticClass:"notifications"},[i("md-menu-item",t._l(t.notifications,(function(e){return i("md-card",{key:e.id,staticClass:"notification"},[i("md-card-header",[i("div",{staticClass:"md-title"},[t._v(t._s(e.subject))]),i("small",[t._v(t._s(t.$root.timeAgo(e.created)))])]),i("md-card-content",{domProps:{innerHTML:t._s(t.marked(e.bodyText))}}),i("md-card-actions",[i("md-button",{staticClass:"md-primary md-raised",on:{click:function(i){return t.setRead(e.id)}}},[t._v("Dismiss")])],1)],1)})),1)],1)],1):t._e()},ut=[],ht=i(7441),pt={data(){return{user:M.state.user,notifications:M.state.user.notifications,marked:ht.TU}},methods:{setRead(t){this.notifications.splice(this.notifications.findIndex((e=>e.id==t)),1),b.readNotification(t)}},mounted(){const t=this.$el&&this.$el.querySelector&&this.$el.querySelector(".md-button[md-menu-trigger]");t&&this.notifications.length&&setTimeout((()=>t.click()),500)}},gt=pt,vt=(0,N.Z)(gt,mt,ut,!1,null,null,null),ft=vt.exports,bt=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{attrs:{id:"search"}},[i("form",{on:{submit:t.search}},[i("input",{directives:[{name:"model",rawName:"v-model",value:t.query,expression:"query"}],attrs:{name:"q",type:"search",disabled:t.loading,required:"",placeholder:"Image ID or name"},domProps:{value:t.query},on:{input:function(e){e.target.composing||(t.query=e.target.value)}}}),i("input",{attrs:{type:"submit",value:"Search",disabled:!t.query.length||t.loading}})]),t.searched&&!t.loading?i("div",{staticClass:"results"},[t.results.length?i("div",[i("h4",[t._v("Results ("+t._s(t.results.length)+")")]),t._l(t.results,(function(e){return i("router-link",{key:e.id,staticClass:"result",attrs:{to:t.getHref(e)}},[i("img",{attrs:{src:t.state.iiifUrl+e.shortId+"/full/100,/0/default.jpg"}}),i("code",[t._v(t._s(e.shortId))]),i("h5",[t._v(t._s(e.title))])])}))],2):i("div",[i("i",[t._v("No results")])])]):t._e()])},_t=[],yt={data(){return{searched:!1,loading:!1,query:"",results:[],state:M.state}},methods:{async search(t){t.stopPropagation(),t.preventDefault(),this.loading=!0,this.results.length=0;var e=await b.search(this.query,M.state.currentOrgId).catch((()=>{}));return this.loading=!1,this.searched=!0,e&&e.length&&(this.results=e),!1},getHref(t){const e=M.state.projects.find((e=>e.id==t.projectId)),i=M.state.folders.find((e=>e.id==t.folderId));return e?"/"+M.state.currentOrg+"/projects/"+e.slug+"/"+(i?i.slug+"/":"")+"edit/"+t.shortId+"/"+M.getters.currentCulture||0:null}}},kt=yt,wt=(0,N.Z)(kt,bt,_t,!1,null,null,null),St=wt.exports,$t={components:{Notifications:ft,Search:St},data(){return{store:M}},methods:{clearLocalStorage(){localStorage.clear()},iconClick(){M.state.editing?this.$route.path.endsWith("spaces/edit")?this.$router.push("../"):(b.action(41,this.$route.params.id),this.$router.push("../../")):M.state.user.organisations.length&&this.$emit("toggleMenu")},toggleShowTutorials(t){localStorage.setItem("editor_showTutorials",t?"1":"0"),this.$root.editor&&this.$root.editor.tutorial.show(null),b.action(102,null,!!t)},async setLang(t){this.$router.push(this.$route.path.replace(/.{2}$/,t))}}},It=$t,Ct=(0,N.Z)(It,lt,ct,!1,null,null,null),Pt=Ct.exports,xt={components:{AgreeToTerms:dt,MainToolbar:Pt},created(){this.$root.main.home=this},data(){return{menuVisible:!1,store:M}}},jt=xt,Tt=(0,N.Z)(jt,et,it,!1,null,null,null),Mt=Tt.exports,Dt=function(){var t=this,e=t.$createElement,i=t._self._c||e;return t.state.projectsLoaded?i("section",{staticClass:"projects",class:t.store.getters.isLimitReached&&"is-limit-reached"},[t.state.organisation?i("h1",{staticClass:"md-headline"},[t._v("Your projects "),t.state.organisation?i("span",[t._v("in "+t._s(t.state.organisation.name))]):t._e()]):t._e(),t.state.projects.length?i("md-menu",{staticClass:"folder-view folder-view-projects"},[i("md-button",{staticClass:"md-narrow",class:{active:t.listView},on:{click:function(e){return t.setListView(!0)}}},[i("md-icon",[t._v("list")])],1),i("md-button",{staticClass:"md-narrow",class:{active:!t.listView},on:{click:function(e){return t.setListView(!1)}}},[i("md-icon",[t._v("grid_view")])],1)],1):t._e(),t.state.user.isV3&&!t.state.organisation?i("md-empty-state",{attrs:{"md-icon":"update","md-label":"You have a new dashboard!"}},[t.state.organisations.length?i("p",[t._v("To keep working in existing projects of your organisation(s), switch to the group using the menu on the top left")]):i("p",[t._v("Click the button below to continue to your new dashboard environment")]),i("md-button",{staticClass:"md-primary md-raised",attrs:{href:"https://dash.micr.io"}},[t._v("To the new dashboard")])],1):!t.state.projects.length&&t.canCreate?i("md-empty-state",{attrs:{"md-icon":"collections","md-label":t.state.organisation?"Create a project":"Create your first project","md-description":"Create a new project and start uploading your first image"}},[t.state.canCreate?i("md-button",{staticClass:"md-primary md-raised",attrs:{to:"/"+t.$route.params.organisation+"/projects/create"}},[t._v("Create your first project")]):t._e()],1):t.state.projects.length||t.state.isAdmin?i("div",[t.state.organisation||t.state.user.hasStripeSource||!t.store.getters.showPayments?t._e():i("md-toolbar",{staticClass:"notification"},[t._v(" You have not yet entered your credit card details. If you connect your creditcard, no billing will take place yet. You can do that "),i("router-link",{attrs:{to:"/"+t.$route.params.organisation+"/payments"}},[t._v("by clicking here")]),t._v(". ")],1),t.listView?i("table",{staticClass:"projects-table"},[i("thead",[i("tr",[i("th",[t._v("Name")]),i("th",{staticClass:"center no-mobile pre"},[i("md-icon",[t._v("image")]),t._v("Images")],1),i("th",{staticClass:"center no-mobile pre"},[i("md-icon",[t._v("event")]),t._v("Created")],1),i("th",{staticClass:"center no-mobile pre",attrs:{title:"Total project size"}},[i("md-icon",[t._v("storage")]),t._v(" Size")],1)])]),i("tbody",[t._l(t.activeProjects,(function(t){return[i("ProjectListItem",{key:t.id,attrs:{id:t.id}})]}))],2)]):i("div",{staticClass:"projects-container"},t._l(t.activeProjects,(function(t){return i("div",{key:t.id},[i("ProjectCard",{attrs:{id:t.id}})],1)})),0),t.canCreate?i("div",{staticClass:"create-project"},[i("md-button",{staticClass:"md-primary md-accent md-raised",attrs:{to:"/"+t.$route.params.organisation+"/projects/create"}},[t._v("Create a new project")])],1):t._e(),t.inactiveProjects.length?[i("md-divider"),t.state.organisation?i("h2",{staticClass:"md-headline"},[t._v(" Inactive projects "),t.state.organisation?i("span",[t._v("in "+t._s(t.state.organisation.name))]):t._e()]):t._e(),t.listView?i("table",{staticClass:"projects-table"},[i("thead",[i("tr",[i("th",[t._v("Name")]),i("th",{staticClass:"center no-mobile pre"},[i("md-icon",[t._v("image")]),t._v("Images")],1),i("th",{staticClass:"center no-mobile pre"},[i("md-icon",[t._v("event")]),t._v("Created")],1),i("th",{staticClass:"center no-mobile pre",attrs:{title:"Total project size"}},[i("md-icon",[t._v("storage")]),t._v(" Size")],1)])]),i("tbody",[t._l(t.inactiveProjects,(function(t){return[i("ProjectListItem",{key:t.id,attrs:{id:t.id}})]}))],2)]):i("div",{staticClass:"projects-container"},t._l(t.inactiveProjects,(function(t){return i("div",{key:t.id},[i("ProjectCard",{attrs:{id:t.id}})],1)})),0)]:t._e(),i("md-divider"),t.g.isSharedLimit&&t.sub?i("div",{staticClass:"usage-info md-layout"},[i("div",{staticClass:"md-layout-item md-size-15 md-small-size-30"},[i("h3",[t._v("Size")]),i("p",[t._v(" Images: "+t._s(t.usage.images)+" "),t.sub.maxImages>0&&t.usage.images>=t.sub.maxImages?i("span",{staticClass:"limit-reached"},[t._v("Limit reached")]):t._e()]),i("p",[t._v(" "+t._s(t.$root.getFileSize(t.usage.storage))+" used ")])]),t.usage.visitors||t.usage.bandwidth?i("div",{staticClass:"md-layout-item md-size-15 md-small-size-30"},[i("h3",[t._v("Usage last 12 months")]),t.usage.visitors?i("p",[t._v(" Views: "+t._s(t.$root.getReadable(t.usage.visitors))+" ")]):t._e(),t.usage.bandwidth?i("p",[t._v(" Bandwidth: "+t._s(t.$root.getFileSize(t.usage.bandwidth))+" ")]):t._e()]):t._e()]):t._e()],2):i("md-empty-state",{attrs:{"md-icon":"collections","md-label":"No projects yet","md-description":"Please contact someone who can create new projects in this organisation"}})],1):t._e()},At=[],Ot=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("md-card",{class:["project-card tile",t.project.isActive&&"active",t.project.isTrial&&"trial"]},[i("md-card-media",{staticClass:"md-layout md-ratio-16-9",class:{"tile-image-placeholder":!t.project.numberOfImages}},[i("router-link",{staticClass:"image-link",attrs:{to:"./"+t.project.slug+"/"}},[t.store.state.hasIIIF?t._l(t.project.previewImages,(function(e,s){return i("div",{key:s,staticClass:"image-wrapper md-layout-item",class:{"multiple-lines":t.project.numberOfImages>2}},[i("img",{attrs:{src:""+t.store.state.iiifUrl+e+"/full/^,400/0/default.jpg"}})])})):t._e(),t.project.numberOfImages?i("md-icon",{staticClass:"image-count"},[t._v(t._s(t.project.numberOfImages>9?"filter_9_plus":"filter_"+t.project.numberOfImages))]):i("md-icon",{staticClass:"folder"},[t._v("folder")])],2)],1),i("md-card-header",[i("md-card-header-text",[i("router-link",{staticClass:"image-link",attrs:{to:"./"+t.project.slug+"/"}},[i("p",{staticClass:"card-title"},[t._v(t._s(t.project.title))])]),i("div",{staticClass:"card-subtitles"},[i("p",{staticClass:"card-subtitle"},[t.project.isActive?t._e():i("span",[t._v(t._s(t.status)+",")]),t.project.trialDaysLeft>0&&t.project.isActive?i("span",[t._v(" "+t._s(t.project.trialDaysLeft)+" "),t.project.hasStripeSubscription?i("span",[t._v("days until first billing")]):i("span",[t._v("trial days left")])]):t.project.endDate?i("span",[t._v(" until "+t._s(t.project.endDate.split("T")[0]))]):0!=t.project.trialDaysLeft||t.project.isActive?i("span",[t._v(" "+t._s(t.project.created.split("T")[0]))]):i("span",[t._v(", "+t._s(t.project.inactiveReason))]),t.project.isPrivate?i("span",{staticClass:"md-accent"},[t._v(", non-public")]):t._e()]),i("p",{staticClass:"card-subtitle"},[t._v(t._s(t.project.numberOfImages)+" image"+t._s(1==t.project.numberOfImages?"":"s"))])])],1),t.isProjectAdmin?i("md-menu",{attrs:{"md-size":"big","md-direction":"bottom-end"}},[i("md-button",{staticClass:"md-icon-button",attrs:{"md-menu-trigger":""}},[i("md-icon",[t._v("more_vert")])],1),i("md-menu-content",[t.project.isActive?i("md-menu-item",{on:{click:function(e){t.showRename=!0}}},[t._v("Rename")]):t._e(),t.project.isActive&&t.canUpgrade?i("md-menu-item",{attrs:{to:"./"+t.project.slug+"/"+(t.project.isTrial?"activate":"upgrade")}},[t._v(t._s(t.project.isTrial?"Activate":"Change")+" plan")]):t._e(),t.store.state.organisation&&t.store.state.organisation.customPayments?t._e():[t.project.hasStripeSubscription?i("md-menu-item",{staticClass:"md-accent",attrs:{to:"./"+t.project.slug+"/deactivate"}},[t._v("Deactivate")]):t.project.isTrial?t._e():i("md-menu-item",{staticClass:"md-accent",attrs:{to:"./"+t.project.slug+"/delete"}},[t._v("Delete")])]],2),i("md-dialog-prompt",{attrs:{"md-active":t.showRename,"md-title":"Set a new project title","md-input-maxlength":"100","md-input-placeholder":"Type a title...","md-confirm-text":"Done"},on:{"update:mdActive":function(e){t.showRename=e},"update:md-active":function(e){t.showRename=e},"md-confirm":t.doRename},model:{value:t.title,callback:function(e){t.title=e},expression:"title"}})],1):t._e()],1),i("md-card-actions",[t.project.customInvoiced?t.project.isActive?t._e():[i("md-button",{staticClass:"md-accent",attrs:{to:"./"+t.project.slug+"/activate"}},[t._v("Activate")])]:[t.project.hasStripeSubscription?i("md-button",{staticClass:"md-grey",attrs:{to:"./"+t.project.slug+"/deactivate"}},[t._v("Deactivate")]):t.project.isActive&&t.canUpgrade?i("md-button",{staticClass:"md-grey",attrs:{to:"./"+t.project.slug+"/activate"}},[t._v("Activate")]):t._e()],i("md-button",{staticClass:"md-primary",attrs:{to:"./"+t.project.slug+"/"}},[t._v("Open")])],2)],1)},Et=[],Lt={props:{id:String},data(){return{store:M,showRename:!1,title:M.state.projects.find((t=>t.id==this.id)).title,project:M.state.projects.find((t=>t.id==this.id)),images:[]}},computed:{status(){return this.project.isActive?"active":"inactive"},numImages(){const t=this.project.numberOfImages;return`${t} image${1!=t?"s":""}`},subscription(){return this.project.subscription||this.project.subscriptionOrgId&&M.state.subscriptions.find((t=>t.id==this.project.subscriptionOrgId))},canUpgrade(){const t=!M.state.organisation||!M.state.organisation.isFree;let e=!1,i=!1;return(!M.state.organisation||!M.state.organisation.customPayments)&&(this.subscription&&(e=this.subscription.monthlyAmount>0||this.subscription.trialDays>0,i=e),t&&e&&i)},isProjectAdmin(){return M.state.isAdmin||M.state.organisation&&!M.state.organisation.isShared}},methods:{async doRename(){if(!this.title)return this.$root.main.setPopup("Please enter a title"),void(this.title=this.project.title);this.project.title=this.title;let t=await b.renameFolder(this.id,this.title);this.project.slug=t.slug}}},Rt=Lt,Nt=(0,N.Z)(Rt,Ot,Et,!1,null,null,null),Vt=Nt.exports,Ut=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("tr",[i("td",{staticClass:"pre title"},[i("router-link",{attrs:{to:"./"+t.project.slug+"/"}},[t._v(t._s(t.project.title))])],1),i("td",{staticClass:"pre right no-mobile"},[t.project.numberOfImages?i("span",{attrs:{title:t.project.numberOfImages+" images"}},[t._v(t._s(t.project.numberOfImages)+" image"+t._s(1==t.project.numberOfImages?"":"s"))]):t._e()]),i("td",{staticClass:"pre right no-mobile"},[t.project.created?i("span",{attrs:{title:t.project.created}},[t._v(t._s(t.$root.timeAgo(t.project.created)))]):t._e()]),i("td",{staticClass:"pre right no-mobile"},[t.project.fileSize&&!t.project.mapType?i("span",[t._v(t._s(t.$root.getFileSize(t.project.fileSize)))]):t._e()]),i("td",{staticClass:"menu"},[i("md-menu",[i("md-button",{staticClass:"md-icon-button md-primary",attrs:{"md-menu-trigger":""}},[i("md-icon",[t._v("more_vert")])],1),i("md-menu-content",[t.project.isActive?i("md-menu-item",{on:{click:function(e){t.showRename=!0}}},[t._v("Rename")]):t._e(),t.project.isActive&&t.canUpgrade?i("md-menu-item",{attrs:{to:"./"+t.project.slug+"/"+(t.project.isTrial?"activate":"upgrade")}},[t._v(t._s(t.project.isTrial?"Activate":"Change")+" plan")]):t._e(),t.store.state.organisation&&t.store.state.organisation.customPayments?t._e():[t.project.hasStripeSubscription?i("md-menu-item",{staticClass:"md-accent",attrs:{to:"./"+t.project.slug+"/deactivate"}},[t._v("Deactivate")]):t.project.isTrial?t._e():i("md-menu-item",{staticClass:"md-accent",attrs:{to:"./"+t.project.slug+"/delete"}},[t._v("Delete")])],t.project.isActive?t._e():i("md-menu-item",{staticClass:"md-primary",attrs:{to:"./"+t.project.slug+"/activate"}},[t._v("Activate")])],2)],1)],1)])},zt=[],Ft={props:{id:String},data(){return{store:M,showRename:!1,title:M.state.projects.find((t=>t.id==this.id)).title,project:M.state.projects.find((t=>t.id==this.id)),images:[]}},computed:{status(){return this.project.isActive?"active":"inactive"},numImages(){const t=this.project.numberOfImages;return`${t} image${1!=t?"s":""}`},subscription(){return this.project.subscription||this.project.subscriptionOrgId&&M.state.subscriptions.find((t=>t.id==this.project.subscriptionOrgId))},canUpgrade(){const t=!M.state.organisation||!M.state.organisation.isFree;let e=!1,i=!1;return(!M.state.organisation||!M.state.organisation.customPayments)&&(this.subscription&&(e=this.subscription.monthlyAmount>0||this.subscription.trialDays>0,i=e),t&&e&&i)},isProjectAdmin(){return M.state.isAdmin||M.state.organisation&&!M.state.organisation.isShared}},methods:{async doRename(){if(!this.title)return this.$root.main.setPopup("Please enter a title"),void(this.title=this.project.title);this.project.title=this.title;let t=await b.renameFolder(this.id,this.title);this.project.slug=t.slug}}},Jt=Ft,Bt=(0,N.Z)(Jt,Ut,zt,!1,null,null,null),Zt=Bt.exports,Yt={components:{ProjectCard:Vt,ProjectListItem:Zt},data(){return{store:M,state:M.state,g:M.getters,listView:!1}},computed:{canCreate(){return M.state.canCreate&&(M.state.isAdmin||M.getters.isFreeOrg)},sub(){return M.getters.subscriptionOrg},usage(){return M.getters.usage},activeProjects(){return M.state.projects.filter((t=>t.isActive))},inactiveProjects(){return M.state.projects.filter((t=>!t.isActive))}},mounted(){M.state.activeTab="tab-projects";const t=localStorage.getItem("projectListView");t&&(this.listView="true"===t)},created(){if(M.state.autoOpenedTrial)return;const t=M.state.projects[0];"s"==this.$route.params.organisation&&1==M.state.projects.length&&t.isTrial&&0==t.numberOfImages&&(M.state.autoOpenedTrial=!0,this.$router.push({path:"/s/projects/"+t.slug+"/"}))},methods:{setListView(t){this.listView=t,localStorage.setItem("projectListView",t.toString())}}},Wt=Yt,Gt=(0,N.Z)(Wt,Dt,At,!1,null,null,null),Xt=Gt.exports,qt=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("section",{staticClass:"invoices"},[i("div",[i("h2",[t._v("Payment history")]),t.store.state.organisation&&t.store.state.organisation.billingAccount?i("md-content",[t._v(" This organisation's billing is handled by "),i("b",[t._v(t._s(t.store.state.organisation.billingAccount))]),t.store.state.organisation.billingAccount==t.store.state.user.email?i("span",[t._v("(you)")]):t._e()]):t._e(),t.hasStripeSource?i("md-button",{staticClass:"md-primary md-accent md-raised update-card",attrs:{to:"/"+t.$route.params.organisation+"/user/updateCard"}},[t._v("Update your card")]):t.store.state.user.invoicePayments?t._e():i("md-button",{attrs:{to:"/"+t.$route.params.organisation+"/user/updateCard"}},[t._v("Link your credit card for automatic payments")]),t.loading?i("div",{staticClass:"micrio-loader"}):i("md-table",{attrs:{"md-card":""}},[i("md-table-row",[i("md-table-head",[t._v("Invoice date")]),i("md-table-head",[t._v("Project")]),i("md-table-head",[t._v("Description")]),i("md-table-head",[t._v("Period")]),i("md-table-head",[t._v("Amount")]),i("md-table-head",[t._v("Status")]),i("md-table-head",[t._v("Invoices and receipts")])],1),t._l(t.invoices,(function(e){return i("md-table-row",{key:e.id,class:e.voided?"voided":null},[i("md-table-cell",[t._v(t._s(t.getDate(e.date)))]),i("md-table-cell",[e.projectDeleted?i("span",[i("b",[t._v(t._s(e.projectName))]),t._v(" (deleted)")]):i("router-link",{attrs:{to:"/"+t.$route.params.organisation+"/projects/"+e.projectShortId}},[i("b",[t._v(t._s(e.projectName))])])],1),i("md-table-cell",[t._v(t._s(e.description))]),i("md-table-cell",[t._v(t._s(t.getDate(e.startDate))+" - "+t._s(t.getDate(e.endDate)))]),i("md-table-cell",[i("span",{staticClass:"no-break"},[t._v(t._s(e.currency.toUpperCase())+" "+t._s(e.amount/100))])]),i("md-table-cell",[t._v(t._s(e.voided?"Voided":e.received?"Received":"Open"))]),i("md-table-cell",[e.downloadURL?i("a",{staticClass:"download-invoice no-break",attrs:{href:e.downloadURL,target:"_blank"}},[i("md-icon",[t._v("link")]),t._v(" Download at Stripe")],1):t._e()])],1)}))],2)],1)])},Kt=[],Ht={mounted(){M.state.activeTab="tab-payments",b.getInvoices().then((t=>{this.invoices=t,this.loading=!1})).catch((t=>{this.$root.main.setPopup(String(t))}))},computed:{hasStripeSource(){return!(M.state.organisation?!M.state.organisation.hasStripeSource:!M.state.user.hasStripeSource||M.state.user.invoicePayments)}},data(){return{store:M,loading:!0,invoices:[]}},methods:{getDate(t){let e=new Date(t);return e.getDate()+"/"+(e.getMonth()+1)+"/"+e.getFullYear()}}},Qt=Ht,te=(0,N.Z)(Qt,qt,Kt,!1,null,null,null),ee=te.exports,ie=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{class:t.drawerOpen&&"drawer-open",attrs:{id:"editor"}},[t.image?[i("KeyboardControls"),i("md-tabs",{ref:"editMenu",staticClass:"md-primary",attrs:{id:"editor-menu","md-active-tab":t.activeSection}},[i("md-tab",{attrs:{id:"none"}}),i("md-tab",{attrs:{id:"settings","md-label":"Image"},on:{click:function(e){return t.setSection("settings")}}}),i("md-tab",{attrs:{id:"markers","md-label":"Markers"},on:{click:function(e){return t.setSection("markers")}}}),i("md-tab",{attrs:{id:"tours","md-label":"Tours"},on:{click:function(e){return t.setSection("tours")}}}),i("md-tab",{attrs:{id:"audio","md-label":"Audio"},on:{click:function(e){return t.setSection("audio")}}}),t.canEmbed?i("md-tab",{attrs:{id:"embeds","md-label":"Embeds"},on:{click:function(e){return t.setSection("embeds")}}}):t._e(),i("md-tab",{attrs:{id:"customPages","md-label":"Custom Pages"},on:{click:function(e){return t.setSection("customPages")}}})],1),i("md-menu",{ref:"toolbarIcons"},[i("a",{staticClass:"md-button md-icon-button",attrs:{title:"Preview"},on:{click:t.preview}},[i("md-icon",[t._v("pageview")])],1),i("a",{staticClass:"md-button md-icon-button",attrs:{title:"Publish"},on:{click:t.publish}},[i("md-icon",[t._v("publish")])],1),i("a",{staticClass:"md-button md-icon-button",attrs:{title:"Public link",href:"https://i."+(t.isDevEnv?"micrio.dev":"micr.io")+"/"+t.image.shortId+"/"+("en"!=t.$root.editor.lang?t.$root.editor.lang:""),target:"_blank"}},[i("md-icon",[t._v("link")])],1)]),t.saving?i("md-progress-bar",{attrs:{"md-mode":"indeterminate"}}):t._e(),i("div",{ref:"micrioContainer",class:"micrio-container"+(this.imageVersion>=4.2?"":" v3"),on:{click:t.printCoo}},[i("micr-io",{ref:"micrio",attrs:{id:t.image.originalShortId||t.image.shortId,iiif:t.image.iiifManifest,width:t.image.width,height:t.image.height,path:t.image.path||t.baseUrl,tileSize:t.image.tileSize||1024,png:t.image.isPng,format:t.image.format,extension:t.image.tileExtension,legacy:t.image.legacyTiles,skipmeta:"",ui:"false"}},[!t.showMarkers&&!t.currentMarkerTour||t.currentVideoTour?t._e():i("div",{staticClass:"micrio-markers main"},t._l(t.data.markers,(function(t){return i("MMarker",{key:t.id,attrs:{data:t}})})),1)]),t.showSettings&&t.$refs.settings.showStartView?i("Rectangle",{ref:"viewRect",attrs:{boundless:t.image.is360,area:t.startView},on:{change:t.svChanged}}):t._e(),t.showSettings&&t.$refs.settings.showMapLimit?i("Rectangle",{ref:"mapLimitRect",attrs:{area:t.settings.mapLimit}}):t._e(),t.showSettings&&t.$refs.settings.showFocusPoint?i("Focus",{attrs:{position:t.settings.focus}}):t._e(),t.currentVideoTour?i("VideoTour",{attrs:{data:t.currentVideoTour}}):t._e(),t.showPositional?t._l(t.data.audio.locations,(function(t){return i("AudioLocation",{key:t.id,attrs:{sample:t}})})):t._e(),t.showEmbeds?t._l(t.data.children,(function(t){return i("MEmbed",{key:t.guid,attrs:{embed:t}})})):t._e()],2),i("md-app-drawer",{staticClass:"editor-drawer",attrs:{"md-right":!0,"md-active":t.showSidebar},on:{"update:mdActive":function(e){t.showSidebar=e},"update:md-active":function(e){t.showSidebar=e}}},[i("ImageSettings",{ref:"settings",attrs:{image:t.image,meta:t.data}}),i("MarkerEditor",{ref:"markers"}),i("Tours",{ref:"tours"}),i("AudioEditor",{ref:"audio"}),i("EmbedEditor",{ref:"embeds"}),i("CustomPages",{ref:"customPages"}),i("md-button",{staticClass:"md-icon-button",attrs:{id:"close-drawer-button"},on:{click:function(e){return t.setSection("none")}}},[i("md-icon",[t._v("close")])],1)],1),t.showAssetPicker?i("AssetPicker",{key:t.assetPickerType,ref:"assetPicker",attrs:{no360:t.no360Picker,maps:t.mapsPicker,type:t.assetPickerType}}):t._e(),i("Tutorial")]:t._e()],2)},se=[],ae=i(3811),re=i.n(ae);class oe{constructor(t,e,i){this.guid=t,this.lang=e,this.onmessage=i,this.socket=new WebSocket(`wss://live.micr.io/image/${t}/${e}`),this.socket.addEventListener("message",(t=>{if(!t||!t.data)return;const e=Number(t.data.substr(0,1)),i=JSON.parse(t.data.substr(1));i&&this.onmessage(e,i)}))}send(t,e){1==this.socket.readyState&&this.socket.send(t+JSON.stringify(e))}close(){this.socket.close()}}var ne=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{class:["rectangle",t.active&&"active",t.dark&&"dark",t.rounded&&"rounded",t.className],style:t.style,on:{click:t.click}},[t.icon?i("md-icon",{staticClass:"main-icon"},[t._v(t._s(t.icon))]):t._e(),i("md-icon",{ref:"resize",staticClass:"resize"},[t._v("aspect_ratio")]),void 0!=t.slider?i("input",{ref:"slider",attrs:{type:"range",min:"0",max:"2",step:"0.01"},domProps:{value:t.slider},on:{input:t.setSlider}}):t._e(),null!=t.label?i("div",{staticClass:"label"},[t._v(t._s(t.label))]):t._e(),t._t("default")],2)},de=[],le={props:{area:{type:Array,default(){return[.4,.4,.6,.6]}},offset:{type:Array,default(){return[0,0]}},dark:Boolean,background:String,ratio:Number,label:String,className:String,rounded:Boolean,icon:String,slider:Number,boundless:Boolean,centered:Boolean,outsideBlurs:Boolean,x:Number,y:Number,radius:Number,limited:Boolean,id:{type:String,default(){return this.$root.createGuid()}}},data(){return{px:[0,0],wh:[0,0],dStartCoo:[0,0],dOrigArea:[0,0,0,0],rStartCoo:[0,0],manipulating:!1,mx:0,my:0,mradius:0}},mounted(){if(this.mx=this.x,this.my=this.y,this.mradius=this.radius,this.micrio=this.$root.editor.$refs.micrio,this.micrio.addEventListener("draw",this.place),this.ratio){const t=this.limitSize(),e=[this.area[0]+(this.area[2]-this.area[0])/2,this.area[1]+(this.area[3]-this.area[1])/2];this.area[0]=e[0]-t[0]/2,this.area[1]=e[1]-t[1]/2,this.area[2]=e[0]+t[0]/2,this.area[3]=e[1]+t[1]/2}this.limited&&(this.dOrigArea=this.area.slice(),this.limit()),this.place()},beforeDestroy(){this.micrio&&this.micrio.removeEventListener("draw",this.place),this.$el.removeEventListener("mousedown",this.dStart),this.dEnd(),this.rEnd()},computed:{style(){return`\n\t\t\t\ttransform:translate3d(${this.px[0]-this.offset[0]}px,${this.px[1]-this.offset[1]}px,0);\n\t\t\t\twidth:${this.wh[0]}px;\n\t\t\t\theight:${this.wh[1]}px;\n\t\t\t\tbackground-image:${this.background?"url("+this.background+")":"none"};\n\t\t\t`},active(){return this.$root.editor.activeRect==this.id}},watch:{active(){this.active?(this.$el.addEventListener("mousedown",this.dStart),this.$refs.resize.$el.addEventListener("mousedown",this.rStart),this.outsideBlurs&&this.micrio.addEventListener("mousedown",this.blur),addEventListener("keydown",this.move)):(this.$el.removeEventListener("mousedown",this.dStart),this.$refs.resize.$el.removeEventListener("mousedown",this.rStart),this.outsideBlurs&&this.micrio.removeEventListener("mousedown",this.blur),removeEventListener("keydown",this.move)),this.$emit("active",this.active)}},methods:{move(t){const e=1,i=(39==t.keyCode?1:37==t.keyCode?-1:0)*e,s=(40==t.keyCode?1:38==t.keyCode?-1:0)*e,a=this.micrio,r=a.camera.getScale(),o=Number(a.getAttribute("width")),n=Number(a.getAttribute("height"));this.area[0]+=i/o/r,this.area[1]+=s/n/r,this.area[2]+=i/o/r,this.area[3]+=s/n/r,this.$emit("change",this.area),this.place()},place(){if(this.rounded){const t=this.micrio;this.px=t.camera.getXY(this.mx,this.my);const e=Number(this.micrio.getAttribute("width")),i=this.mradius*e*t.camera.getScale();this.offset[0]=i/2,this.offset[1]=i/2,this.wh=[i,i]}else{this.px=this.micrio.camera.getXY(this.area[0],this.area[1]);const t=this.micrio.camera.getXY(this.area[2],this.area[3]);this.wh[0]=t[0]-this.px[0],this.ratio?this.wh[1]=this.wh[0]/this.ratio:this.wh[1]=t[1]-this.px[1]}},click(t){t&&"INPUT"==t.target.tagName||this.manipulating||(this.$root.editor.activeRect=this.active?null:this.id)},blur(t){"CANVAS"==t.target.tagName&&(this.$root.editor.activeRect=null)},setSlider(){this.$emit("change")},limitSize(){const t=[this.area[2]-this.area[0],this.area[3]-this.area[1]],e=Number(this.micrio.getAttribute("width"))/Number(this.micrio.getAttribute("height"));return this.ratio&&this.limited&&(t[1]=t[0]/this.ratio*e,t[1]>1&&(this.area[1]-=t[1]-1,t[1]=1,t[0]=t[1]*this.ratio/e)),t},limit(t=[0,0]){const e=this.limitSize(),i=[this.dOrigArea[0]+t[0],this.dOrigArea[1]+t[1]];this.boundless||(i[0]=Math.max(0,Math.min(i[0],1-e[0])),i[1]=Math.max(0,Math.min(i[1],1-e[1]))),this.area[0]=i[0],this.area[1]=i[1],this.area[2]=i[0]+e[0],this.area[3]=i[1]+e[1]},dStart(t){"INPUT"!=t.target.tagName&&(this.dStartCoo=this.micrio.camera.getCoo(t.clientX,t.clientY,!0),this.dOrigArea=this.area.slice(),addEventListener("mousemove",this.dMove,!0),addEventListener("mouseup",this.dEnd,!0))},dMove(t){const e=this.micrio.camera.getCoo(t.clientX,t.clientY,!0),i=[e[0]-this.dStartCoo[0],e[1]-this.dStartCoo[1]];0==i[0]&&0==i[1]||(this.centered?(this.mx=e[0],this.my=e[1]):this.limit(i),this.manipulating=!0,this.$emit("change",this.area),this.place())},dEnd(t){t&&(t.stopPropagation(),t.preventDefault()),setTimeout((()=>this.manipulating=!1)),removeEventListener("mousemove",this.dMove,!0),removeEventListener("mouseup",this.dEnd,!0)},rStart(t){t&&(t.stopPropagation(),t.preventDefault()),this.rStartCoo=this.micrio.camera.getCoo(t.clientX,t.clientY,!0,!0),this.dOrigArea=this.area.slice(),this.startRadius=this.mradius+0,addEventListener("mousemove",this.rMove),addEventListener("mouseup",this.rEnd)},rMove(t){const e=this.micrio.camera.getCoo(t.clientX,t.clientY,!0,!0),i=[e[0]-this.rStartCoo[0],e[1]-this.rStartCoo[1]];this.manipulating=!0,this.rounded?this.mradius=this.startRadius+Math.min(i[0],i[1]):(this.boundless?(this.area[2]=this.dOrigArea[2]+i[0],this.area[3]=this.dOrigArea[3]+i[1]):(this.area[2]=Math.min(1,this.dOrigArea[2]+i[0]),this.area[3]=Math.min(1,this.dOrigArea[3]+i[1])),this.limited&&this.limit()),this.$emit("change",this.area),this.place()},rEnd(t){t&&(t.stopPropagation(),t.preventDefault()),setTimeout((()=>this.manipulating=!1)),removeEventListener("mousemove",this.rMove),removeEventListener("mouseup",this.rEnd)}}},ce=le,me=(0,N.Z)(ce,ne,de,!1,null,null,null),ue=me.exports,he=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"focus",style:"transform: "+t.transform},[i("md-icon",[t._v("center_focus_strong")])],1)},pe=[],ge={props:{position:{type:Array,default(){return[.5,.5]}}},data(){return{px:[0,0],startCoo:[0,0],delta:[0,0],hasMoved:!1,startRect:[0,0],offset:[0,0]}},mounted(){this.micrio=this.$root.editor.$refs.micrio,this.micrio.addEventListener("draw",this.place),this.$el.addEventListener("mousedown",this.mStart),this.place()},beforeDestroy(){this.micrio.removeEventListener("draw",this.place),this.$el&&this.$el.removeEventListener("mousedown",this.mStart)},computed:{transform(){return`translate3d(${this.px[0]}px,${this.px[1]}px,0)`}},methods:{place(){this.px=this.micrio.camera.getXY(...this.position)},mStart(t){if(1!=t.which)return;t.stopPropagation(),window.addEventListener("mousemove",this.mMove),window.addEventListener("mouseup",this.mStop),this.startCoo=this.position.slice(0);let e=this.micrio.camera.getXY(...this.position);this.delta=[t.pageX-e[0],t.pageY-e[1]],this.startRect=[t.pageX,t.pageY],this.hasMoved=!1},mMove(t){this.offset=[t.pageX,t.pageY];let e=this.micrio.camera.getCoo(this.offset[0]-this.delta[0],this.offset[1]-this.delta[1]);!this.hasMoved&&Math.abs(this.offset[0]-this.startRect[0])<4&&Math.abs(this.offset[1]-this.startRect[1])<4||(this.hasMoved=!0,this.position[0]=e[0],this.position[1]=e[1],this.place())},mStop(){setTimeout((()=>this.hasMoved=!1),50),window.removeEventListener("mousemove",this.mMove),window.removeEventListener("mouseup",this.mStop)}}},ve=ge,fe=(0,N.Z)(ve,he,pe,!1,null,null,null),be=fe.exports,_e=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[t.opened?i("Rectangle",{attrs:{boundless:t.$root.editor.image.is360,area:t.data.view,offset:[0,0],dark:!0},on:{change:t.changed}}):t._e(),i("div",{class:["marker",t.customClasses,t.opened&&"opened",t.data.noMarker&&"invisible"],style:t.transform},[i("button",{ref:"marker",class:["marker",t.tourStep>=0&&"in-tour"],style:t.markerStyle,attrs:{title:t.data.title},on:{click:t.toggle}},[t.showTitle?i("label",{staticClass:"marker"},[t._v(t._s(t.data.title))]):t._e(),t.tourStep>=0?i("span",{staticClass:"tour-step"},[t._v(t._s(t.tourStep+1))]):t._e(),t.tourStep>0?i("button",{staticClass:"tour-control tour-prev",attrs:{title:"change order"},on:{click:t.moveStep}},[i("md-icon",[t._v("skip_previous")])],1):t._e(),t.tourStep>=0&&t.tourStep=0?t.steps.splice(this.tourStep,1):t.steps.push(this.data.id),this.$root.editor.tutorial.step("select-markers");else{if(this.hasMoved)return;this.$root.editor.$refs.markers.activeId=this.opened?null:this.data.id}},open(){this.$refs.marker.addEventListener("mousedown",this.mStart)},close(){this.$refs.marker.removeEventListener("mousedown",this.mStart),this.save()},save(){this.$root.editor.save()},setImageTitle(t){this.$root.main.prompt("Set the image title",t.title).then((e=>{t.title=e})).catch((()=>null))},mStart(t){if(1!=t.which)return;t.stopPropagation(),window.addEventListener("mousemove",this.mMove),window.addEventListener("mouseup",this.mStop),this.startCoo=[this.data.x,this.data.y];let e=this.micrio.camera.getXY(...this.startCoo);this.delta=[t.pageX-e[0],t.pageY-e[1]],this.startRect=[t.pageX,t.pageY],this.hasMoved=!1},mMove(t){this.offset=[t.pageX,t.pageY];let e=this.micrio.camera.getCoo(this.offset[0]-this.delta[0],this.offset[1]-this.delta[1]);!this.hasMoved&&Math.abs(this.offset[0]-this.startRect[0])<4&&Math.abs(this.offset[1]-this.startRect[1])<4||(this.hasMoved=!0,this.data.x=e[0],this.data.y=e[1])},mStop(){setTimeout((()=>this.hasMoved=!1),50),window.removeEventListener("mousemove",this.mMove),window.removeEventListener("mouseup",this.mStop)}}},we=ke,Se=(0,N.Z)(we,_e,ye,!1,null,null,null),$e=Se.exports,Ie=function(){var t=this,e=t.$createElement,i=t._self._c||e;return t.$root.editor.showMarkers?i("div",{attrs:{id:"marker-settings"}},[t.showColorSelect?i("ColorPicker",{attrs:{value:t.imageSettings.markerColor},on:{input:function(e){return t.imageSettings.markerColor=e},close:function(e){t.showColorSelect=!1}}}):t._e(),i("md-dialog-title",[t._v(t._s(t.marker?"Selected marker":"Settings for all markers"))]),t.marker?i("md-content",[i("md-tabs",[i("md-tab",{attrs:{"md-label":"Popup content"}},[i("md-content",[i("md-field",[i("label",[t._v("Marker title")]),i("md-input",{model:{value:t.marker.title,callback:function(e){t.$set(t.marker,"title",e)},expression:"marker.title"}})],1),t.settings.noPopup?t._e():i("md-field",[i("label",[t._v("Primary text")]),i("md-textarea",{staticClass:"description",on:{input:function(e){return t.setMarkerBody(t.marker)}},model:{value:t.marker.markdown,callback:function(e){t.$set(t.marker,"markdown",e)},expression:"marker.markdown"}}),i("span",{staticClass:"md-helper-text"},[i("a",{attrs:{href:"https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet",target:"_blank"}},[t._v("Markdown")]),t._v(" supported")])],1),t.settings.noPopup?t._e():i("md-field",[i("label",[t._v("Secondary text")]),i("md-textarea",{staticClass:"description",on:{input:function(e){return t.setMarkerBody(t.marker)}},model:{value:t.marker.markdownSecondary,callback:function(e){t.$set(t.marker,"markdownSecondary",e)},expression:"marker.markdownSecondary"}}),i("span",{staticClass:"md-helper-text"},[i("a",{attrs:{href:"https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet",target:"_blank"}},[t._v("Markdown")]),t._v(" supported")])],1)],1),t.settings.noPopup?t._e():[i("md-content",[i("h3",[t._v("Images in popup")]),i("md-field",{staticClass:"images images-popup"},[t._l(t.marker.images,(function(e,s){return i("div",{key:s,staticClass:"popup-image"},[i("md-button",{staticClass:"image-button",style:"background-image:url("+t.$root.editor.getThumb(e.src)+")"}),i("md-input",{attrs:{placeholder:"Image title"},model:{value:e.title,callback:function(i){t.$set(e,"title",i)},expression:"img.title"}}),i("md-button",{staticClass:"image-remove",attrs:{title:"Remove this image"},on:{click:function(e){return t.removeImage(s)}}},[i("md-icon",[t._v("delete")])],1)],1)})),i("md-button",{on:{click:t.addImage}},[i("md-icon",[t._v("add")])],1)],2),t.marker.images.length>0?i("md-list",{staticStyle:{"margin-top":"-30px"}},[i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("No full-window image")]),i("span",[t._v("When clicking an image, it won't show full size")])]),i("md-switch",{model:{value:t.settings.preventImageOpen,callback:function(e){t.$set(t.settings,"preventImageOpen",e)},expression:"settings.preventImageOpen"}})],1)],1):t._e()],1),i("md-content",[i("h3",[t._v("Audio")]),i("md-list",[i("md-list-item",[t.marker.audio?i("md-avatar",[i("md-button",{staticClass:"md-icon-button",on:{click:function(e){return t.playPause(t.marker.audio)}}},[t.audioPlaying?i("md-icon",[t._v("pause")]):i("md-icon",[t._v("play_arrow")])],1)],1):t._e(),i("div",{staticClass:"md-list-item-text"},[t.marker.audio?i("span",[t._v(t._s(t.marker.audio.title))]):i("span",[t._v("No audio selected")]),t.marker.audio&&t.marker.audio.duration?i("span",[t._v(t._s(t.marker.audio.duration)+"s")]):t._e()]),t.marker.audio?i("md-button",{staticClass:"md-icon-button md-list-action",on:{click:t.removeAudio}},[i("md-icon",[t._v("delete")])],1):i("md-button",{staticClass:"md-icon-button md-list-action",on:{click:t.addAudio}},[i("md-icon",[t._v("add")])],1)],1),t.marker.audio?i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Autoplay")]),i("span",[t._v("Autoplay audio when marker opened")])]),i("md-switch",{model:{value:t.marker.audioAutoPlay,callback:function(e){t.$set(t.marker,"audioAutoPlay",e)},expression:"marker.audioAutoPlay"}})],1):t._e()],1)],1),i("md-content",[i("h3",[t._v("Embed")]),i("md-list",{staticClass:"md-double-line"},[i("md-list-item",[i("md-field",[i("label",[t._v("Embed URL")]),i("md-input",{attrs:{placeholder:"Youtube, vimeo URL.."},model:{value:t.marker.embedUrl,callback:function(e){t.$set(t.marker,"embedUrl",e)},expression:"marker.embedUrl"}}),i("span",{staticClass:"md-helper-text"},[t._v("This should be the "),i("b",[t._v("embed-ready")]),t._v(" sharing URL")])],1)],1),t.marker.embedUrl?[i("md-list-item",[i("md-field",[i("label",[t._v("Embed description")]),i("md-textarea",{model:{value:t.marker.embedDescription,callback:function(e){t.$set(t.marker,"embedDescription",e)},expression:"marker.embedDescription"}})],1)],1),i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Open embed in popover")]),i("span",[t._v("When clicking the popup image")])]),i("md-switch",{attrs:{disabled:t.marker.embedInEmbed||t.marker.embedInNewWindow},model:{value:t.marker.embedInPopover,callback:function(e){t.$set(t.marker,"embedInPopover",e)},expression:"marker.embedInPopover"}})],1),i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Open embed in in-image imbed")]),t.marker.embedImages.length?i("span",[t._v("The frame will be placed inside the marker's first in-image embed")]):i("span",[t._v("This marker has no in-image embeds yet")])]),i("md-switch",{attrs:{disabled:!t.marker.embedImages.length||t.marker.embedInPopover||t.marker.embedInNewWindow},model:{value:t.marker.embedInEmbed,callback:function(e){t.$set(t.marker,"embedInEmbed",e)},expression:"marker.embedInEmbed"}})],1),t.marker.embedInEmbed?i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Immediately place embed")]),i("span",[t._v("So the user won't have to open the marker first")])]),i("md-switch",{model:{value:t.marker.embedInEmbedImmediate,callback:function(e){t.$set(t.marker,"embedInEmbedImmediate",e)},expression:"marker.embedInEmbedImmediate"}})],1):t._e(),i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Open embed in new window")]),i("span",[t._v("When clicking the popup image")])]),i("md-switch",{attrs:{disabled:t.marker.embedInEmbed||t.marker.embedInPopover},model:{value:t.marker.embedInNewWindow,callback:function(e){t.$set(t.marker,"embedInNewWindow",e)},expression:"marker.embedInNewWindow"}})],1),i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Mute audio when embed is opened")]),i("span",[t._v("Any music or positional audio will stop when this marker is opened")])]),i("md-switch",{model:{value:t.marker.embedMutesAudio,callback:function(e){t.$set(t.marker,"embedMutesAudio",e)},expression:"marker.embedMutesAudio"}})],1)]:t._e()],2)],1)],i("h3",[t._v("Popup display")]),i("md-list",{staticClass:"md-double-line"},[i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("No popup")]),i("span",[t._v("This marker has no popup")])]),i("md-switch",{model:{value:t.settings.noPopup,callback:function(e){t.$set(t.settings,"noPopup",e)},expression:"settings.noPopup"}})],1),t.settings.noPopup||t.$root.editor.imageVersion>=4.2?t._e():i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Static popup")]),i("span",[t._v("The marker popup will have a static position")])]),i("md-switch",{attrs:{disabled:t.imageSettings.staticPopups},model:{value:t.settings.staticPopup,callback:function(e){t.$set(t.settings,"staticPopup",e)},expression:"settings.staticPopup"}})],1),t.settings.noPopup?t._e():i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Always open")]),i("span",[t._v("This marker will be uncloseable")])]),i("md-switch",{model:{value:t.settings.alwaysOpen,callback:function(e){t.$set(t.settings,"alwaysOpen",e)},expression:"settings.alwaysOpen"}})],1)],1)],2),i("md-tab",{attrs:{"md-label":"Marker"}},[i("h3",[t._v("Marker display")]),i("md-list",{staticClass:"md-double-line"},[i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Invisible marker")]),i("span",[t._v("To use as a non-clickable tour step")])]),i("md-switch",{attrs:{disabled:t.settings.embedsAreMarker},model:{value:t.marker.noMarker,callback:function(e){t.$set(t.marker,"noMarker",e)},expression:"marker.noMarker"}})],1),t.marker.noMarker?t._e():[t.$root.editor.imageVersion>=4.2?i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Marker type")]),i("span",[t._v("Adds a standard icon")])]),i("select",{directives:[{name:"model",rawName:"v-model",value:t.marker.type,expression:"marker.type"}],on:{change:function(e){var i=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){var e="_value"in t?t._value:t.value;return e}));t.$set(t.marker,"type",e.target.multiple?i:i[0])}}},[i("option",{attrs:{value:""}},[t._v("(None)")]),i("option",{attrs:{value:"image"}},[t._v("Image")]),i("option",{attrs:{value:"audio"}},[t._v("Audio")]),i("option",{attrs:{value:"video"}},[t._v("Video")]),i("option",{attrs:{value:"media"}},[t._v("Media")]),i("option",{attrs:{value:"link"}},[t._v("Link")])])]):t._e(),t.marker.type?t._e():i("md-list-item",[t.settings.icon?i("md-avatar",{staticClass:"marker-icon"},[i("img",{attrs:{src:t.settings.icon}})]):t._e(),i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Icon")]),i("span",[t._v("Set a custom marker icon image")])]),i("md-button",{staticClass:"md-icon-button md-list-action",on:{click:function(e){return t.toggleIcon(e,t.settings)}}},[t.settings.icon?i("md-icon",[t._v("delete")]):i("md-icon",[t._v("add")])],1)],1),i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Scale marker")]),i("span",[t._v("The marker size is relative to the image")])]),i("md-switch",{attrs:{disabled:t.$root.editor.settings.markersScale},model:{value:t.settings.scales,callback:function(e){t.$set(t.settings,"scales",e)},expression:"settings.scales"}})],1),t.$root.editor.imageVersion>=4.2?t._e():i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Show title")]),t.imageSettings.showTitles?i("span",[t._v("This setting is overridden in the main marker settings")]):i("span",[t._v("Show the marker title under the marker icon")])]),i("md-switch",{attrs:{disabled:t.settings.embedsAreMarker||t.imageSettings.showTitles},model:{value:t.settings.showTitle,callback:function(e){t.$set(t.settings,"showTitle",e)},expression:"settings.showTitle"}})],1),t.marker.type?t._e():i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Default styling")]),i("span",[t._v("Show as circle")])]),i("md-switch",{model:{value:t.hasDefaultClass,callback:function(e){t.hasDefaultClass=e},expression:"hasDefaultClass"}})],1)]],2),i("md-content",[i("h3",[t._v("Marker actions")]),i("md-list",{staticClass:"md-double-line"},[i("md-list-item",[t.settings.micrioLink&&t.settings.micrioLink.id?i("md-avatar",[i("img",{attrs:{src:t.$root.editor.thumbSrc(t.settings.micrioLink.originalShortId||t.settings.micrioLink.id,t.settings.micrioLink.width,t.settings.micrioLink.height,t.settings.micrioLink.tileSize,t.settings.micrioLink.isPng,t.settings.micrioLink.isWebP,t.settings.micrioLink.mapType)}})]):t._e(),i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Marker is Micrio link")]),t.settings.micrioLink&&t.settings.micrioLink.id?i("span",[t._v(t._s(t.settings.micrioLink.id)+" - "+t._s(t.settings.micrioLink.title))]):i("span",[t._v("Link this marker to another image")])]),i("md-button",{staticClass:"md-icon-button md-list-action",attrs:{disabled:t.marker.micrioSplitLink},on:{click:function(e){return t.toggleMarkerLink(e,t.settings)}}},[t.settings.micrioLink?i("md-icon",[t._v("delete")]):i("md-icon",[t._v("add")])],1)],1),t.settings.micrioLink&&t.settings.micrioLink.id?i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Don't open the popup")]),i("span",[t._v("When following the link, don't open the marker popup")])]),i("md-switch",{model:{value:t.settings.noPopup,callback:function(e){t.$set(t.settings,"noPopup",e)},expression:"settings.noPopup"}})],1):t._e(),t.store.state.organisation&&t.store.state.organisation.hasSplitScreen?[i("md-list-item",[t.settings.micrioSplitLink?i("md-avatar",[i("img",{attrs:{src:t.$root.editor.thumbSrcIIIF(t.settings.micrioSplitLink.split(",")[0])}})]):t._e(),i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Splitscreen linked image/marker")]),t.settings.micrioSplitLink?i("span",[t._v(t._s(t.settings.micrioSplitLink))]):i("span",[t._v("Open a split-screen image / marker when opening this marker")])]),i("md-button",{staticClass:"md-icon-button md-list-action",attrs:{disabled:t.marker.noMarker||t.marker.micrioLink},on:{click:function(e){return t.toggleMarkerSplitLink(e,t.settings)}}},[t.settings.micrioSplitLink?i("md-icon",[t._v("delete")]):i("md-icon",[t._v("add")])],1)],1)]:t._e(),i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Force audio fade-out")]),i("span",[t._v("Opening this marker forces all audio to fade out")])]),i("md-switch",{model:{value:t.settings.mute,callback:function(e){t.$set(t.settings,"mute",e)},expression:"settings.mute"}})],1)],2)],1),i("md-content",[i("h3",[t._v("Camera animation")]),i("md-list",{staticClass:"md-double-line"},[i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Don't animate")]),i("span",[t._v("No camera animation when opening/closing")])]),i("md-switch",{model:{value:t.settings.noAnimate,callback:function(e){t.$set(t.settings,"noAnimate",e)},expression:"settings.noAnimate"}})],1),t.$root.editor.image.is360?t._e():i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Camera jump")]),i("span",[t._v("The camera will 'jump' to the marker view in a tour")])]),i("md-switch",{attrs:{disabled:t.settings.noAnimate},model:{value:t.settings.doJump,callback:function(e){t.$set(t.settings,"doJump",e)},expression:"settings.doJump"}})],1)],1)],1)],1),i("md-tab",{attrs:{"md-label":"Advanced"}},[i("md-content",[i("md-list",[i("div",{staticClass:"md-list-item-text"},[i("h3",{staticStyle:{"margin-top":"0"}},[t._v("Marker ID")]),i("span",[t._v(t._s(t.marker.id))])])])],1),i("md-content",[i("h3",[t._v("Custom CSS classes")]),i("md-list",[i("md-list-item",[i("md-field",[i("label",[t._v("Custom class names")]),i("md-input",{model:{value:t.customClasses,callback:function(e){t.customClasses=e},expression:"customClasses"}}),i("span",{staticClass:"md-helper-text"},[t._v("Space separated")])],1)],1)],1)],1),i("md-content",[i("h3",[t._v("Images within main image")]),i("md-field",{staticClass:"images"},[t._l(t.marker.embedImages,(function(e,s){return i("md-button",{key:s,staticClass:"image-button",style:"background-image:url("+t.$root.editor.getThumb(e.fileUrl)+")",attrs:{title:"Remove this image"},on:{click:function(e){return t.removeEmbedImage(s)}}},[i("md-icon",[t._v("delete")])],1)})),i("md-button",{staticStyle:{width:"auto"},on:{click:t.addEmbedImage}},[i("md-icon",[t._v("add")]),t._v("Add an image")],1)],2),t.marker.embedImages.length>0?i("md-list",[i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[1==t.marker.embedImages.length?i("span",[t._v("Embedded image "),i("i",[t._v("is")]),t._v(" the marker")]):i("span",[t._v("Embedded images "),i("i",[t._v("are")]),t._v(" the marker")]),i("span",[t._v("The embeds will always be visible and clickable")])]),i("md-switch",{model:{value:t.settings.embedsAreMarker,callback:function(e){t.$set(t.settings,"embedsAreMarker",e)},expression:"settings.embedsAreMarker"}})],1),i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Keep embedded images open")]),i("span",[t._v("Closing this marker doesn't hide the embedded images")])]),i("md-switch",{attrs:{disabled:t.settings.embedsAreMarker},model:{value:t.settings.keepEmbedsOpen,callback:function(e){t.$set(t.settings,"keepEmbedsOpen",e)},expression:"settings.keepEmbedsOpen"}})],1)],1):t._e()],1),i("md-content",[i("h3",[t._v("Video tour")]),i("div",{staticClass:"md-helper-text"},[t._v("Create a video tour that autoplays when this marker is opened")]),t.marker.videoTour?i("md-list",[i("VideoTourEditor",{ref:"videoTours",attrs:{compact:!0,tour:t.marker.videoTour,removeable:!0},on:{remove:t.removeVideoTour}})],1):[i("md-button",{on:{click:t.addVideoTour}},[i("md-icon",[t._v("add")]),t._v(" Create video tour")],1)]],2),i("md-content",[i("h3",[t._v("Custom JSON")]),i("div",{staticClass:"md-helper-text"},[t._v("For custom implementations, set your own marker JSON values here")]),i("JSONEditor",{attrs:{onChange:t.metaChanged,json:t.custom}}),i("div")],1)],1)],1)],1):i("md-content",{staticStyle:{padding:"0 10px"}},[i("h3",[t._v("Marker settings")]),i("md-list",{staticClass:"md-double-line"},[i("md-list-item",[t.imageSettings.markerIcon?i("md-avatar",[i("img",{attrs:{src:t.imageSettings.markerIcon}})]):t._e(),i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Marker icon")]),i("span",[t._v("Set the default marker icon image")])]),i("md-button",{staticClass:"md-icon-button md-list-action",on:{click:t.toggleMainIcon}},[t.imageSettings.markerIcon?i("md-icon",[t._v("delete")]):i("md-icon",[t._v("add")])],1)],1),i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Marker color")]),i("span",[t._v("The default selected marker color")])]),i("md-button",{staticClass:"md-avatar md-colorpicker",style:"background-color: "+t.imageSettings.markerColor+";",on:{click:function(e){t.showColorSelect=!t.showColorSelect}}})],1),i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Marker size")]),i("span",[t._v("Default marker size in pixels")])]),i("div",{staticClass:"md-icon-button md-number"},[i("md-field",[i("md-input",{attrs:{min:"1",step:"1",type:"number"},model:{value:t.imageSettings.markerSize,callback:function(e){t.$set(t.imageSettings,"markerSize",e)},expression:"imageSettings.markerSize"}})],1)],1)]),i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Always show titles")]),i("span",[t._v("Marker titles will always be visible")])]),i("md-switch",{model:{value:t.imageSettings.showTitles,callback:function(e){t.$set(t.imageSettings,"showTitles",e)},expression:"imageSettings.showTitles"}})],1),t.$root.editor.image.is360?t._e():i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Cluster markers")]),i("span",[t._v("Clicking overlapping markers zooms in first")])]),i("md-switch",{model:{value:t.$root.editor.settings.clusterMarkers,callback:function(e){t.$set(t.$root.editor.settings,"clusterMarkers",e)},expression:"$root.editor.settings.clusterMarkers"}})],1),i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Scale all markers")]),i("span",[t._v("All markers are scaled to the image size")])]),i("md-switch",{model:{value:t.$root.editor.settings.markersScale,callback:function(e){t.$set(t.$root.editor.settings,"markersScale",e)},expression:"$root.editor.settings.markersScale"}})],1),t.$root.editor.settings.markersScale?i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Don't scale marker titles")]),i("span",[t._v("Keep marker title labels the same size")])]),i("md-switch",{model:{value:t.imageSettings.titlesNoScale,callback:function(e){t.$set(t.imageSettings,"titlesNoScale",e)},expression:"imageSettings.titlesNoScale"}})],1):t._e(),i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Fly back when closing markers")]),i("span",[t._v("Go back to previous view when a marker is closed")])]),i("md-switch",{model:{value:t.imageSettings.zoomOutAfterClose,callback:function(e){t.$set(t.imageSettings,"zoomOutAfterClose",e)},expression:"imageSettings.zoomOutAfterClose"}})],1)],1),i("h3",[t._v("Popup settings")]),i("md-list",{staticClass:"md-double-line"},[i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Static popup")]),i("span",[t._v("All marker popups will have a static position")])]),i("md-switch",{model:{value:t.imageSettings.staticPopups,callback:function(e){t.$set(t.imageSettings,"staticPopups",e)},expression:"imageSettings.staticPopups"}})],1),t.imageSettings.staticPopups?t._e():i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Static mobile popup")]),i("span",[t._v("Only mobile marker popups will be static")])]),i("md-switch",{model:{value:t.imageSettings.staticMobilePopups,callback:function(e){t.$set(t.imageSettings,"staticMobilePopups",e)},expression:"imageSettings.staticMobilePopups"}})],1)],1),t.$root.editor.imageVersion>=4.2?[i("h3",[t._v("Media settings")]),i("md-list",{staticClass:"md-double-line"},[i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Don't autoplay media")]),i("span",[t._v("Video and audio will not autoplay")])]),i("md-switch",{model:{value:t.imageSettings.preventAutoPlay,callback:function(e){t.$set(t.imageSettings,"preventAutoPlay",e)},expression:"imageSettings.preventAutoPlay"}})],1)],1)]:t._e()],2),i("md-toolbar",[t.marker?[i("md-button",{staticClass:"md-accent",attrs:{title:"delete marker"},on:{click:function(e){t.showRemove=!0}}},[i("md-icon",[t._v("delete")]),t._v(" Remove")],1),i("md-button",{staticClass:"md-primary",on:{click:t.save}},[i("md-icon",[t._v("check")]),t._v(" Save")],1)]:[i("md-button",{staticClass:"md-primary md-accent md-raised",attrs:{title:"Add new marker"},on:{click:t.newMarker}},[i("md-icon",[t._v("add")]),t._v(" Create new marker")],1)]],2),i("md-dialog-confirm",{attrs:{"md-active":t.showRemove,"md-title":"Remove marker","md-content":"Remove this marker?","md-confirm-text":"Yes","md-cancel-text":"No"},on:{"update:mdActive":function(e){t.showRemove=e},"update:md-active":function(e){t.showRemove=e},"md-cancel":function(e){t.showRemove=!1},"md-confirm":t.removeConfirm}})],1):t._e()},Ce=[],Pe=i(4299),xe=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("ColorPicker",{model:{value:t.pickerColor,callback:function(e){t.pickerColor=e},expression:"pickerColor"}})},je=[],Te=i(4023),Me={components:{ColorPicker:Te.Chrome},props:{value:String},data(){return{color:String}},created(){this.color=this.value,setTimeout((()=>addEventListener("click",this.close)),100)},beforeDestroy(){removeEventListener("click",this.close)},computed:{pickerColor:{get(){return this.color},set(t){this.color=t.hex8,this.$emit("input",this.color)}}},methods:{close(t){let e=t.target;do{if(e==this.$el)return;e=e.parentNode}while(e);this.$emit("close")}}},De=Me,Ae=(0,N.Z)(De,xe,je,!1,null,null,null),Oe=Ae.exports,Ee=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("md-list-item",{attrs:{"md-expand":"","md-expanded":t.opened},on:{"update:mdExpanded":function(e){t.opened=e},"update:md-expanded":function(e){t.opened=e}}},[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v(t._s(t.tour.title))]),i("span",[t._v(t._s(t.tour.description))])]),i("md-content",{attrs:{slot:"md-expand"},slot:"md-expand"},[i("md-list",[t.compact?t._e():i("md-list-item",[i("md-field",[i("label",[t._v("Title")]),i("md-input",{model:{value:t.tour.title,callback:function(e){t.$set(t.tour,"title",e)},expression:"tour.title"}})],1)],1),t.compact?t._e():i("md-list-item",[i("md-field",[i("label",[t._v("Description")]),i("md-textarea",{staticClass:"description",model:{value:t.tour.description,callback:function(e){t.$set(t.tour,"description",e)},expression:"tour.description"}})],1)],1),i("md-list-item",[i("md-field",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Tour duration")]),i("span",[t._v("In seconds")])]),i("div",{staticClass:"md-icon-button md-list-action"},[i("md-input",{attrs:{min:"1",step:"1",type:"number"},model:{value:t.tour.duration,callback:function(e){t.$set(t.tour,"duration",e)},expression:"tour.duration"}})],1)])],1),t.compact?t._e():i("h3",[t._v("Audio track")]),t.compact?t._e():i("md-list-item",[t.tour.audio?i("md-avatar",[i("md-button",{staticClass:"md-icon-button"},[i("md-icon",[t._v("audiotrack")])],1)],1):t._e(),i("div",{staticClass:"md-list-item-text"},[t.tour.audio?i("span",[t._v(t._s(t.tour.audio.title))]):i("span",[t._v("No audio selected")]),t.tour.audio&&t.tour.audio.duration?i("span",[t._v(t._s(t.tour.audio.duration)+"s")]):t._e()]),t.tour.audio?i("md-button",{staticClass:"md-icon-button md-list-action",on:{click:t.removeAudio}},[i("md-icon",[t._v("delete")])],1):i("md-button",{staticClass:"md-icon-button md-accent md-raised md-list-action",on:{click:t.addAudio}},[i("md-icon",[t._v("add")])],1)],1),i("h3",[t._v("Subtitles (SRT)")]),i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[t.tour.subtitle?i("span",[t._v(t._s(t.tour.subtitle.title))]):i("span",[t._v("No subtitle selected")]),t.tour.subtitle&&t.tour.subtitle.fileSize?i("span",[t._v(t._s(t.tour.subtitle.fileSize)+"b")]):t._e()]),t.tour.subtitle?i("md-button",{staticClass:"md-icon-button md-list-action",on:{click:t.removeSubtitle}},[i("md-icon",[t._v("delete")])],1):i("md-button",{staticClass:"md-icon-button md-accent md-raised md-list-action",on:{click:t.addSubtitle}},[i("md-icon",[t._v("add")])],1)],1),t.compact?t._e():i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Autostart")]),i("span",[t._v("Autostart this tour on image load")])]),i("md-switch",{model:{value:t.tour.autostart,callback:function(e){t.$set(t.tour,"autostart",e)},expression:"tour.autostart"}})],1),t.compact?t._e():i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Keep markers")]),i("span",[t._v("Don't hide markers when playing")])]),i("md-switch",{model:{value:t.tour.keepMarkers,callback:function(e){t.$set(t.tour,"keepMarkers",e)},expression:"tour.keepMarkers"}})],1),i("md-list",{staticClass:"tour-events md-dense"},[i("h3",[t._v("Custom tour events")]),i("div",{staticClass:"md-helper-text"},[t._v("For custom implementations, create your own timed events here")]),t._l(t.tour.events,(function(e,s){return i("md-list-item",{key:e.id,staticClass:"tour-event",class:t.activeEvents[e.id]&&"event-active"},[i("div",[t._v(" Active: "),i("input",{directives:[{name:"model",rawName:"v-model",value:e.start,expression:"event.start"}],attrs:{type:"number",min:"0",max:e.end},domProps:{value:e.start},on:{input:function(i){i.target.composing||t.$set(e,"start",i.target.value)}}}),t._v(" to "),i("input",{directives:[{name:"model",rawName:"v-model",value:e.end,expression:"event.end"}],attrs:{type:"number",min:e.start,max:t.tour.duration},domProps:{value:e.end},on:{input:function(i){i.target.composing||t.$set(e,"end",i.target.value)}}}),t._v(" seconds "),i("br"),i("input",{directives:[{name:"model",rawName:"v-model",value:e.action,expression:"event.action"}],attrs:{placeholder:"Action"},domProps:{value:e.action},on:{input:function(i){i.target.composing||t.$set(e,"action",i.target.value)}}}),i("br"),i("input",{directives:[{name:"model",rawName:"v-model",value:e.data,expression:"event.data"}],attrs:{placeholder:"Value"},domProps:{value:e.data},on:{input:function(i){i.target.composing||t.$set(e,"data",i.target.value)}}})]),s0?i("md-button",{staticClass:"md-icon-button md-list-action",attrs:{title:"Move up"},on:{click:function(e){return t.moveItem(e,s,-1,t.tour.events)}}},[i("md-icon",[t._v("arrow_upward")])],1):t._e(),i("md-button",{staticClass:"md-icon-button md-list-action",on:{click:function(e){return t.removeEvent(s)}}},[i("md-icon",[t._v("delete")])],1)],1)})),i("md-list-item",{on:{click:t.addEvent}},[i("md-icon",{staticClass:"md-primary"},[t._v("add")]),i("div",{staticClass:"md-list-item-text"},[i("span",[i("i",[t._v("Add a new event")])])])],1)],2),i("h3",[t._v("Tour ID")]),t.tour.scrollable?t._e():i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v(t._s(t.tour.id))])])]),t.removeable?i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[t._v("Remove this tour")]),i("md-button",{staticClass:"md-icon-button md-list-action",on:{click:function(e){return t.$emit("remove")}}},[i("md-icon",[t._v("delete")])],1)],1):t._e()],1)],1)],1)},Le=[],Re={props:{tour:{type:Object,default(){return{}}},compact:Boolean,removeable:Boolean},data(){return{store:M,audioPlaying:!1,audio:new Audio,activeEvents:{}}},computed:{opened:{get(){return this.$root.editor.currentVideoTour==this.tour},set(t){this.$root.editor.currentVideoTour=t?this.tour:null,t&&(this.$root.editor.currentVideoTourEditor=this)}}},mounted(){this.audio.addEventListener("play",(()=>this.audioPlaying=!0)),this.audio.addEventListener("pause",(()=>this.audioPlaying=!1)),this.audio.addEventListener("ended",(()=>this.audioPlaying=!1)),this.$root.editor.$refs.micrio.addEventListener("tour-event",this.tourEvent)},beforeDestroy(){this.$root.editor&&(this.$root.editor.currentVideoTour=null,this.$root.editor.currentVideoTourEditor=null,this.$root.editor.$refs.micrio.removeEventListener("tour-event",this.tourEvent)),this.audio&&(this.audio=null)},methods:{async addAudio(){let t=await this.$root.editor.getAudio();t&&(this.tour.duration=t.duration,this.tour.audio={fileUrl:t.fileUrl,title:t.title,duration:Math.round(10*t.duration)/10,mimeType:t.mimeType})},removeAudio(){this.$root.main.confirm("Do you want to remove the audio for this tour?").then((()=>{this.audio.pause(),this.tour.audio=null})).catch((()=>null))},async addSubtitle(){let t=await this.$root.editor.getSubtitles();t&&(this.tour.subtitle={fileUrl:t.fileUrl,title:t.title,fileSize:t.fileSize,mimeType:t.mimeType})},removeSubtitle(){this.$root.main.confirm("Do you want to remove the subtitle for this tour?").then((()=>{this.tour.subtitle=null})).catch((()=>null))},addEvent(){this.tour.events.push({id:this.$root.createGuid(),start:0,end:5,action:null,data:null})},removeEvent(t){this.tour.events.splice(t,1)},tourEvent(t){s["default"].set(this.activeEvents,t.detail.id,"start"==t.detail.type)},moveItem(t,e,i,s){t.stopPropagation(),t.preventDefault();const a=s.splice(e,1);s.splice(e+i,0,a[0])}}},Ne=Re,Ve=(0,N.Z)(Ne,Ee,Le,!1,null,null,null),Ue=Ve.exports,ze={components:{JSONEditor:Pe.Z,ColorPicker:Oe,VideoTourEditor:Ue},data(){return{loading:!1,store:M,isDev:!!window._isDashDev,settings:{_meta:{},micrioLink:{},icon:null},audioPlaying:!1,audio:new Audio,showRemove:!1,activeTab:"tab-markers-selected",showColorSelect:!1,addingMarker:!1,activeId:null,currentTour:null,classes:[],custom:{},assetPicker:null}},watch:{settings:{handler(t){this.marker&&(this.marker.data=t)},deep:!0},classes(){this.marker&&(this.marker.class=this.classes.join(" "))},activeTab(){this.showColorSelect=!1,this.currentTOur=null,this.$root.editor.showMarkers&&("tab-markers-selected"==this.activeTab&&this.$root.editor.tutorial.show("markers"),"tab-markers-main"==this.activeTab&&this.$root.editor.tutorial.show())},activeId(){this.read()},marker(){this.$root.editor.currentMarkerEditor=this.marker?this:null,this.marker&&(this.activeTab="tab-markers-selected",this.$root.editor.tutorial.step("select-marker"))},"marker.title"(t){t&&this.$root.editor.tutorial.step("set-title")},"marker.markdown"(t){"New marker text"==t&&this.$root.editor.tutorial.step("set-description")},"$root.editor.activeSection"(){this.activeId=null,this.activeTab="tab-markers-selected"},"imageSettings.staticPopups"(t){t&&(this.imageSettings.staticMobilePopups=!0),this.settings.staticPopup=t,this.$root.editor.data.markers.forEach((e=>{e.data.staticPopup=t}))},"imageSettings.showTitles"(t){this.settings.showTitle=t,this.$root.editor.data.markers.forEach((e=>{e.data.showTitle=t}))},"imageSettings.markerIcon"(){this.setDefaultStyles()},"imageSettings.markerColor"(){this.setDefaultStyles()},"imageSettings.markerSize"(){this.setDefaultStyles()},"settings.embedsAreMarker"(t){this.marker.noMarker=t}},mounted(){this.audio.addEventListener("play",(()=>this.audioPlaying=!0)),this.audio.addEventListener("pause",(()=>this.audioPlaying=!1)),this.audio.addEventListener("ended",(()=>this.audioPlaying=!1)),this.setDefaultStyles()},beforeDestroy(){this.$root.editor&&(this.$root.editor.currentMarkerEditor=null)},computed:{imageSettings(){return this.$root.editor.settings._markers},marker(){return this.$root.editor.data.markers.find((t=>t.id==this.activeId))},hasDefaultClass:{get(){return!this.marker.noMarker&&this.classes.indexOf("default")>=0},set(t){const e=this.classes.indexOf("default");e>=0&&this.classes.splice(e,1),t&&this.classes.push("default")}},customClasses:{get(){return this.classes.filter((t=>"default"!=t)).join(" ")},set(t){let e=[];this.hasDefaultClass&&e.push("default"),t.trim().split(" ").forEach((t=>e.push(t))),this.classes=e}}},methods:{setDefaultStyles(){const t=this.$root.editor.$refs.micrioContainer.style,e=this.imageSettings,i=this.$root.imageVersion>=4.2,s={bg:"--micrio-marker-background",col:"--micrio-marker-color"+(i?"":"-hover"),size:"--micrio-marker-size"};e.markerIcon?t.setProperty(s.bg,`url('${e.markerIcon}')`):t.removeProperty(s.bg),e.markerColor?t.setProperty(s.col,e.markerColor):t.removeProperty(s.col),e.markerSize?t.setProperty(s.size,Number(e.markerSize)+(i?0:7)+"px"):t.removeProperty(s.size)},read(){this.marker&&(this.settings=JSON.parse(JSON.stringify(this.marker.data||{})),this.settings._meta||(this.settings._meta={}),this.custom=this.settings._meta,this.marker.class&&(this.classes=this.marker.class.trim().split(" ")))},metaChanged(t){this.settings._meta=t},removeConfirm(){const t=this.$root.editor.data.markers.findIndex((t=>t.id==this.activeId));if(t>=0){let i=this.activeId;this.$root.activeId=null,this.$root.editor.data.markers.splice(t,1),b.action(111,this.$root.editor.imageId,null,this.activeId);let s=this.$root.editor.data.markerTours;for(let t=0;tt==i));e>=0&&s[t].steps.splice(e,1)}this.$root.editor.save()}},save(){this.$root.editor.save(),this.activeId=null},newMarker(){this.addingMarker=!0,this.activeId=null,this.$root.main.setMessage("Place your new marker"),this.$root.editor.$el.classList.add("adding-marker"),this.$root.editor.tutorial.step("add-marker"),setTimeout((()=>{this.$root.editor.$el.addEventListener("click",this.placedMarker)}),500)},placedMarker(t){const e=this.$root.editor.$refs.micrio,i=e.camera.getCoo(t.clientX,t.clientY,!0);this.addingMarker=!1,this.$root.editor.$el.removeEventListener("click",this.placedMarker),this.$root.editor.$el.classList.remove("adding-marker");const a=e.camera.getView(),r=a[2]-a[0],o=a[3]-a[1],n=.1*Math.min(r,o),d=this.$root.createGuid(),l=[i[0]-n,i[1]-n,i[0]+n,i[1]+n],c=this.getArea(l);b.action(110,this.$root.editor.imageId,null,d),this.$root.editor.data.markers.push({id:d,x:i[0],y:i[1],title:"",body:"",bodySecondary:"",view:l,area:c,data:{showTitle:this.imageSettings.showTitles,staticPopup:this.imageSettings.staticPopups,noAnimate:!1,micrioLink:null,icon:null},class:"default",images:[],embedImages:[],html:"",audio:null,videoTour:null,embedInPopover:!1,embedMutesAudio:!0,audioAutoPlay:!0}),s["default"].nextTick((()=>this.activeId=d)),this.$root.main.setMessage("Placed marker!"),this.$root.editor.tutorial.step("place-marker"),this.$root.editor.save()},getArea(t){const e=this.$root.editor.$refs.micrio.$current.$info;return[Math.round(e.width*t[0]),Math.round(e.height*t[1]),Math.round(e.width*(t[2]-t[0])),Math.round(e.height*(t[3]-t[1]))]},setMarkerBody(t){t.body=t.markdown?(0,ht.TU)(t.markdown):"",t.bodySecondary=t.markdownSecondary?(0,ht.TU)(t.markdownSecondary):""},async toggleMarkerLink(t,e){if(t.stopPropagation(),t.preventDefault(),e.micrioLink)e.micrioLink=null;else{let t=await this.$root.editor.getMicrio(void 0,!0);t&&(e.micrioLink={id:t.shortId,originalShortId:t.originalShortId,width:t.width,height:t.height,tileSize:t.tileSize,title:t.title,isPng:t.isPng,isWebP:t.isWebP,is360:t.is360,mapType:t.mapType,view:t.startView&&t.startView.split(",").map((function(t){return Number(t)}))||null})}},async toggleMarkerSplitLink(t,e){if(t.stopPropagation(),t.preventDefault(),e.micrioSplitLink)e.micrioSplitLink=null;else{let t=!1;await this.$root.main.confirm("Split image selection","Do you want to link to another image's marker, or an entire image?","Entire image","Marker inside other image").then((()=>t=!0)).catch((()=>t=!1));const i=await this.$root.editor.getExternalMarker(t);i&&(e.micrioSplitLink=i.split(",").reverse().join(","))}},async addImage(){let t=await this.$root.editor.getImage();t&&this.marker.images.push({id:t.id,width:t.width,height:t.height,src:t.fileUrl,title:t.title,description:null,micrioId:t.shortId}),b.action(112,this.$root.editor.imageId,t.shortId,this.activeId)},removeImage(t){const e=this.marker.images[t];b.action(113,this.$root.editor.imageId,e.shortId,this.activeId),this.marker.images.splice(t,1)},async addEmbedImage(){let t=await this.$root.editor.getImage();if(!t)return;const e=this.$root.editor.$refs.micrio,i=e.camera.getCoo((innerWidth-360)/2,innerHeight/2),s=e.camera.getView(),a=s[2]-s[0],r=s[3]-s[1],o=.1*Math.min(a,r);this.marker.embedImages.push({id:t.id,width:t.width,height:t.height,micrioId:t.shortId,area:[i[0]-o,i[1]-o,i[0]+o,i[1]+o],fileUrl:t.fileUrl,className:"",z:0}),b.action(114,this.$root.editor.imageId,t.shortId,this.activeId)},removeEmbedImage(t){const e=this.marker.embedImages[t];b.action(115,this.$root.editor.imageId,e.shortId,this.activeId),this.marker.embedImages.splice(t,1)},playPause(){this.marker.audio&&this.audio&&(this.audio.paused?this.playAudio():this.pauseAudio())},playAudio(){this.audio&&(this.audio.src!=this.marker.audio.fileUrl&&(this.audio.src=this.marker.audio.fileUrl,this.audioPlaying=!0),this.audio.play())},pauseAudio(){this.audio&&this.audio.pause()},async addAudio(){let t=await this.$root.editor.getAudio();t&&(this.marker.audio={fileUrl:t.fileUrl,title:t.title,duration:Math.round(10*t.duration)/10,mimeType:t.mimeType},this.marker.videoTour&&(this.marker.videoTour.duration=t.duration),b.action(118,this.$root.editor.imageId,t.id,this.activeId))},removeAudio(){this.$root.main.confirm("Do you want to remove the audio for this marker?").then((()=>{b.action(119,this.$root.editor.imageId,null,this.activeId),this.audio.pause(),this.marker.audio=null})).catch((()=>null))},addVideoTour(){const t=this.$root.createGuid();this.marker.videoTour={id:t,duration:this.marker.audio&&this.marker.audio.duration||30,audio:null,title:"Video tour",description:"",timeline:[],events:[]},b.action(116,this.$root.editor.imageId,null,this.activeId),this.$nextTick((()=>{this.$refs.videoTours.opened=!0,setTimeout((()=>{window.dispatchEvent(new Event("resize"))}),500)}))},removeVideoTour(){b.action(117,this.$root.editor.imageId,null,this.activeId),this.marker.videoTour=null},async toggleIcon(t,e){if(t.stopPropagation(),t.preventDefault(),e.icon)e.icon=null;else{let t=await this.$root.editor.getImage();t&&(e.icon=t.fileUrl,e.iconMicrioId=t.shortId)}},async toggleMainIcon(){if(this.imageSettings.markerIcon)this.imageSettings.markerIcon=null;else{let t=await this.$root.editor.getImage();t&&(this.imageSettings.markerIcon=this.$root.editor.getThumb(t.fileUrl))}}}},Fe=ze,Je=(0,N.Z)(Fe,Ie,Ce,!1,null,null,null),Be=Je.exports,Ze=function(){var t=this,e=t.$createElement,i=t._self._c||e;return t.$root.editor.showTours?i("div",[i("md-dialog-title",[t._v("Tours")]),i("md-tabs",{attrs:{"md-active-tab":t.activeTab}},[i("md-tab",{staticClass:"no-padding",attrs:{id:"tab-markertours-selected","md-label":"Marker tours"},on:{click:function(e){t.activeTab="tab-markertours-selected"}}},[t.$root.editor.data.markerTours.length?i("md-list",{staticClass:"md-double-line",attrs:{"md-expand-single":"expandSingle"}},t._l(t.$root.editor.data.markerTours,(function(e){return i("MarkerTourEditor",{key:e.id,attrs:{tour:e,opened:t.currentMarkerTour==e}})})),1):i("md-empty-state",{attrs:{"md-icon":"pageview","md-label":"Create your first marker tour below"}})],1),i("md-tab",{staticClass:"no-padding",attrs:{id:"tab-videotours-selected","md-label":"Video tours"},on:{click:function(e){t.activeTab="tab-videotours-selected"}}},[t.$root.editor.data.tours.length?i("md-list",{staticClass:"md-double-line",attrs:{"md-expand-single":"expandSingle"}},t._l(t.$root.editor.data.tours,(function(e){return i("VideoTourEditor",{key:e.id,attrs:{tour:e,opened:t.currentVideoTour==e}})})),1):i("md-empty-state",{attrs:{"md-icon":"switch_video","md-label":"Create your first video tour below"}})],1)],1),i("md-toolbar",["tab-markertours-selected"==t.activeTab?[t.currentMarkerTour?[i("md-button",{staticClass:"md-accent",attrs:{title:"Delete marker tour"},on:{click:t.removeMarkerTour}},[i("md-icon",[t._v("delete")]),t._v(" Remove")],1),i("md-button",{staticClass:"md-primary md-accent md-raised",attrs:{title:"Save marker tour"},on:{click:t.saveMarkerTour}},[i("md-icon",[t._v("check")]),t._v(" Save")],1)]:i("md-button",{staticClass:"md-primary md-accent md-raised",attrs:{title:"Add new marker tour"},on:{click:t.addMarkerTour}},[i("md-icon",[t._v("add")]),t._v(" New marker tour")],1)]:[t.currentVideoTour?[i("md-button",{staticClass:"md-accent",attrs:{title:"Delete video tour"},on:{click:t.removeVideoTour}},[i("md-icon",[t._v("delete")]),t._v(" Remove")],1),i("md-button",{staticClass:"md-primary md-accent md-raised",attrs:{title:"Save video tour"},on:{click:t.saveVideoTour}},[i("md-icon",[t._v("check")]),t._v(" Save")],1)]:i("md-button",{staticClass:"md-primary md-accent md-raised",attrs:{title:"Add new video tour"},on:{click:t.addVideoTour}},[i("md-icon",[t._v("add")]),t._v(" New video tour")],1)]],2)],1):t._e()},Ye=[],We=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("md-list-item",{attrs:{"md-expand":"","md-expanded":t.opened},on:{"update:mdExpanded":function(e){t.opened=e},"update:md-expanded":function(e){t.opened=e}}},[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v(t._s(t.tour.title))]),i("span",[t._v(t._s(t.tour.description))])]),i("md-list",{attrs:{slot:"md-expand"},slot:"md-expand"},[i("h3",[t._v("Tour content")]),i("md-list-item",[i("md-field",[i("label",[t._v("Title")]),i("md-input",{model:{value:t.tour.title,callback:function(e){t.$set(t.tour,"title",e)},expression:"tour.title"}})],1)],1),i("md-list-item",[i("md-field",[i("label",[t._v("Subtitle")]),i("md-textarea",{staticClass:"description",model:{value:t.tour.description,callback:function(e){t.$set(t.tour,"description",e)},expression:"tour.description"}})],1)],1),i("md-list-item",[i("md-field",[i("label",[t._v("Description")]),i("md-textarea",{staticClass:"description",model:{value:t.tour.body,callback:function(e){t.$set(t.tour,"body",e)},expression:"tour.body"}})],1)],1),i("md-list-item",[t.tour.image?i("md-avatar",[i("img",{attrs:{src:t.$root.editor.getThumb(t.tour.image)}})]):t._e(),i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Tour image")]),i("span",[t._v("Set a cover image for this tour, used for social sharing")])]),i("md-button",{staticClass:"md-icon-button md-list-action ",on:{click:function(e){return t.toggleTourImage(e,t.tour)}}},[t.tour.image?i("md-icon",[t._v("delete")]):i("md-icon",[t._v("add")])],1)],1),[i("h3",[t._v("Tour steps")]),i("div",{staticClass:"md-helper-text"},[t._v("To add tour steps, simply click on the markers on the left in the correct order.")]),i("div",{staticClass:"md-helper-text"},[t._v("Additionally, you can add steps from other images using the button below.")]),i("md-list",t._l(t.steps,(function(e,s){return i("md-list-item",{key:e.id},[i("div",{staticClass:"md-list-item-text"},[i("span",[i("b",[t._v(t._s(s+1)+".")]),t._v(" "+t._s(e.title))]),e.imageId?i("span",[t._v("Image: "),i("a",{attrs:{href:e.editorLink,target:"_blank"}},[t._v(t._s(e.image))])]):t._e()]),s0?i("md-button",{staticClass:"md-icon-button md-list-action",attrs:{title:"Move up"},on:{click:function(e){return t.moveItem(e,s,-1)}}},[i("md-icon",[t._v("arrow_upward")])],1):t._e(),i("md-button",{staticClass:"md-icon-button md-list-action",on:{click:function(e){return t.removeStep(e,s)}}},[i("md-icon",[t._v("delete")])],1)],1)})),1),i("md-button",{staticClass:"md-primary",attrs:{title:"add an external tour step"},on:{click:t.addExternalStep}},[i("md-icon",[t._v("add")]),t._v(" Add an external tour step")],1)],i("h3",[t._v("Tour settings")]),t.tour.scrollable?t._e():i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Only show active marker")]),i("span",[t._v("Hide markers when tour is running")])]),i("md-switch",{model:{value:t.tour.hideMarkers,callback:function(e){t.$set(t.tour,"hideMarkers",e)},expression:"tour.hideMarkers"}})],1),i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Scrolling tour")]),i("span",[t._v("This tour is a scrollable page")])]),i("md-switch",{model:{value:t.tour.scrollable,callback:function(e){t.$set(t.tour,"scrollable",e)},expression:"tour.scrollable"}})],1),i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Keep viewport when exiting tour")]),i("span",[t._v("Don't animate the camera back to the starting view")])]),i("md-switch",{model:{value:t.tour.rememberStep,callback:function(e){t.$set(t.tour,"rememberStep",e)},expression:"tour.rememberStep"}})],1),i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Autostart")]),i("span",[t._v("Autostart this tour on image load")])]),i("md-switch",{model:{value:t.tour.autostart,callback:function(e){t.$set(t.tour,"autostart",e)},expression:"tour.autostart"}})],1),i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Can't exit this tour")]),i("span",[t._v("This tour is uncloseable")])]),i("md-switch",{model:{value:t.tour.cannotClose,callback:function(e){t.$set(t.tour,"cannotClose",e)},expression:"tour.cannotClose"}})],1),i("h3",[t._v("Tour ID")]),t.tour.scrollable?t._e():i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v(t._s(t.tour.id))])])])],2)],1)},Ge=[],Xe={props:{tour:{type:Object,default(){return{}}}},data(){return{store:M,imageData:this.$root.editor.imageData}},computed:{opened:{get(){return this.$root.editor.currentMarkerTour==this.tour},set(t){this.$root.editor.currentMarkerTour=t?this.tour:null}},steps(){if(!this.opened)return[];const t=[],e=[];for(let i=0;it.id==a)):null;t.push({title:(n?n.title:"NOT FOUND")||"(No title)",image:o?o.title:null,imageId:r,id:a,editorLink:r?location.href.replace(/\/edit\/[^/]+\/(\w{2})$/,`/edit/${r}/$1`):null})}return e.length&&this.opened&&this.getData(e),t}},methods:{removeStep(t,e){this.tour.steps.splice(e,1)},moveItem(t,e,i){t.stopPropagation(),t.preventDefault();const s=this.tour.steps.splice(e,1);this.tour.steps.splice(e+i,0,s[0])},getData(t){b.getImagesData(t,this.$root.editor.lang).then((e=>{const i=Object.assign({},this.imageData);t.forEach(((t,s)=>{i[t]=JSON.parse(e[s][3]),i[t].title=e[s][2]})),this.$root.editor.imageData=this.imageData=i}))},async addExternalStep(){const t=await this.$root.editor.getExternalMarker();this.imageData=this.$root.editor.imageData,t&&(this.tour.steps.indexOf(t)>=0?this.$root.main.setMessage("This marker is already in the tour!"):this.tour.steps.push(t))},async toggleTourImage(t,e){if(e.image)e.image=null;else{let t=await this.$root.editor.getImage();t&&(e.image=t.fileUrl)}}}},qe=Xe,Ke=(0,N.Z)(qe,We,Ge,!1,null,null,null),He=Ke.exports,Qe={components:{VideoTourEditor:Ue,MarkerTourEditor:He},data(){return{activeTab:"tab-markertours-selected"}},computed:{currentVideoTour(){return this.$root.editor.currentVideoTour},currentMarkerTour(){return this.$root.editor.currentMarkerTour}},watch:{activeTab(){this.$root.editor.currentVideoTour=this.$root.editor.currentMarkerTour=null}},methods:{addVideoTour(){this.$root.editor.currentVideoTour=null,this.$nextTick((()=>{const t=this.$root.editor.data.tours,e=this.$root.createGuid(),i={id:e,duration:30,audio:null,title:"New video tour",description:"",timeline:[],autostart:!1,keepMarkers:!1,events:[]};t.push(i),b.action(130,this.$root.editor.imageId,null,e),this.$nextTick((()=>{this.$root.editor.currentVideoTour=i}))}))},closeAllVideoTours(){this.$root.editor.currentVideoTour=null,this.$root.editor.currentVideoTourEditor=null},saveVideoTour(){this.closeAllVideoTours(),this.$root.editor.save()},removeVideoTour(){const t=this.currentVideoTour.id;let e=this.$root.editor.data.tours.findIndex((e=>e.id==t));this.$root.main.confirm("Do you want to remove this video tour?").then((()=>{b.action(131,this.$root.editor.imageId,null,t),this.$root.editor.data.tours.splice(e,1),this.closeAllVideoTours()})).catch((()=>null))},addMarkerTour(){this.$root.editor.currentMarkerTour=null,this.$nextTick((()=>{const t={id:this.$root.createGuid(),title:"New marker tour",description:"",body:"",steps:[],image:null,cannotClose:!1,autostart:!1,scrollable:!1,rememberStep:!1};this.$root.editor.data.markerTours.push(t),this.$root.editor.tutorial.step("add-tour"),b.action(120,this.$root.editor.imageId,null,t.id),this.$nextTick((()=>{this.$root.editor.currentMarkerTour=t}))}))},saveMarkerTour(){this.$root.editor.currentMarkerTour=null,this.$root.editor.save()},removeMarkerTour(){const t=this.currentMarkerTour.id;let e=this.$root.editor.data.markerTours.findIndex((e=>e.id==t));this.$root.main.confirm("Do you want to remove this marker tour?").then((()=>{b.action(121,this.$root.editor.imageId,null,t),this.$root.editor.data.markerTours.splice(e,1),this.$root.editor.currentMarkerTour=null})).catch((()=>null))}}},ti=Qe,ei=(0,N.Z)(ti,Ze,Ye,!1,null,null,null),ii=ei.exports,si=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"micrio-videotour",class:!t.paused&&"playing"},[t._l(t.data.timeline,(function(e,s){return i("MRectangle",{key:e.id,ref:"rects",refInFor:!0,attrs:{id:e.id,dark:t.sActive==e,area:e.rect,label:(s+1).toString()}})})),i("div",{staticClass:"tour-timeline"},[i("md-button",{on:{click:t.toggleTourStart}},[t.paused?i("md-icon",[t._v("play_arrow")]):i("md-icon",[t._v("pause")])],1),i("div",{ref:"track",staticClass:"track"},[i("div",{staticClass:"events"},t._l(t.data.events,(function(e,s){return i("div",{key:s,staticClass:"event",style:"--idx:"+s+";right:"+100*(1-e.end/t.data.duration)+"%;left:"+e.start/t.data.duration*100+"%;",attrs:{title:e.action+" / "+e.value+" - "+t.getTime(e.start*t.data.duration,!0)+" - "+t.getTime(e.end*t.data.duration,!0)}})})),0),t._l(t.data.timeline,(function(e,s){return i("div",{key:e.id,class:["segment",t.sActive==e&&"highlighted"],style:"right:"+100*(1-e.end)+"%;left:"+100*e.start+"%;",attrs:{title:t.getTime(e.start*t.data.duration,!0)+" - "+t.getTime(e.end*t.data.duration,!0)},on:{click:function(i){t.sActive=e!=t.sActive||t.moved?e:null},mousedown:function(i){return t.dStart(i,e)}}},[i("span",{staticClass:"index"},[t._v(t._s(s+1))]),i("button",{staticClass:"remove",attrs:{title:"Remove segment"},on:{click:function(e){return t.removeSegment(s)}}},[i("md-icon",[t._v("delete")])],1)])})),i("div",{class:["timebar",t.sDragging||t.tDragging?"dragging":null],style:"left: "+t.timePerc+"%",on:{mousedown:t.pStart}},[i("div",[t._v(t._s(t.timestamp))])])],2),i("md-button",{staticClass:"add",on:{click:t.addSegment}},[i("md-icon",[t._v("add")])],1)],1)],2)},ai=[],ri={components:{MRectangle:ue},props:{data:{type:Object,default(){return null}}},data(){return{sActive:null,sOrig:null,sDragging:!1,resizingLeft:!1,resizingRight:!1,sStartLeft:0,moved:!1,micrioTour:null,audio:null,timePerc:0,paused:!0,tick:0,tDragging:!1}},computed:{timestamp(){return this.getTime(this.data.duration*this.timePerc/100)}},created(){this.sort()},mounted(){this.micrioTour=new window.MicrioVideoTour(this.$root.editor.$refs.micrio,{duration:this.data.duration,timeline:this.data.timeline,events:this.data.events,keepInteraction:!0})},beforeDestroy(){clearInterval(this.tick),this.micrioTour.destroy(),this.micrioTour=null,this.audio&&this.unhookAudio(),this.dEnd(),this.pEnd()},watch:{data:{handler(){this.micrioTour&&(isNaN(Number(this.data.duration))||(this.micrioTour.duration=Number(this.data.duration),this.micrioTour.reset()))},deep:!0},sActive(t){this.$root.editor.activeRect=t?t.id:null},"$root.editor.activeRect"(){this.sActive=this.data.timeline.find((t=>t.id==this.$root.editor.activeRect))}},methods:{getTime(t,e=!1){const i=Math.floor(t%60),s=Math.floor(t/60);return s+":"+("0"+i).slice(-2)+(e?(Math.round(t%1*1e3)/1e3).toString().slice(1):"")},async toggleTourStart(){const t=this.$root.editor.currentMarkerEditor||this.$root.editor.currentVideoTourEditor;this.audio=t&&t.audio,this.$root.editor.currentMarkerEditor&&this.$root.editor.currentMarkerEditor.marker&&(this.data.audio=this.$root.editor.currentMarkerEditor.marker.audio),this.data.audio?(this.hookAudio(),this.paused?await this.audio.play():this.audio.pause()):(this.unhookAudio(),this.paused?this.micrioTour.play():this.micrioTour.pause()),clearInterval(this.tick),this.paused&&(this.tick=setInterval(this.tourTick,250)),this.paused=this.data.audio?this.audio.paused:this.micrioTour.paused},hookAudio(){this.data.audio.fileUrl&&this.data.audio.fileUrl!=this.audio.src&&(this.audio.src=this.data.audio.fileUrl,this.audio.onpause=()=>this.micrioTour.pause(),this.audio.onplay=()=>{this.micrioTour.currentTime=this.audio.currentTime,this.micrioTour.play()},this.audio.onseeked=()=>{this.micrioTour.currentTime=this.audio.currentTime})},unhookAudio(){this.$root.editor&&this.$root.editor.currentMarkerEditor&&delete this.data.audio,this.audio.onpaused=null,this.audio.onseeked=null,delete this.audio.src},tourTick(){this.timePerc=100*this.micrioTour.progress,this.micrioTour.ended&&clearInterval(this.tick)},sort(){this.data.timeline.sort(((t,e)=>t.starte.start?1:0))},addSegment(){const t=this.timePerc/100;let e=.05,i=t;0==t&&this.data.timeline.length&&(i=this.data.timeline[this.data.timeline.length-1].end);for(let a=-1;athis.sActive=s))},removeSegment(t){this.data.timeline.splice(t,1)},getLeft(t){let e=null;for(let i=0;i=e.end)&&(e=s))}return e&&e.end||0},getRight(t){let e=null;for(let i=0;i=t.end&&(!e||s.end<=e.end)&&(e=s))}return e&&e.start||1},isInside(t,e){for(let i=0;i=s.end),r=!(e<=s.start||e>=s.end);if(a||r||t<=s.start&&e>=s.end)return!0}return!1},dStart(t,e){if(1!=t.which||this.sActive!=e)return;this.sDragging=!0;const i=t.target.getBoundingClientRect(),s=t.clientX-i.left;this.resizingLeft=s<0,this.resizingRight=!this.resizingLeft&&s>t.target.offsetWidth,this.sStartLeft=t.clientX,this.sActive=e,this.sOrig=JSON.parse(JSON.stringify(this.sActive)),this.moved=!1,addEventListener("mousemove",this.dMove),addEventListener("mouseup",this.dEnd)},dMove(t){const e=(t.clientX-this.sStartLeft)/this.$refs.track.offsetWidth,i=this.sOrig.end-this.sOrig.start,s=this.getLeft(this.sOrig),a=this.getRight(this.sOrig),r=2/this.$refs.track.offsetWidth;if(this.moved=!0,this.resizingLeft)this.sActive.start=Math.max(s,Math.min(this.sOrig.end-r,this.sOrig.start+e));else if(this.resizingRight)this.sActive.end=Math.min(a,Math.max(this.sOrig.start+r,this.sOrig.end+e));else{let t=Math.max(0,this.sOrig.start+e),s=t+i;s>1&&(t=1-i,s=1),this.isInside(t,s)||(this.sActive.start=t,this.sActive.end=s,this.sort())}},dEnd(){removeEventListener("mousemove",this.dMove),removeEventListener("mouseup",this.dEnd),this.sOrig=null,this.sort()},pStart(t){1==t.which&&(addEventListener("mousemove",this.setProgress),addEventListener("mouseup",this.pEnd),this.setProgress(t),this.tDragging=!0)},setProgress(t){const e=this.$refs.track.getBoundingClientRect(),i=(t.clientX-e.left)/e.width;this.micrioTour&&(this.micrioTour.progress=i),this.audio&&this.audio.src&&(this.audio.currentTime=i*this.audio.duration),this.tourTick()},pEnd(){this.tDragging=!0,removeEventListener("mousemove",this.setProgress),removeEventListener("mouseup",this.pEnd)}}},oi=ri,ni=(0,N.Z)(oi,si,ai,!1,null,null,null),di=ni.exports,li=function(){var t=this,e=t.$createElement,i=t._self._c||e;return t.$root.editor.showSettings?i("div",{attrs:{id:"image-settings"}},[i("md-dialog-title",[t._v("Image Settings")]),t.showColorSelect?i("ColorPicker",{attrs:{value:t.settings.backgroundColor},on:{input:function(e){return t.settings.backgroundColor=e},close:function(e){t.showColorSelect=!1}}}):t._e(),i("md-tabs",[i("md-tab",{staticClass:"tab-content",attrs:{"md-label":"Content"}},[i("md-content",[i("h3",[t._v("Image title")]),i("md-field",[i("md-input",{attrs:{disabled:t.loading,placeholder:"Image title"},model:{value:t.title,callback:function(e){t.title=e},expression:"title"}})],1)],1),i("md-content",{staticClass:"lang-select"},[i("h3",[t._v("Current data language")]),t.isDemo?i("i",[t._v("Demo projects are not multilingual")]):i("div",t._l(t.store.state.langs,(function(e,s){return i("md-button",{key:s,class:t.$route.params.lang==s?"set-lang md-primary md-accent md-raised":"set-lang md-raised",attrs:{value:s,title:e,disabled:t.$route.params.lang==s},on:{click:function(){return t.setLang(s)}}},[t._v(t._s(s))])})),1)]),i("md-content",[i("h3",[t._v("Language-specific content")]),i("md-field",[i("label",[t._v("Image description")]),i("md-textarea",{attrs:{disabled:t.loading},on:{input:t.setDescription},model:{value:t.meta.descriptionMarkdown,callback:function(e){t.$set(t.meta,"descriptionMarkdown",e)},expression:"meta.descriptionMarkdown"}}),i("span",{staticClass:"md-helper-text"},[i("a",{attrs:{href:"https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet",target:"_blank"}},[t._v("Markdown")]),t._v(" supported")])],1),i("md-field",[i("label",[t._v("Copyright")]),i("md-textarea",{attrs:{disabled:t.loading},model:{value:t.meta.copyright,callback:function(e){t.$set(t.meta,"copyright",e)},expression:"meta.copyright"}})],1),i("md-field",[i("label",[t._v("Search engine keywords")]),i("md-input",{attrs:{disabled:t.loading},model:{value:t.meta.keywords,callback:function(e){t.$set(t.meta,"keywords",e)},expression:"meta.keywords"}})],1),i("md-field",[i("label",[t._v("Original Source URL")]),i("md-input",{attrs:{disabled:t.loading},model:{value:t.meta.sourceUrl,callback:function(e){t.$set(t.meta,"sourceUrl",e)},expression:"meta.sourceUrl"}})],1),t.isDemo?t._e():i("md-list",[i("md-list-item",{on:{click:t.copyFromLang}},[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Duplicate language")]),i("span",[t._v("Copy data from another language")])]),i("md-button",{staticClass:"md-icon-button"},[i("md-icon",[t._v("file_copy")])],1)],1),i("md-list-item",{on:{click:t.copyFrom}},[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Duplicate data")]),i("span",[t._v("Copy data from another image")])]),i("md-button",{staticClass:"md-icon-button"},[i("md-icon",[t._v("file_copy")])],1)],1)],1)],1)],1),i("md-tab",{attrs:{"md-label":"Settings"}},[i("md-content",[i("h3",[t._v("Image display")]),i("md-list",{staticClass:"md-double-line"},[i("md-list-item",{on:{click:t.toggleStartView}},[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Set start view")]),i("span",[t._v("Set the image opening view area")])]),i("md-button",{staticClass:"md-icon-button"},[i("md-icon",[t._v("crop_free")])],1)],1),t.$root.editor.svIsFull?t._e():i("md-list-item",{on:{click:t.resetStartView}},[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Reset start view")])])]),t.is360?t._e():i("md-list-item",{on:{click:t.toggleFocusPoint}},[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Set focal point")]),i("span",[t._v("When image is cut off, focus here")])]),i("md-button",{staticClass:"md-icon-button"},[i("md-icon",[t._v("filter_center_focus")])],1)],1),i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Always fill the screen")]),i("span",[t._v("Limit the view to the image boundaries")])]),i("md-switch",{attrs:{disabled:t.loading},model:{value:t.settings.limitToCoverScale,callback:function(e){t.$set(t.settings,"limitToCoverScale",e)},expression:"settings.limitToCoverScale"}})],1),i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Maximum zoom level")]),i("span",[t._v("1 = 100%")])]),i("div",{staticClass:"md-icon-button md-number"},[i("md-field",[i("md-input",{attrs:{disabled:t.loading,min:"0",step:"0.1",type:"number"},model:{value:t.settings.zoomLimit,callback:function(e){t.$set(t.settings,"zoomLimit",e)},expression:"settings.zoomLimit"}})],1)],1)]),i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Adjust max zoom to high DPI screens")]),i("span",[t._v("High DPI screens can zoom in as far as regular displays")])]),i("md-switch",{attrs:{disabled:t.loading},model:{value:t.settings.zoomLimitDPRFix,callback:function(e){t.$set(t.settings,"zoomLimitDPRFix",e)},expression:"settings.zoomLimitDPRFix"}})],1),i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Viewer background color")]),i("span",[t._v("Set the main background color")])]),i("md-button",{staticClass:"md-avatar md-colorpicker",style:"background-color: "+t.settings.backgroundColor+";",on:{click:function(e){t.showColorSelect=!t.showColorSelect}}})],1),i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Show title and description")]),i("span",[t._v("Show info within image window")])]),i("md-switch",{attrs:{disabled:t.loading},model:{value:t.settings.showInfo,callback:function(e){t.$set(t.settings,"showInfo",e)},expression:"settings.showInfo"}})],1)],1)],1),i("md-content",[i("h3",[t._v("Controls")]),i("md-list",{staticClass:"md-double-line"},[i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Enable navigation")]),i("span",[t._v("User panning and zooming")])]),i("md-switch",{attrs:{disabled:t.loading},model:{value:t.settings.hookEvents,callback:function(e){t.$set(t.settings,"hookEvents",e)},expression:"settings.hookEvents"}})],1),i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Fullscreen button")]),i("span",[t._v("Show a fullscreen toggle button")])]),i("md-switch",{attrs:{disabled:t.loading},model:{value:t.settings.fullscreen,callback:function(e){t.$set(t.settings,"fullscreen",e)},expression:"settings.fullscreen"}})],1),i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Show the minimap")]),i("span",[t._v("Display a small overview map with navigation")])]),i("md-switch",{attrs:{disabled:t.loading},model:{value:t.settings.minimap,callback:function(e){t.$set(t.settings,"minimap",e)},expression:"settings.minimap"}})],1),t.settings.minimap?i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Don't hide the minimap")]),i("span",[t._v("Keep showing the minimap when the user is fully zoomed out")])]),i("md-switch",{attrs:{disabled:t.loading},model:{value:t.settings.alwaysShowMinimap,callback:function(e){t.$set(t.settings,"alwaysShowMinimap",e)},expression:"settings.alwaysShowMinimap"}})],1):t._e(),i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Show social sharing buttons")]),i("span",[t._v("Twitter & facebook buttons")])]),i("md-switch",{attrs:{disabled:t.loading},model:{value:t.settings.social,callback:function(e){t.$set(t.settings,"social",e)},expression:"settings.social"}})],1)],1)],1),t.$root.editor.imageVersion>=4.2?i("md-content",[i("h3",[t._v("UI")]),i("md-list",{staticClass:"md-double-line"},[i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Color theme")]),i("span",[t._v("The UI color scheme")])]),i("select",{directives:[{name:"model",rawName:"v-model",value:t.settings.theme,expression:"settings.theme"}],on:{change:function(e){var i=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){var e="_value"in t?t._value:t.value;return e}));t.$set(t.settings,"theme",e.target.multiple?i:i[0])}}},[i("option",{attrs:{value:"dark"}},[t._v("Dark")]),i("option",{attrs:{value:"light"}},[t._v("Light")]),i("option",{attrs:{value:"os"}},[t._v("OS")])])])],1)],1):t._e()],1),i("md-tab",{attrs:{"md-label":"Advanced"}},[i("md-content",[i("h3",[t._v("360° image")]),i("div",{staticClass:"md-helper-text"},[t._v("For 360° images")]),i("md-list",{staticClass:"md-double-line"},[i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Image is 360°")]),i("span",[t._v("This image will be shown as a 360° image")])]),i("md-switch",{attrs:{disabled:t.loading},model:{value:t.is360,callback:function(e){t.is360=e},expression:"is360"}})],1),t.is360?[i("md-list-item",{on:{click:t.toggleFocusPoint}},[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Set orientation center")]),i("span",[t._v("Set the "),i("b",[t._v("forward")]),t._v(" X-coordinate")])])]),t.is360?i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Fill 360 screen")]),i("span",[t._v("Stretch the image vertically to fill the sphere")])]),i("md-switch",{attrs:{disabled:t.loading||!t.is360},model:{value:t.settings._360.closeTop,callback:function(e){t.$set(t.settings._360,"closeTop",e)},expression:"settings._360.closeTop"}})],1):t._e()]:t._e()],2)],1),t.hasVideo&&t.is360?i("md-content",[i("h3",[t._v("360° video")]),i("div",{staticClass:"md-helper-text"},[t._v("Full 360° sphere video")]),i("md-list",{staticClass:"md-double-line"},[i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("360° Video")]),t.settings._360.video.video?i("a",{attrs:{target:"_blank",href:t.settings._360.video.video.fileUrl}},[t._v(t._s(t.settings._360.video.video.fileName)+", "+t._s(t.$root.getDuration(t.settings._360.video.video.duration))+", "+t._s(t.$root.getFileSize(t.settings._360.video.video.fileSize)))]):i("span",[t._v("Upload an mp4 360° video")])]),i("md-button",{staticClass:"md-icon-button md-list-action",on:{click:t.toggle360Video}},[t.settings._360.video.video?i("md-icon",[t._v("delete")]):i("md-icon",[t._v("add")])],1)],1),i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Mute 360° video")]),i("span",[t._v("This allows for autoplaying video")])]),i("md-switch",{attrs:{disabled:t.loading},model:{value:t.settings._360.video.muted,callback:function(e){t.$set(t.settings._360.video,"muted",e)},expression:"settings._360.video.muted"}})],1),i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Loop 360° video")]),i("span",[t._v("Loop the video")])]),i("md-switch",{attrs:{disabled:t.loading},model:{value:t.settings._360.video.loop,callback:function(e){t.$set(t.settings._360.video,"loop",e)},expression:"settings._360.video.loop"}})],1),i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Show video controls")]),i("span",[t._v("Show a video control bar to pause/timeskip")])]),i("md-switch",{attrs:{disabled:t.loading},model:{value:t.settings._360.video.controls,callback:function(e){t.$set(t.settings._360.video,"controls",e)},expression:"settings._360.video.controls"}})],1),i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Preview")]),i("span",[t._v("Show preview image while video is loading")])]),i("md-switch",{attrs:{disabled:t.loading},model:{value:t.settings._360.video.preview,callback:function(e){t.$set(t.settings._360.video,"preview",e)},expression:"settings._360.video.preview"}})],1)],1)],1):t._e(),t.store.state.organisation&&t.store.state.organisation.hasSplitScreen?[i("md-content",[i("h3",[t._v("Split screen")]),i("md-list",{staticClass:"md-double-line"},[i("md-list-item",[t.micrioSplitLink?i("md-avatar",[i("img",{attrs:{src:t.$root.editor.thumbSrcIIIF(t.micrioSplitLink)}})]):t._e(),i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Splitscreen linked image")]),t.micrioSplitLink?i("span",[t._v("Image ID: "+t._s(t.micrioSplitLink))]):i("span",[t._v("Set a split-screen secondary image")])]),i("md-button",{staticClass:"md-icon-button md-list-action",on:{click:function(e){return t.toggleSplitLink(e)}}},[t.micrioSplitLink?i("md-icon",[t._v("delete")]):i("md-icon",[t._v("add")])],1)],1),t.micrioSplitLink?[i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("User navigation")]),i("span",[t._v("Allow user navigation in this image")])]),i("md-switch",{model:{value:t.settings.secondaryInteractive,callback:function(e){t.$set(t.settings,"secondaryInteractive",e)},expression:"settings.secondaryInteractive"}})],1),t.settings.secondaryInteractive?t._e():i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Independent camera")]),i("span",[t._v("Don't follow the main image's camera")])]),i("md-switch",{model:{value:t.settings.noFollow,callback:function(e){t.$set(t.settings,"noFollow",e)},expression:"settings.noFollow"}})],1)]:t._e()],2)],1)]:t._e(),i("md-content",[i("h3",[t._v("Custom "),t.store.getters.canUploadJSCSS?i("span",[t._v("JS & ")]):t._e(),t._v("CSS")]),i("div",{staticClass:"md-helper-text"},[t._v("Upload your own "),t.store.getters.canUploadJSCSS?i("span",[t._v("JS & ")]):t._e(),t._v("CSS here which will be bound to this image.")]),t.store.getters.canUploadJSCSS?i("md-list",{staticClass:"md-double-line"},[i("md-list-item",[t.settings.js?i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Custom Javascript")]),i("span",[t._v(t._s(t.settings.js.name)+", "+t._s(t.$root.timeAgo(t.settings.js.created)))])]):i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Upload a custom Javascript file")]),i("span",[t._v("This will always be included in the image")])]),t.settings.js?i("md-button",{staticClass:"md-icon-button md-list-action",on:{click:t.jsRemove}},[i("md-icon",[t._v("delete")])],1):i("md-button",{staticClass:"md-icon-button md-list-action",on:{click:t.jsAdd}},[i("md-icon",[t._v("add")])],1)],1)],1):t._e(),i("md-list",{staticClass:"md-double-line"},[i("md-list-item",[t.settings.css?i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Custom CSS")]),i("span",[i("a",{attrs:{href:t.settings.css.href,download:t.settings.css.name,target:"_blank"}},[t._v(t._s(t.settings.css.name))]),t._v(", "+t._s(t.$root.timeAgo(t.settings.css.created)))])]):i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Upload a custom CSS file")]),i("span",[t._v("This will always be included in the image")])]),t.settings.css?i("md-button",{staticClass:"md-icon-button md-list-action",on:{click:t.cssRemove}},[i("md-icon",[t._v("delete")])],1):i("md-button",{staticClass:"md-icon-button md-list-action",on:{click:t.cssAdd}},[i("md-icon",[t._v("add")])],1)],1)],1)],1),i("md-content",[i("h3",[t._v("Custom JSON")]),i("div",{staticClass:"md-helper-text"},[t._v("For custom implementations, set your own image JSON values here")]),i("JSONEditor",{attrs:{onChange:t.metaChanged,json:t.custom}}),i("div")],1)],2)],1),t.loading?i("md-progress-bar",{attrs:{"md-mode":"indeterminate"}}):t._e()],1):t._e()},ci=[],mi={components:{ColorPicker:Oe,JSONEditor:Pe.Z},props:{meta:{type:Object,default(){return{description:"",copyright:"",keywords:""}}},image:{type:Object,default(){return{title:"",is360:!1,settings:{_360:{allowVR:!1,closeTop:!1},_meta:{},focus:[.5,.5],limitToCoverScale:!1,events:!0,fullscreen:!0,loaderbar:!0,zoomLimit:1,minimap:!0,musicVolume:1,mutedVolume:0,repeatX:!1,social:!0,mapLimit:[0,0,1,1],alwaysShowMinimap:!1,alwaysShowZoomControls:!1,micrioSplitLink:null,secondaryInteractive:!1,noFollow:!1,js:null,css:null}}}}},data(){return{store:M,loading:!1,title:"",is360:!1,showStartView:!1,showFocusPoint:!1,showMapLimit:!1,showColorSelect:!1,custom:{},micrioSplitLink:null}},watch:{"$root.editor.showSettings"(){this.read(),this.showStartView=!1,this.showFocusPoint=!1,this.showMapLimit=!1,this.showColorSelect=!1}},mounted(){this.read(),this.$root.editor.imageSettings=this},computed:{settings(){return this.$root.editor.settings},isDemo(){return this.$root.editor.isDemo},hasVideo(){return M.state.organisation&&M.state.organisation.hasVideo}},methods:{setLang(t){this.$router.push(this.$route.path.replace(/.{2}$/,t))},async copyFrom(){let t=await this.$root.editor.getMicrio();if(!t)return;if(t.id==this.$root.editor.image.id)return void this.$root.main.setMessage("Cannot copy from myself...");this.loading=!0;const e=await b.getImage(t.shortId);if(!e)return void this.$root.main.setMessage("Could not find image with id ["+t.shortId+"]...");this.$root.editor.settings=e.settings;let i=await b.getImageData(t.id,this.$root.editor.lang).catch((()=>this.$root.main.setMessage("FAILED: Image has no data for this language!")));i&&(this.$root.editor.setData(i),await this.$root.editor.save(),this.$root.main.setMessage("Succesfully copied data")),this.loading=!1,this.$root.editor.showSettings=!1},async copyFromLang(){let t=await this.$root.editor.getLangs();t&&this.$root.main.confirm("Do you want to copy this language?","This means your current language data will be overwritten.").then((async()=>{this.loading=!0;let e=await b.getImageData(this.image.id,t.culture).catch((()=>this.$root.main.setMessage("FAILED: Image has no data for this language!")));e&&(this.$root.editor.setData(e),await this.$root.editor.save(),this.$root.main.setMessage("Succesfully copied data")),this.loading=!1}))},toggleStartView(){this.showFocusPoint=!1,this.showMapLimit=!1,this.showStartView=!this.showStartView,this.showStartView&&s["default"].nextTick((()=>{this.$root.editor.activeRect=this.$root.editor.$refs.viewRect.id}))},resetStartView(){this.showStartView=!1,this.$root.editor.activeRect=null,this.$root.editor.startView[0]=0,this.$root.editor.startView[1]=0,this.$root.editor.startView[2]=1,this.$root.editor.startView[3]=1,this.$root.editor.svChanged()},toggleFocusPoint(){this.showStartView=!1,this.showMapLimit=!1,this.showFocusPoint=!this.showFocusPoint},toggleMapLimit(){this.showStartView=!1,this.showFocusPoint=!1,this.showMapLimit=!this.showMapLimit,this.showMapLimit&&s["default"].nextTick((()=>{this.$root.editor.activeRect=this.$root.editor.$refs.mapLimitRect.id}))},metaChanged(t){this.settings._meta=t},read(){this.title=this.image.title,this.is360=this.image.is360,this.custom=this.settings._meta,this.micrioSplitLink=this.settings.micrioSplitLink},setDescription(){this.meta.description=(0,ht.TU)(this.meta.descriptionMarkdown)},async toggle360Video(){if(this.settings._360.video.video)this.settings._360.video.video=null;else{const t=await this.$root.editor.getVideo();t&&(this.settings._360.video.video=t)}},async toggleSplitLink(t){t.stopPropagation(),t.preventDefault(),this.micrioSplitLink?this.micrioSplitLink=null:this.micrioSplitLink=await this.$root.editor.getExternalMarker(!0),this.settings.micrioSplitLink=this.micrioSplitLink},async jsAdd(){const t=await this.$root.editor.getJS();t&&(this.settings.js={created:t.created,name:t.fileName,href:t.fileUrl})},jsRemove(){this.settings.js=null},async cssAdd(){const t=await this.$root.editor.getCSS();t&&(this.settings.css={created:t.created,name:t.fileName,href:t.fileUrl})},cssRemove(){this.settings.css=null}}},ui=mi,hi=(0,N.Z)(ui,li,ci,!1,null,null,null),pi=hi.exports,gi=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("md-dialog",{attrs:{id:"asset-picker","md-active":t.$root.editor.showAssetPicker},on:{"update:mdActive":function(e){return t.$set(t.$root.editor,"showAssetPicker",e)},"update:md-active":function(e){return t.$set(t.$root.editor,"showAssetPicker",e)}}},[i("input",{ref:"file",staticClass:"select-file",attrs:{type:"file"},on:{change:t.fileSelected}}),i("md-dialog-title",[t._v(t._s(t.uploading?"Uploading":"Select")+" "+t._s(t.type))]),"micrio"==t.type?i("md-content",{staticClass:"micrio-search"},[i("md-field",[i("label",{attrs:{for:"micrioSearchType"}},[t._v("Show images from...")]),i("md-select",{attrs:{id:"micrioSearchType"},model:{value:t.micrioSearchType,callback:function(e){t.micrioSearchType=e},expression:"micrioSearchType"}},[i("md-option",{attrs:{value:"folder"}},[t._v("This image's folder")]),i("md-option",{attrs:{value:"project"}},[t._v("This image's project")])],1)],1),i("md-field",[i("label",{attrs:{for:"micrioSearchQuery"}},[t._v("Title search...")]),i("md-input",{attrs:{for:"micrioSearchQuery"},model:{value:t.micrioSearchQuery,callback:function(e){t.micrioSearchQuery=e},expression:"micrioSearchQuery"}})],1)],1):t._e(),t.simpleMode?t._e():i("md-content",{staticClass:"asset-list"},[t.loading||t.itemsPaginated.length||t.items.length?t._e():i("md-empty-state",{attrs:{"md-icon":"audio"==t.type?"volume_up":"image","md-label":t.micrioSearchQuery?"No search results":"No files yet"}}),i("md-list",{staticClass:"md-double-line"},[t._l(t.itemsPaginated,(function(e){return i("md-list-item",{key:e.id,class:t.selected==e.id?"selected":"",attrs:{disabled:t.loading},on:{click:function(i){return t.select(e.id,i)}}},["marker"==t.type?i("md-avatar",[i("img",{staticClass:"marker-thumb",attrs:{src:t.getMarkerThumbSrc(e)}})]):"language"!=t.type&&"subtitle"!=t.type?i("md-avatar",["image"==t.type?i("img",{attrs:{src:t.$root.editor.getThumb(e.fileUrl)}}):"micrio"==t.type?i("img",{attrs:{src:t.$root.editor.thumbSrc(e.originalShortId||e.shortId,e.width,e.height,e.tileSize,e.isPng,e.isWebP,e.mapType)}}):"audio"==t.type?i("md-button",{staticClass:"md-icon-button",on:{click:function(i){return t.playPause(e.fileUrl)}}},[t.audioPlaying&&t.audio.src==e.fileUrl?i("md-icon",{staticClass:"play-pause"},[t._v("pause")]):i("md-icon",{staticClass:"play-pause"},[t._v("play_arrow")])],1):"video"==t.type?i("md-icon",[t._v("videocam")]):t._e()],1):t._e(),"marker"==t.type?i("div",{staticClass:"md-list-item-text"},[i("span",[t._v(t._s(e.title||"(no title)"))]),i("span",[t._v("id: "+t._s(e.id))]),i("span",[t._v("x: "+t._s(e.x)+", y: "+t._s(e.y))])]):"language"==t.type?i("div",{staticClass:"md-list-item-text"},[i("span",[t._v(t._s(t.store.state.langs[e.culture]))]),i("span",[t._v(t._s(e.lastPublished))])]):"subtitle"==t.type?i("div",{staticClass:"md-list-item-text"},[i("span",[t._v(t._s(e.title))]),i("span",{staticClass:"image-info"},[i("span",[t._v(t._s(t.$root.timeAgo(e.created)))]),i("span",[t._v(t._s(t.$root.getFileSize(e.fileSize)))])])]):"micrio"==t.type?i("div",{staticClass:"md-list-item-text"},[i("span",[t._v(t._s(e.title))]),i("span",[t._v(t._s(e.shortId+", "+(e.mapType?"map":e.width+" x "+e.height)))])]):i("div",{staticClass:"md-list-item-text"},[i("span",[t._v(t._s(e.title))]),i("span",{staticClass:"image-info"},[i("span",[t._v(t._s(t.$root.timeAgo(e.created)))]),"image"==t.type||"video"==t.type?i("span",[t._v(t._s(e.width)+" x "+t._s(e.height))]):t._e(),"audio"==t.type||"video"==t.type?i("span",[t._v(t._s(t.$root.getDuration(e.duration)))]):t._e(),"video"==t.type?i("span",[t._v(t._s(t.$root.getFileSize(e.fileSize)))]):t._e()])]),t.simpleMode||"audio"!=t.type?t._e():i("md-button",{staticClass:"md-icon-button md-list-action",attrs:{href:e.fileUrl,target:"_blank",title:"Direct link"}},[i("md-icon",[t._v("link")])],1),"marker"!=t.type&&"micrio"!=t.type&&"language"!=t.type?i("md-button",{staticClass:"md-icon-button md-list-action",attrs:{title:"Delete asset",disabled:t.loading},on:{click:function(i){return t.deleteAsset(e.id)}}},[i("md-icon",[t._v("delete")])],1):t._e()],1)})),t.items.length>0&&"language"!=t.type?i("md-button",{on:{click:t.nextPage}},[t._v("Load more")]):t._e()],2)],1),t.loading?i("md-progress-bar",{attrs:{"md-mode":t.uploading?"determinate":"indeterminate","md-value":t.uploadPerc}}):t._e(),t.simpleMode?t._e():i("md-toolbar",[i("md-button",{attrs:{title:"Cancel",disabled:t.loading},on:{click:t.cancel}},[i("md-icon",[t._v("cancel")])],1),"micrio"!=t.type&&"language"!=t.type?i("md-button",{staticClass:"md-primary",attrs:{title:"Create new",disabled:t.loading},on:{click:t.create}},[i("md-icon",[t._v("add")])],1):t._e(),i("md-button",{staticClass:"md-primary",attrs:{title:"Select",disabled:t.loading||!t.selected},on:{click:t.choose}},[i("md-icon",[t._v("check")])],1)],1)],1)},vi=[];const fi=(t,e,i,s=null)=>{const a=document.createElement("canvas"),r=a.getContext("2d");let o={};return new Promise((async n=>{let d=await bi(t);if(d.width){for(let t in i)o[t]=await _i(JSON.parse(JSON.stringify(e)),a,r,d,i[t][0],i[t][1],i[t][2],s);n(o)}}))},bi=async t=>new Promise(((e,i)=>{if(!t)return i("No file");let s=new Image;t instanceof Image&&(s.crossOrigin="anonymous"),s.onload=()=>e(s),s.onerror=i,s.src=t instanceof Image?t.src:URL.createObjectURL(t)})),_i=async(t,e,i,s,a,r,o=!1,n="image/jpeg",d=.87,l=!1)=>new Promise((c=>{t&&t.data&&(t.data["fileName"]=t.objectId+"."+a+("image/png"==n?".png":".jpg"),t.data["mimeType"]=n,t.data["forceName"]=!0);let m=s.width/s.height,u=a,h=a/m;(!o&&h>r||o&&h{if(l){const t=new Image;t.onload=()=>c(t),t.src=URL.createObjectURL(e)}else t.file=e,t.data["width"]=p,t.data["height"]=g,c(t)}),n,d)}));var yi={props:{type:String,no360:Boolean,maps:Boolean},data(){return{store:M,guid:null,items:[],itemsPaginated:[],selected:null,loading:!0,uploading:!1,uploadPerc:0,audio:new Audio,audioPlaying:!1,numPerPage:10,micrioSearchType:"folder",micrioSearchQuery:"",micrioSearchTo:null}},beforeDestroy(){this.reset()},computed:{simpleMode:function(){return"js"==this.type||"css"==this.type}},async mounted(){if(this.guid=this.$root.editor.image.id,"marker"==this.type){const t=this.$root.editor.pickerMarkerMicrioId,e=this.$root.editor.lang,i=await b.getImagesData([t],e),s=i&&i[0]&&i[0][3]&&JSON.parse(i[0][3]);if(!s)return this.$root.main.setMessage(`No data was found for this image. Does it have data in language [${e}]?`),this.close();if(!s.markers||!s.markers.length)return this.$root.main.setMessage("No markers were found in this image."),this.close();s.title=i[0][0],this.$root.editor.imageData[t]=s,this.items=s.markers.slice(0),this.loading=!1,this.nextPage()}else if("language"==this.type){if(this.items=(await b.getLanguages(this.guid)).filter((t=>t.culture!=this.$root.editor.lang)),this.items.forEach((t=>t.id=t.culture)),this.items.length<1)return this.$root.main.setMessage("Image has no other languages than the current one!"),this.close();this.selected=this.items[0].id,this.loading=!1,this.nextPage()}else this.simpleMode?(this.loading=!1,this.create(),document.body.onfocus=()=>{setTimeout((()=>{this.$refs.file.files.length||this.close()}),1e3)}):(this.audio.autoplay=!0,this.audio.addEventListener("play",(()=>this.audioPlaying=!0)),this.audio.addEventListener("pause",(()=>this.audioPlaying=!1)),this.audio.addEventListener("ended",(()=>this.audioPlaying=!1)),this.load())},watch:{micrioSearchType(){this.load()},micrioSearchQuery(){clearTimeout(this.micrioSearchTo),this.micrioSearchTo=setTimeout((()=>this.load()),1e3)}},methods:{async load(){this.loading=!0,this.itemsPaginated=[],this.items=await b.getAssets(this.guid,this.type,this.no360,this.maps,this.micrioSearchType,this.micrioSearchQuery),this.nextPage(),this.loading=!1},nextPage(){this.itemsPaginated=this.itemsPaginated.concat(this.items.splice(0,this.numPerPage))},choose(){this.close()},cancel(){this.selected=null,this.close()},close(){this.$emit("chosen",this.itemsPaginated.find((t=>t.id==this.selected))),this.$root.editor.showAssetPicker=!1,this.reset(),this.simpleMode&&(document.body.onfocus=null)},create(){this.$refs.file.setAttribute("accept","image"==this.type?"image/jpeg,image/png,image/svg+xml":"audio"==this.type?"audio/mp3,audio/ogg":"video"==this.type?"video/webm,video/mp4":"subtitle"==this.type?"text/plain,.srt":"js"==this.type?"application/javascript":"css"==this.type?"text/css":""),this.$refs.file.click()},reset(){this.audio.pause(),this.selected=null},playPause(t){this.audio.src!=t?(this.audio.src=t,this.audioPlaying=!0):this.audio.paused?this.audio.play():this.audio.pause()},deleteAsset(t){this.$root.main.confirm("Do you want to delete this asset?").then((async()=>{let e=this.itemsPaginated.findIndex((e=>e.id==t));e<0||(this.audio.pause(),this.loading=!0,await b.removeAsset(t),this.loading=!1,this.itemsPaginated.splice(e,1))})).catch((()=>null))},fileSelected(t){const e=t.target||this.$refs.file;if(!e||!e.files)return void(this.simpleMode&&this.close());const i=e.files[0];if(!i)return void(this.simpleMode&&this.close());let s={micrioId:this.guid,title:i.name,fileName:i.name,fileSize:i.size,mimeType:i.type,type:this.type,created:Date.now(),tags:null};if("image"==this.type){let t=URL.createObjectURL(i),e=new Image;e.onload=()=>{s.width=e.width,s.height=e.height,this.uploadImage(s,i)},e.onerror=()=>{this.$root.main.setMessage("File error! Did you select a JPEG or PNG image?"),this.close()},e.src=t}else if("audio"==this.type){if("audio/ogg"!=i.type&&"audio/mp3"!=i.type&&"audio/mpeg"!=i.type)return this.$root.main.setMessage("Please select an MP3 or OGG audio file"),void this.close();let t=URL.createObjectURL(i),e=new Audio;e["oncanplay"]=()=>{s.duration=e.duration,this.uploadAudioVideo(s,i)},e.onerror=()=>{this.$root.main.setMessage("File error! Did you select a valid MP3 audio file?"),this.close()},e.src=t}else if("video"==this.type){if("video/webm"!=i.type&&"video/mp4"!=i.type)return this.$root.main.setMessage("Please select a WebM or MP4 video file"),void this.close();let t=URL.createObjectURL(i),e=document.createElement("video");e["oncanplay"]=()=>{s.duration=e.duration,s.width=e.videoWidth,s.height=e.videoHeight,s.fileSize=i.size,this.uploadAudioVideo(s,i)},e.onerror=()=>{this.$root.main.setMessage("File error! Did you select a valid video file?"),this.close()},e.src=t}else"subtitle"==this.type?this.uploadSubtitle(s,i):"js"==this.type?this.uploadJS(s,i):"css"==this.type&&this.uploadCSS(s,i)},async select(t,e){if(!e||!e.target.classList.contains("play-pause"))if(this.selected==t)this.selected=null;else if(this.selected=t,"image"==this.type){const t=this.itemsPaginated.find((t=>t.id==this.selected));t.shortId||(t.shortId=await b.tileAsset(t.id),console.log("Tile original untiled asset..",t.shortId))}},async uploadImage(t,e){this.uploadPerc=0,this.uploading=!0,this.loading=!0;const i="image/jpeg"==e.type||"image/png"==e.type,s=100*(i?1/7:1),a="image/svg+xml"==e.type?".svg":"image/png"==e.type?".png":".jpg",r=await b.uploadFile(t,e);if(t.shortId=await b.tileAsset(r),this.uploadPerc+=s,i){const i=await fi(e,{objectId:r,data:t},{hd:[1920,1080],large:[1024,768],medium:[640,480],small:[320,200],iconBig:[200,200,!0],icon:[64,64,!0]},e.type);for(let t in i)await b.uploadFile(i[t].data,i[t].file,!1),this.uploadPerc+=s}t.id=r,t.fileUrl="https:"+M.state.baseUrl+this.$root.editor.image.shortId+"/assets/"+r+a,this.itemsPaginated.unshift(t),this.selected=r,this.loading=!1,this.uploading=!1,this.simpleMode&&(this.selected=r,this.close())},async uploadAudioVideo(t,e){this.loading=!0,this.uploading=!0;const i=await b.uploadFile(t,e),s=e.name.replace(/^.*\.([^.]+)$/i,"$1");t.id=i,t.fileUrl="https:"+M.state.baseUrl+this.$root.editor.image.shortId+"/assets/"+i+"."+s,this.itemsPaginated.unshift(t),this.loading=!1,this.uploading=!1,this.simpleMode&&(this.selected=i,this.close())},async uploadSubtitle(t,e){t.mimeType="text/plain",await this.uploadText(t,e),this.itemsPaginated.unshift(t)},async uploadJS(t,e){t.mimeType="application/javascript",await this.uploadText(t,e)},async uploadCSS(t,e){t.mimeType="text/css",await this.uploadText(t,e)},async uploadText(t,e){this.loading=!0,this.uploading=!0;const i=await b.uploadFile(t,e).catch((t=>{this.$root.main.setMessage(t),this.close()}));if(!i)return;const s=e.name.replace(/^.*\.([^.]+)$/i,"$1");t.id=i,t.fileUrl="https:"+M.state.baseUrl+this.$root.editor.image.shortId+"/assets/"+i+"."+s,this.itemsPaginated.unshift(t),this.loading=!1,this.uploading=!1,this.simpleMode&&(this.selected=i,this.close())},getMarkerThumbSrc(t){const e=this.$root.editor.pickerMarkerMicrioId,i=t.area&&t.area.join(","),s=i&&",,,"!=i?i:t.view?"pct:"+[t.view[0],t.view[1],t.view[2]-t.view[0],t.view[3]-t.view[1]].join(","):"full";return`https://iiif.${x?"micrio.dev":"micr.io"}/${e}/${s}/!128,128/0/default.jpg`}}},ki=yi,wi=(0,N.Z)(ki,gi,vi,!1,null,null,null),Si=wi.exports,$i=function(){var t=this,e=t.$createElement,i=t._self._c||e;return t.$root.editor.showAudio?i("div",[i("md-dialog-title",[t._v("Audio")]),i("md-tabs",[i("md-tab",{attrs:{"md-label":"Background"},on:{click:function(e){t.showPositional=!1}}},[t.$root.editor.data.audio.playlist.items.length?i("md-list",{staticClass:"md-double-line"},t._l(t.$root.editor.data.audio.playlist.items,(function(e){return i("md-list-item",{key:e.id},[i("md-avatar",[i("md-button",{staticClass:"md-icon-button",on:{click:function(i){return t.playPause(i,e.src)}}},[t.audioPlaying&&t.audio.src==e.src?i("md-icon",[t._v("pause")]):i("md-icon",[t._v("play_arrow")])],1)],1),i("div",{staticClass:"md-list-item-text"},[i("span",[t._v(t._s(e.fileName))]),i("span",[t._v(t._s(e.duration>0?t.$root.getDuration(e.duration):""))])]),i("md-button",{staticClass:"md-icon-button md-list-action",on:{click:function(i){return t.removeSample(i,e.id)}}},[i("md-icon",[t._v("delete")])],1)],1)})),1):i("md-empty-state",{attrs:{"md-icon":"queue_music","md-label":"Add your background music below"}})],1),i("md-tab",{attrs:{"md-label":"Positional"},on:{click:function(e){t.showPositional=!0}}},[t.$root.editor.data.audio.locations.length?i("md-list",{staticClass:"md-double-line",attrs:{"md-expand-single":"expandSingle"}},t._l(t.$root.editor.data.audio.locations,(function(e){return i("md-list-item",{key:e.id,attrs:{id:"_"+e.id,"md-expand":"","md-expanded":t.$root.editor.activeRect==e.id},on:{click:function(i){return t.sampleSelect(e.id)}}},[i("md-avatar",[i("md-button",{staticClass:"md-icon-button",on:{click:function(i){return t.playPause(i,e.src)}}},[t.audioPlaying&&t.audio.src==e.src?i("md-icon",[t._v("pause")]):i("md-icon",[t._v("play_arrow")])],1)],1),i("div",{staticClass:"md-list-item-text"},[i("span",[t._v(t._s(e.fileName))]),i("span",[t._v(t._s(e.duration>0?t.$root.getDuration(e.duration):"")+", "+t._s(Math.round(100*e.volume))+"% volume")])]),i("md-list",{attrs:{slot:"md-expand"},slot:"md-expand"},[i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Pause between loops")]),i("span",[t._v("In seconds")])]),i("div",{staticClass:"md-icon-button md-number"},[i("md-field",[i("md-input",{attrs:{min:"0",step:"1",type:"number"},model:{value:e.repeatAfter,callback:function(i){t.$set(e,"repeatAfter",i)},expression:"sample.repeatAfter"}})],1)],1)]),i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Don't play on mobile devices")])]),i("md-switch",{model:{value:e.noMobile,callback:function(i){t.$set(e,"noMobile",i)},expression:"sample.noMobile"}})],1),i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Remove this sample")])]),i("md-button",{staticClass:"md-icon-button md-list-action",on:{click:function(i){return t.removeSample(i,e.id)}}},[i("md-icon",[t._v("delete")])],1)],1)],1)],1)})),1):i("md-empty-state",{attrs:{"md-icon":"volume_up","md-label":"Add your first positional audio below"}})],1),i("md-tab",{attrs:{"md-label":"Settings"}},[i("md-list",{staticClass:"md-double-line"},[i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Background music volume")]),i("span",[t._v("1 = 100%")])]),i("div",{staticClass:"md-icon-button md-number"},[i("md-field",[i("md-input",{attrs:{min:"0",step:"0.01",type:"number"},model:{value:t.settings.musicVolume,callback:function(e){t.$set(t.settings,"musicVolume",e)},expression:"settings.musicVolume"}})],1)],1)]),i("md-list-item",[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Background fade out volume")]),i("span",[t._v("Fade to this when other audio is playing")])]),i("div",{staticClass:"md-icon-button md-number"},[i("md-field",[i("md-input",{attrs:{min:"0",step:"0.01",type:"number"},model:{value:t.settings.mutedVolume,callback:function(e){t.$set(t.settings,"mutedVolume",e)},expression:"settings.mutedVolume"}})],1)],1)])],1)],1)],1),i("md-toolbar",[i("md-button",{staticClass:"md-primary md-accent md-raised",attrs:{title:"add new"},on:{click:t.add}},[i("md-icon",[t._v("add")]),t._v(" Add audio")],1),i("md-button",{staticClass:"md-primary",attrs:{title:"save new"},on:{click:function(e){return t.$root.editor.setSection("none")}}},[i("md-icon",[t._v("check")]),t._v(" Save")],1)],1)],1):t._e()},Ii=[],Ci={data(){return{showPositional:!1,store:M,audioPlaying:!1,audio:new Audio}},watch:{"$root.editor.showAudio"(){this.showPositional=!1,this.audio&&this.audio.pause()},showPositional(t){this.audio.pause(),this.$root.editor.showAudio&&(t?this.$root.editor.tutorial.show("positional-audio"):this.$root.editor.tutorial.show("audio"))}},mounted(){this.audio.autoplay=!0,this.audio.addEventListener("play",(()=>this.audioPlaying=!0)),this.audio.addEventListener("pause",(()=>this.audioPlaying=!1)),this.audio.addEventListener("ended",(()=>this.audioPlaying=!1))},beforeDestroy(){this.audio.pause(),this.$root.editor&&(this.$root.editor.activeRect=null)},computed:{settings(){return this.$root.editor.settings}},methods:{sampleSelect(t){setTimeout((()=>{const e=this.$el.querySelector("#_"+t).firstChild.classList.contains("md-active");(this.$root.editor.activeRect=e?t:null)?this.$root.editor.tutorial.step("add-audio"):this.$root.editor.tutorial.show(null)}),50)},async add(){let t=await this.$root.editor.getAudio();if(!t)return;const e=this.$root.createGuid(),i=this.$root.editor.$refs.micrio.camera.getCoo((innerWidth-360)/2,(innerHeight-48)/2),s=Number(this.$root.editor.$refs.micrio.getAttribute("width")),a=.2/i[2]*(innerWidth/s);this.showPositional?(this.$root.editor.data.audio.locations.push({id:e,fileName:t.title,src:t.fileUrl,duration:t.duration,loop:!0,isLocation:!0,volume:1,radius:a,x:i[0],y:i[1],noMobile:!1,repeatAfter:0}),this.$nextTick((()=>{this.$root.editor.activeRect=e,this.$nextTick((()=>this.sampleSelect(e)))}))):(this.$root.editor.data.audio.playlist.items.push({id:e,src:t.fileUrl,fileName:t.title,duration:t.duration}),this.$root.editor.tutorial.step("add-music"))},removeSample(t,e){t.stopPropagation(),t.preventDefault(),this.$root.main.confirm("Do you want to delete this audio sample?").then((async()=>{let t=this.showPositional?this.$root.editor.data.audio.locations:this.$root.editor.data.audio.playlist.items,i=t.findIndex((t=>t.id==e));i>=0&&t.splice(i,1)})).catch((()=>null))},playPause(t,e){t.stopPropagation(),t.preventDefault(),this.audio.src!=e?(this.audio.src=e,this.audioPlaying=!0):this.audio.paused?this.audio.play():this.audio.pause()}}},Pi=Ci,xi=(0,N.Z)(Pi,$i,Ii,!1,null,null,null),ji=xi.exports,Ti=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("Rectangle",{ref:"rect",attrs:{id:t.sample.id,label:t.sample.fileName,className:"no-select",icon:"volume_up",ratio:1,slider:t.sample.volume,rounded:!0,boundless:!0,centered:!0,x:t.sample.x,y:t.sample.y,radius:t.sample.radius},on:{change:t.changed,active:t.activated}})},Mi=[],Di={components:{Rectangle:ue},props:{sample:{type:Object,default(){return{x:.5,y:.5,radius:.1}}}},data(){return{micrioItem:null}},beforeDestroy(){this.activated(!1)},methods:{activated(t){},changed(){this.sample.radius=this.$refs.rect.mradius,this.sample.x=this.$refs.rect.mx,this.sample.y=this.$refs.rect.my;let t=this.$refs.rect.$refs.slider;t&&(this.sample.volume=Number(t.value)),this.micrioItem&&(this.micrioItem.read(this.sample),this.micrioItem.update())}}},Ai=Di,Oi=(0,N.Z)(Ai,Ti,Mi,!1,null,null,null),Ei=Oi.exports,Li=function(){var t=this,e=t.$createElement,i=t._self._c||e;return t.$root.editor.showEmbeds?i("div",[i("md-dialog-title",[t._v("Micrio embeds")]),i("md-content",[t.$root.editor.data.children.length?i("md-list",{staticClass:"md-double-line"},t._l(t.$root.editor.data.children,(function(e){return i("md-list-item",{key:e.guid,class:[t.selected==e.guid&&"md-active"],on:{click:function(i){t.selected=t.selected==e.guid?null:e.guid}}},[i("md-avatar",[i("img",{attrs:{src:t.$root.editor.thumbSrc(e.tilesId||e.id,e.width,e.height,e.tileSize,e.isPng,e.isWebP)}})]),i("div",{staticClass:"md-list-item-text"},[i("span",[t._v(t._s(e.title))]),i("span",[t._v(t._s(e.width)+" x "+t._s(e.height))])]),i("md-button",{staticClass:"md-icon-button md-list-action",on:{click:function(i){return t.remove(i,e.guid)}}},[i("md-icon",[t._v("delete")])],1)],1)})),1):i("md-empty-state",{attrs:{"md-icon":"image","md-label":"Create your embedded image below"}})],1),i("md-toolbar",[i("md-button",{staticClass:"md-primary",attrs:{title:"new embed"},on:{click:t.add}},[i("md-icon",[t._v("add")])],1)],1)],1):t._e()},Ri=[],Ni={data(){return{selected:null}},watch:{"$root.editor.activeRect"(t){this.selected=t},selected(t){this.$root.editor.activeRect=t}},methods:{async add(){this.selected=null;let t=await this.$root.editor.getMicrio(!0);if(!t)return;const e=this.$root.createGuid(),i=.4/(t.width/t.height),s={guid:e,id:t.shortId,title:t.title,width:t.width,height:t.height,tileSize:t.tileSize,isPng:t.isPng,area:[.4,.5-i/2,.6,.5+i/2]};t.originalShortId&&(s.tilesId=t.originalShortId),this.$root.editor.data.children.push(s),this.selected=e},remove(t,e){t.stopPropagation(),t.preventDefault(),this.$root.main.confirm("Do you want to delete this embed?").then((async()=>{const t=this.$root.editor.data.children,i=t.findIndex((t=>t.guid==e));i>=0&&(this.selected=null,t.splice(i,1))})).catch((()=>null))}}},Vi=Ni,Ui=(0,N.Z)(Vi,Li,Ri,!1,null,null,null),zi=Ui.exports,Fi=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("Rectangle",{ref:"rect",attrs:{id:t.embed.guid,label:t.embed.title,area:t.embed.area,ratio:t.ratio,className:"embed"}})},Ji=[],Bi={components:{Rectangle:ue},props:{embed:{type:Object,default(){return{id:"",guid:"",title:"",area:[.4,.4,.6,.6],width:100,height:100}}}},mounted(){this.$refs.rect.$el.style.backgroundImage="url("+this.$root.editor.thumbSrc(this.embed.tilesId||this.embed.id,this.embed.width,this.embed.height,this.embed.tileSize,!!this.embed.isPng,!!this.embed.isWebP)+")"},computed:{ratio(){return this.embed.width/this.embed.height}}},Zi=Bi,Yi=(0,N.Z)(Zi,Fi,Ji,!1,null,null,null),Wi=Yi.exports,Gi=function(){var t=this,e=t.$createElement,i=t._self._c||e;return t.$root.editor.showCustomPages?i("div",[i("md-dialog-title",[t._v("Custom Menus")]),i("md-content",[t.$root.editor.data.pages.length?i("md-list",{attrs:{"md-expand-single":""}},t._l(t.$root.editor.data.pages,(function(e,s){return i("md-list-item",{key:e.id,attrs:{"md-expand":""}},[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v(t._s(e.title)+" "+t._s(t.getNumPages(e)))])]),i("md-button",{staticClass:"md-icon-button md-list-action",on:{click:function(i){return t.removeMenu(i,e.id)}}},[i("md-icon",[t._v("delete")])],1),s0?i("md-button",{staticClass:"md-icon-button md-list-action",attrs:{title:"Move up"},on:{click:function(e){return t.moveItem(e,s,-1)}}},[i("md-icon",[t._v("arrow_upward")])],1):t._e(),i("div",{attrs:{slot:"md-expand"},slot:"md-expand"},[e.isGroup?i("div",[i("md-list",[i("md-list-item",[i("md-field",[i("label",[t._v("Menu title")]),i("md-input",{model:{value:e.title,callback:function(i){t.$set(e,"title",i)},expression:"menu.title"}})],1)],1)],1),i("h3",[t._v("Pages in this menu")]),i("md-list",[t._l(e.children,(function(s,a){return i("md-list-item",{key:s.id,attrs:{"md-expand":""}},[i("div",{staticClass:"md-list-item-text"},[i("span",[t._v(t._s(s.title))])]),a0?i("md-button",{staticClass:"md-icon-button md-list-action",attrs:{title:"Move up"},on:{click:function(i){return t.moveItem(i,a,-1,e.children)}}},[i("md-icon",[t._v("arrow_upward")])],1):t._e(),i("md-button",{staticClass:"md-icon-button md-list-action",on:{click:function(i){return t.removePage(i,s.id,e)}}},[i("md-icon",[t._v("delete")])],1),i("md-list",{staticClass:"md-double-line",attrs:{slot:"md-expand"},slot:"md-expand"},[i("md-list-item",[i("md-field",[i("label",[t._v("Page title")]),i("md-input",{model:{value:s.title,callback:function(e){t.$set(s,"title",e)},expression:"page.title"}})],1)],1),i("md-list-item",[i("md-field",[i("label",[t._v("External link")]),i("md-input",{attrs:{disabled:s.markerId},model:{value:s.link,callback:function(e){t.$set(s,"link",e)},expression:"page.link"}})],1)],1),i("md-list-item",[i("md-field",[i("label",[t._v("On click, open marker with ID..")]),i("md-input",{attrs:{disabled:s.link},model:{value:s.markerId,callback:function(e){t.$set(s,"markerId",e)},expression:"page.markerId"}})],1)],1),i("md-list-item",[i("md-field",[i("label",[t._v("Page content")]),i("md-textarea",{staticClass:"description",attrs:{disabled:t.isLink(s)},on:{input:function(e){return t.setContent(s)}},model:{value:s.markdown,callback:function(e){t.$set(s,"markdown",e)},expression:"page.markdown"}}),i("span",{staticClass:"md-helper-text"},[i("a",{attrs:{href:"https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet",target:"_blank"}},[t._v("Markdown")]),t._v(" supported")])],1)],1),i("md-list-item",[i("md-field",[i("label",[t._v("Embed URL")]),i("md-input",{attrs:{disabled:t.isLink(s)},model:{value:s.embed,callback:function(e){t.$set(s,"embed",e)},expression:"page.embed"}})],1)],1),i("md-list-item",[s.image?i("md-avatar",[i("img",{attrs:{src:t.$root.editor.getThumb(s.image)}})]):t._e(),i("div",{staticClass:"md-list-item-text"},[i("span",[t._v("Page image")]),i("span",[t._v("Set an image for this page")])]),i("md-button",{staticClass:"md-icon-button md-list-action",on:{click:function(e){return t.togglePageIcon(e,s)}}},[s.image?i("md-icon",[t._v("delete")]):i("md-icon",[t._v("add")])],1)],1)],1)],1)})),i("md-button",{on:{click:function(i){return t.addPage(e)}}},[t._v("Add new page")])],2)],1):t._e()])],1)})),1):i("md-empty-state",{attrs:{"md-icon":"list","md-label":"Create your first custom menu below"}})],1),i("md-toolbar",[i("md-button",{staticClass:"md-primary md-accent md-raised",attrs:{title:"add new page"},on:{click:t.addMenu}},[i("md-icon",[t._v("add")]),t._v(" Add a menu")],1)],1)],1):t._e()},Xi=[],qi={data(){return{store:M}},methods:{getNumPages(t){return t.children&&t.children.length?`(${t.children.length} page${1!=t.children.length?"s":""})`:""},setContent(t){t.content=(0,ht.TU)(t.markdown)},isLink(t){return!(!t.link&&!t.markerId)},addMenu(){this.$root.editor.data.pages.push({id:this.$root.createGuid(),title:"New menu",children:[],isGroup:!0})},addPage(t){t.children.push({id:this.$root.createGuid(),title:"New page",content:"",markdown:"",link:null,markerId:null,image:null,children:[],data:{}})},removeMenu(t,e){t.stopPropagation(),t.preventDefault(),this.$root.main.confirm("Do you want to remove this menu?","Any underlying pages will be removed as well!").then((async()=>{let t=this.$root.editor.data.pages,i=t.findIndex((t=>t.id==e));i>=0&&t.splice(i,1)})).catch((()=>null))},removePage(t,e,i){t.stopPropagation(),t.preventDefault(),this.$root.main.confirm("Do you want to remove this page?").then((async()=>{let t=i.children,s=t.findIndex((t=>t.id==e));s>=0&&t.splice(s,1)})).catch((()=>null))},moveItem(t,e,i,s=this.$root.editor.data.pages){t.stopPropagation(),t.preventDefault();const a=s.splice(e,1);s.splice(e+i,0,a[0])},async togglePageIcon(t,e){if(e.image)e.image=null;else{let t=await this.$root.editor.getImage();t&&(e.image=t.fileUrl)}}}},Ki=qi,Hi=(0,N.Z)(Ki,Gi,Xi,!1,null,null,null),Qi=Hi.exports,ts=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("span")},es=[],is={mounted(){addEventListener("keydown",this.keyPress)},beforeDestroy(){removeEventListener("keydown",this.keyPress)},methods:{keyPress(t){switch(t.key.toUpperCase()){case"P":t.ctrlKey&&(t.preventDefault(),this.$parent.doPublish());break}}}},ss=is,as=(0,N.Z)(ss,ts,es,!1,null,null,null),rs=as.exports,os=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{attrs:{id:"tutorial"}},[i("transition",{attrs:{mode:"out-in"}},[t.visible?i("md-card",{key:t.currentID,class:t.position},[i("md-card-header",[i("div",{staticClass:"md-title",domProps:{innerHTML:t._s(t.title)}})]),i("md-card-actions",[i("md-button",{staticClass:"md-icon-button",on:{click:t.close}},[i("md-icon",[t._v("clear")])],1)],1),i("md-card-content",{domProps:{innerHTML:t._s(t.content)}}),i("div",{staticClass:"tutorial-arrow"})],1):t._e()],1)],1)},ns=[],ds={data(){return{active:!1,tutorial:null,currentID:null,dialog:null,store:M}},created(){this.$root.editor.tutorial=this},computed:{visible(){return this.active&&null!=this.currentDialog},currentDialog(){return null==this.dialog?null:this.dialog.find((t=>t.id===this.currentID))},title(){return this.currentDialog.title},content(){return this.currentDialog.content},position(){return this.currentDialog.position}},methods:{finish(){this.store.state.finishedTutorials.push(this.tutorial),this.active=!1},close(){this.finish(),this.$root.main.confirm("Disable hints","Do you want to disable all hints? You can always re-enable them in your account settings.").then((()=>{this.store.state.showTutorials=!1,localStorage.setItem("editor_showTutorials","0"),b.action(102,null,!1)}))},step(t){if(this.currentID!==t||null==this.dialog)return!1;let e=this.dialog.findIndex((t=>t.id===this.currentID));null!=this.dialog[e].skip&&(e+=this.dialog[e].skip),e++,e"New marker"!=t.title)),this.currentID=this.$root.editor.data.markers.length>0?"select-marker":"add-marker",this.dialog=[{id:"add-marker",title:"Add Marker",content:'Click add to add a marker',position:"tutorial-drawer-bottom"},{id:"place-marker",title:"Place Marker",content:"Click anywhere on the image to place a marker",position:"tutorial-image",skip:1},{id:"select-marker",title:"Select Marker",content:"Select a marker to edit its settings",position:"tutorial-image"},{id:"set-title",title:"Set Title",content:"Choose a title for this marker",position:"tutorial-drawer-center"},{id:"set-description",title:"Set Description",content:"Set a description for this marker",position:"tutorial-drawer-center"},{id:"save",title:"Save Changes",content:'Click check to save changes to this marker',position:"tutorial-drawer-bottom"}];break;case"markers-tours":this.active=null==this.$root.editor.previous.markerTours.find((t=>t.steps.length>0)),this.$root.editor.data.markers.length>0?this.currentID=this.$root.editor.data.markerTours.length>0?"select-tour":"add-tour":this.currentID="add-markers",this.dialog=[{id:"add-markers",title:"First add Markers",content:"Add some markers before making a marker tour",position:"tutorial-drawer-top"},{id:"add-tour",title:"Add Tour",content:'Click add to add a tour',position:"tutorial-drawer-bottom"},{id:"select-tour",title:"Select Tour",content:"Click a tour to edit its settings",position:"tutorial-drawer-center"},{id:"set-title",title:"Set Title",content:"Choose a title for this tour",position:"tutorial-drawer-center"},{id:"select-markers",title:"Select Markers",content:"Click markers to add them to the tour",position:"tutorial-image"}];break;case"audio":this.active=0==this.$root.editor.previous.audio.playlist.items.length,this.currentID=0==this.$root.editor.data.audio.playlist.items.length?"add-music":"save",this.dialog=[{id:"add-music",title:"Add Music",content:'Click add to add background music/audio',position:"tutorial-drawer-bottom"}];break;case"positional-audio":this.active=0==this.$root.editor.previous.audio.locations.length,this.currentID=0==this.$root.editor.data.audio.locations.length?"add-audio":"save",this.dialog=[{id:"add-audio",title:"Add Audio",content:'Click add to add positional audio',position:"tutorial-drawer-bottom"},{id:"position-audio",title:"Positional Audio",content:'Drag the audio source around and use aspect_ratio to set its scale',position:"tutorial-image"}];break;case"publish":this.active=!0,this.currentID="publish",this.dialog=[{id:"publish",title:"Publish",content:'Click on publish to make your changes publicly available',position:"tutorial-publish"}],setTimeout((()=>this.dialog=null),5e3);break;default:this.active=!1,this.currentID=null,this.dialog=null;break}}}},ls=ds,cs=(0,N.Z)(ls,os,ns,!1,null,null,null),ms=cs.exports;const us={description:"",descriptionMarkdown:"",markers:[],markerTours:[],tours:[],audio:{playlist:{items:[]},locations:[]},children:[],pages:[]};var hs={components:{Rectangle:ue,Focus:be,MMarker:$e,MarkerEditor:Be,Tours:ii,VideoTour:di,ImageSettings:pi,AudioEditor:ji,AssetPicker:Si,AudioLocation:Ei,EmbedEditor:zi,MEmbed:Wi,CustomPages:Qi,KeyboardControls:rs,Tutorial:ms},data(){return{store:M,isDevEnv:x,loaded:!1,image:null,imageId:null,menu:null,lang:this.$route.params.lang,data:us,settings:{},previousSettings:{},previous:{},saving:!1,drawerOpen:!1,startView:[0,0,1,1],svIsFull:!1,activeRect:null,activeTour:null,showAssetPicker:!1,no360Picker:!1,mapsPicker:!0,assetPickerType:null,currentVideoTour:null,currentMarkerTour:null,pickerMarkerMicrioId:null,isDemo:!1,imageData:{},activeSection:null,savingData:!1,savingSettings:!1}},computed:{showSidebar:{get(){return this.showSettings||this.showMarkers||this.showTours||this.showAudio||this.showEmbeds||this.showCustomPages},set(){this.activeSection="none"}},showSettings:{get(){return"settings"==this.activeSection},set(){this.activeSection="none"}},showMarkers:{get(){return"markers"==this.activeSection},set(){this.activeSection="none"}},showTours:{get(){return"tours"==this.activeSection},set(){this.activeSection="none"}},showAudio:{get(){return"audio"==this.activeSection},set(){this.activeSection="none"}},showEmbeds:{get(){return"embeds"==this.activeSection},set(){this.activeSection="none"}},showCustomPages:{get(){return"customPages"==this.activeSection},set(){this.activeSection="none"}},showPositional(){return this.showAudio&&this.$refs.audio.showPositional},canEmbed(){return M.state.organisation&&M.state.organisation.hasEmbeds&&0==this.image.mapType&&!this.image.is360},baseUrl(){return"https:"+(window.__baseUrl||M.state.baseUrl)},imageVersion(){return Number(this.image.version)}},watch:{showSidebar(t){this.drawerOpen=t},"$route.params.id"(){this.$route.params.id&&this.$route.params.id!=this.imageId&&this.init()},async"$route.params.lang"(t){M.getters.currentCulture!=t&&(await b.setDefaultLang(t),M.state.user.defaultCulture=t),await this.save(),this.lang=t,this.load()},activeSection(t){b.action(100,this.$route.params.id,t)}},mounted(){this.init()},beforeDestroy(){this.remove(),this.$root.editor=null,M.state.editing=!1},methods:{async init(){this.image&&this.remove();const t=this.$root.main.home.$refs.toolbar;window._importMarkers=this.importMarkers,M.state.editing=!0,this.$root.editor=this,this.imageId=this.$route.params.id,this.image=await b.getImage(this.$route.params.id),this.image.startView&&(this.startView=this.image.startView.split(",").map((t=>Number(t)))),this.isDemo=P.indexOf(this.image.shortId)>=0||P.indexOf(this.image.originalShortId)>=0,b.action(40,this.$route.params.id),window._micrioEditor=this;const e=JSON.stringify(this.image.settings);this.previousSettings=JSON.parse(e),this.settings=this.image.settings,this.migrateSettings(this.image.settings),s["default"].nextTick((async()=>{await this.load(),this.loaded=!0,M.state.loaded=!0,t.$refs.editMenu.appendChild(this.$refs.editMenu.$el),t.$refs.editIcons.appendChild(this.$refs.toolbarIcons.$el)}))},remove(){this.image=null,this.$refs.editMenu&&(this.$refs.editMenu.$el.parentNode.removeChild(this.$refs.editMenu.$el),this.$refs.toolbarIcons.$el.parentNode.removeChild(this.$refs.toolbarIcons.$el)),this.websocket.close(),window._micrioEditor=void 0},async load(){let t=await b.getImageData(this.image.id,this.isDemo?"en":this.lang).catch((()=>{}));this.svChanged(),this.websocket&&this.websocket.close(),this.websocket=new oe(this.image.id,this.lang,this.dataUpdated),t||(t=JSON.parse(JSON.stringify(us))),this.setData(t),this.previous=JSON.parse(JSON.stringify(t)),this.save(!0)},svChanged(){this.svIsFull="0,0,1,1"==this.startView.toString()},dataUpdated(t,e){switch(t){case 1:{const t=this.data,i=JSON.stringify(e);if(i==JSON.stringify(this.previous))return;this.updateMarkers(e.markers),this.previous=JSON.parse(i),this.clearData(),this.$nextTick((()=>{e.markerTours.forEach((e=>t.markerTours.push(e))),e.tours.forEach((e=>t.tours.push(e))),e.audio.locations.forEach((e=>t.audio.locations.push(e))),e.audio.playlist.items.forEach((e=>t.audio.playlist.items.push(e))),e.children.forEach((e=>t.children.push(e))),e.pages.forEach((e=>t.pages.push(e)))}));break}case 2:this.showSettings=!1,this.image.title=e.title,this.image.is360=e.is360,this.startView=this.image.startView=e.startView,e.settings&&(this.settings=e.settings,this.previousSettings=JSON.parse(JSON.stringify(e.settings)));break}},updateMarkers(t){for(let e=0;ei.id==t.id)),a=t.find((t=>i.id==t.id)),r=!s,o=!r&&JSON.stringify(s)!=JSON.stringify(i);if(r||o)continue;const n=this.data.markers.indexOf(s);if(!a&&s)this.data.markers.splice(n,1);else if(JSON.stringify(a)!=JSON.stringify(i))for(let t in a)s[t]=a[t]}t.filter((t=>!this.previous.markers.find((e=>e.id==t.id)))).forEach((t=>this.data.markers.push(t)))},clearData(){const t=this.data;while(t.markerTours.length)t.markerTours.shift();while(t.tours.length)t.tours.shift();while(t.audio.locations.length)t.audio.locations.shift();while(t.audio.playlist.items.length)t.audio.playlist.items.shift();while(t.children.length)t.children.shift();while(t.pages.length)t.pages.shift()},setData(t){this.migrate(t),this.data=t},setSection(t){switch(this.save(),this.activeSection){case"markers":{this.currentMarkerTour=this.currentVideoTour=null;const e=!!this.$refs.markers.activeId;if(this.$refs.markers.activeId=null,"none"==t&&e)return;break}case"tours":this.currentMarkerTour=this.currentVideoTour=null;break}this.activeSection==t?this.activeSection="none":this.activeSection=t,this.$root.editor.tutorial.show(this.activeSection)},setStartView(t){this.startView=t,this.save()},async save(t=!1){if(!this.loaded)return;const e=[];this.createSlugs(this.data.markers),this.createSlugs(this.data.markerTours),this.createSlugs(this.data.tours);const i=JSON.stringify(this.previousSettings)!=JSON.stringify(this.settings);i&&(console.log("settings changed..."),e.push(b.setSettings(this.image.id,this.settings)),this.savingSettings=!0,this.previousSettings=JSON.parse(JSON.stringify(this.settings)));const s=JSON.stringify(this.previous)!=JSON.stringify(this.data);s&&(console.log("meta changed..."),e.push(b.setImageData(this.image.id,this.lang,this.data)),this.savingData=!0,this.previous=JSON.parse(JSON.stringify(this.data)));const a=this.startView!=this.image.startView;a&&(console.log("start view changed!"),e.push(b.setStartView(this.image.id,this.startView)),this.savingSettings=!0,this.image.startView=this.startView.join(",")),this.imageSettings.title!=this.image.title&&(console.log("title changed!"),e.push(b.renameImage(this.image.id,this.imageSettings.title)),this.savingSettings=!0,this.image.title=this.imageSettings.title),this.imageSettings.is360!=this.image.is360&&(console.log("360 changed!"),e.push(b.set360(this.image.id,this.imageSettings.is360)),this.savingSettings=!0,this.image.is360=this.imageSettings.is360),e.length&&(console.log("changed... saving!"),this.websocket&&(this.savingData&&this.websocket.send(1,this.data),this.savingSettings&&this.websocket.send(2,this.image)),this.saving=!0,await Promise.all(e),this.saving=!1,this.savingData=!1,this.savingSettings=!1,t||setTimeout((()=>{this.tutorial.active||this.showSidebar||this.tutorial.show("publish")}),500))},reset(){this.data=this.previous,this.previous=JSON.parse(JSON.stringify(this.data)),this.settings=this.previousSettings,this.startView=this.image.startView?this.image.startView.split(",").map((t=>Number(t))):[0,0,1,1],this.previousSettings=JSON.parse(JSON.stringify(this.settings))},preview(){this.save().then((()=>window.open(`https://i.${x?"micrio.dev":"micr.io"}/${this.image.shortId}/${this.$root.editor.lang}?preview`,"_blank")))},publish(){this.$root.main.confirm("Do you want to publish this image?","This means your current version will be publicly available.").then((()=>this.save().then(this.doPublish))).catch((()=>{}))},async doPublish(){this.tutorial.show(null),this.saving=!0,await b.publishShortId(this.image.shortId,this.lang),this.saving=!1,this.$root.main.setMessage("Succesfully published image! It can take up to a minute before you see the changes.")},async getAsset(t,e=!1,i=!1){this.no360Picker=e,this.mapsPicker=i,this.assetPickerType=t,this.showAssetPicker=!0;let a=null,r=null;function o(t){a.$off("chosen",o),r(t)}return s["default"].nextTick((()=>{a=this.$refs.assetPicker,a.$on("chosen",o)})),new Promise((t=>r=t))},getAudio(){return this.getAsset("audio")},getImage(){return this.getAsset("image")},getMicrio(t=!1,e=!1){return this.getAsset("micrio",t,e)},async getExternalMarker(t=!1){const e=await this.getAsset("micrio",!1,!0);if(!e)return null;if(t)return e.shortId;this.pickerMarkerMicrioId=e.shortId;const i=await this.getAsset("marker");return i?`${i.id},${e.shortId}`:null},getVideo(){return this.getAsset("video")},getLangs(){return this.getAsset("language")},getSubtitles(){return this.getAsset("subtitle")},getJS(){return this.getAsset("js")},getCSS(){return this.getAsset("css")},migrateSettings(t){t._360||(t._360={}),t._360.video||(t._360.video={}),t._meta||(t._meta={}),t._markers||(t._markers={}),t.backgroundColor||(t.backgroundColor="#000000"),t.focus||(t.focus=[.5,.5]);const e={markerIcon:null,staticPopups:this.imageVersion>=4.2,staticMobilePopups:!1,showTitles:!1,markerColor:this.imageVersion>=4.2?"#ffffff":"#ffbb00",markerSize:this.imageVersion>=4.2?16:25,zoomOutAfterClose:!0};for(let i in e)void 0===t._markers[i]&&(t._markers[i]=e[i])},importMarkers(t){t&&(t.forEach((t=>this.data.markers.push(t))),this.save())},migrate(t){t.markers||(t.markers=[]);for(let e=0;e{"string"==typeof t&&(i.images[e]={src:t,title:null,description:null}),t.width&&t.height||b.getImageDimensions(t).then((e=>{e&&(t.id=e.id,t.width=e.width,t.height=e.height)}),null,!0)})),"string"==typeof i.audio){let t=i.audio.split("/");i.audio={fileUrl:i.audio,title:t[t.length-1],mimeType:"audio/mp3",duration:null}}if(i.embedImages||(i.embedImages=[]),i.embedImages.forEach((t=>{void 0===t.rotX&&(t.rotX=0),void 0===t.rotY&&(t.rotY=0)})),void 0===i.audioAutoPlay&&(i.audioAutoPlay=!0),void 0===i.embedInPopover&&(i.embedInPopover=!1),void 0===i.embedInEmbed&&(i.embedInEmbed=!1),void 0===i.embedInEmbedImmediate&&(i.embedInEmbedImmediate=!1),void 0===i.embedMutesAudio&&(i.embedMutesAudio=!0),void 0===i.noMarker&&(i.noMarker=!1),i.markdown||(i.markdown=i.body),i.videoTour||(i.videoTour=null),i.videoTour&&(i.videoTour.subtitle||(i.videoTour.subtitle=null),i.videoTour.events||(i.videoTour.events=[])),void 0===i.data.micrioSplitLink&&(i.data.micrioSplitLink=null),i.data.micrioLink||(i.data.micrioLink=null),i.data.icon||(i.data.icon=null),i.data.micrioLink&&!i.data.micrioLink.id&&(i.data.micrioLink={id:i.data.micrioLink,tileSize:null,width:0,height:0,isPng:!1,isWebP:!1}),i.html&&!i.embedUrl){const t=i.html.replace(/^.*src="([^"]+)".*$/im,"$1");t&&(i.embedUrl=t)}}t.markerTours||(t.markerTours=[]);for(let e=0;et.id==i.steps[e]));!s&&i.steps[e].indexOf(",")<0&&(console.log("Removed nonexistant marker from tour.."),i.steps.splice(e--,1))}}t.tours||(t.tours=[]);for(let e=0;e embed in an old format. It only updates that iframe URL to the newly set URL.");const t=this.data.markers.filter((t=>t.html&&t.embedUrl&&t.html.indexOf('"'+t.embedUrl+'"')<0));if(!t.length)return console.warn("No markers with different embed embeds");t.forEach((t=>{console.log(`Update [${t.title}] to ${t.embedUrl}`),t.html=t.html.replace(/src="[^"]+"/,`src="${t.embedUrl}"`)})),this.save()},thumbSrc(t,e,i,s=512,a=!1,r=!1,o=0){if(o>0)return"https://static.micr.io/home/img/editor/maptypes/1.png";let n=1,d=-1;for(let l=s;l{let i=t.title,s="",a=0;if(i){do{s=re()(i,{lower:!0})}while(e.indexOf(s)>=0&&(i=t.title+"-"+a++));e.push(s),t.slug=s}}))},getThumb(t,e=64){return t.replace(/\.(jpg|png)$/i,"."+e+".$1").replace(/\.JPG$/,".jpg").replace(/\.PNG$/,".png")},getIconThumb(t,e=64){if(!t)return null;const i=t["fileUrl"]||t["icon"];return t.iconMicrioId?`https://iiif.${x?"micrio.dev":"micr.io"}/${t.iconMicrioId}/max/^${e},/0/default.${/\.png/.test(i)?"png":"jpg"}`:i.replace(/\.(jpg|png)$/i,"."+e+".$1").replace(/\.JPG$/,".jpg").replace(/\.PNG$/,".png")},printCoo(t){console.info("Clicked coords",this.$refs.micrio.camera.getCoo(t.clientX,t.clientY,!0))}}},ps=hs,gs=(0,N.Z)(ps,ie,se,!1,null,null,null),vs=gs.exports,fs=function(){var t=this,e=t.$createElement,i=t._self._c||e;return t.slug&&t.project?i("section",{key:t.slug,staticClass:"project"},[t.project.isActive?t._e():i("md-toolbar",{staticClass:"notification"},[t._v(" This project is currently inactive. Please "),i("router-link",{attrs:{to:"./activate"}},[t._v("activate this project")]),t._v(" to continue using it! ")],1),i("Folder",{key:t.key})],1):t.state.loaded?i("md-empty-state",{attrs:{"md-icon":"error","md-label":"Project not found"}}):t._e()},bs=[],_s=function(){var t=this,e=t.$createElement,i=t._self._c||e;return t.folder?i("div",{key:t.$route.params.project,staticClass:"folder"},[i("input",{ref:"file",staticClass:"select-file",attrs:{type:"file",accept:t.selectingVideo?t.acceptedVideoTypes:t.acceptedTypes,multiple:""},on:{change:t.fileSelected}}),i("div",{staticClass:"folders"},[i("div",{staticClass:"folder-navigation"},[i("md-button",{staticClass:"md-narrow navigation-arrow",attrs:{to:"../"}},[i("md-icon",[t._v("arrow_back")])],1),i("div",{staticClass:"folder-titles"},[i("p",[t._v(" "+t._s(t.path.length>1?t.path[t.path.length-2]:t.path.length?t.project.title:"All projects")+" ")]),i("h2",{staticClass:"md-headline"},[t._v(" "+t._s(t.path.length?t.path[t.path.length-1]:t.project.title)+" ")])])],1),i("div",[t.project.isActive?i("md-menu",{staticClass:"folder-create"},[t.folder.zoneKey?[i("md-button",{staticClass:"md-primary md-has-icon",attrs:{to:"./spaces/edit"}},[i("md-icon",{staticClass:"color"},[t._v("workspaces")]),t._v(" Edit in Spaces")],1)]:[i("md-button",{staticClass:"md-primary md-has-icon",attrs:{disabled:t.$parent.limitReached},on:{click:function(){return t.selectFile(!1)}}},[i("md-icon",{staticClass:"color"},[t._v("add_box")]),t._v(" Image")],1),t.store.state.organisation&&t.store.state.isAdmin?i("md-button",{staticClass:"md-primary md-has-icon",staticStyle:{display:"none"},attrs:{disabled:t.$parent.limitReached},on:{click:function(){return t.fromUrl()}}},[i("md-icon",{staticClass:"color"},[t._v("add_box")]),t._v(" Image from URL")],1):t._e(),t.store.state.organisation&&t.store.state.organisation.hasExternalIIIF?i("md-button",{staticClass:"md-primary md-has-icon",attrs:{disabled:t.$parent.limitReached},on:{click:function(){return t.createImageFromIIIFSource()}}},[i("md-icon",{staticClass:"color"},[t._v("add_box")]),t._v(" IIIF Image")],1):t._e(),t.store.state.organisation&&t.store.state.organisation.hasVideo?i("md-button",{staticClass:"md-primary md-has-icon",attrs:{disabled:t.$parent.limitReached},on:{click:function(){return t.selectFile(!0)}}},[i("md-icon",{staticClass:"color"},[t._v("add_box")]),t._v(" Video")],1):t._e(),i("md-button",{staticClass:"md-primary md-has-icon",attrs:{disabled:t.$parent.limitReached},on:{click:t.doCreateFolder}},[i("md-icon",{staticClass:"color"},[t._v("create_new_folder")]),t._v(" Folder")],1)]],2):t._e(),i("md-menu",{staticClass:"folder-view"},[i("md-button",{staticClass:"md-narrow",class:{active:t.listView},attrs:{title:"List view"},on:{click:function(e){return t.setListView(!0)}}},[i("md-icon",[t._v("list")])],1),i("md-button",{staticClass:"md-narrow",class:{active:!t.listView},attrs:{title:"Grid view"},on:{click:function(e){return t.setListView(!1)}}},[i("md-icon",[t._v("grid_view")])],1)],1),t.listView?t._e():i("md-menu",{staticClass:"sorting-view"},[i("md-button",{staticClass:"md-narrow",class:{active:"Title"==t.sorting},attrs:{title:"Sort by title"},on:{click:function(e){return t.setSort("Title")}}},[i("md-icon",[t._v("sort_by_alpha")])],1),i("md-button",{staticClass:"md-narrow",class:{active:"Date"==t.sorting},attrs:{title:"Sort by date"},on:{click:function(e){return t.setSort("Date")}}},[i("md-icon",[t._v("event")])],1)],1),t.project.zoneKey?t._e():i("md-menu",{staticClass:"folder-actions"},[i("md-button",{staticClass:"md-icon-button",attrs:{"md-menu-trigger":""}},[i("md-icon",[t._v("more_vert")])],1),i("md-menu-content",[i("md-menu-item",[i("span",[t._v("ID: "),i("b",[t._v(t._s(t.folder.shortId))])])]),t.numImages>0?i("md-menu-item",{attrs:{href:t.publicUrl,target:"_blank"}},[t._v("Public link")]):t._e(),t.folder.parentId?i("md-menu-item",{on:{click:t.doRename}},[t._v("Rename folder")]):t._e(),t.folder.parentId?i("md-menu-item",{on:{click:t.doMove}},[t._v("Move folder")]):t._e(),t.folder.parentId?i("md-menu-item",{staticClass:"md-primary md-accent",attrs:{to:"./delete"}},[t._v("Delete folder")]):t._e(),t.isAdmin?i("md-menu-item",{on:{click:function(e){return t.setPassword(t.folder.id)}}},[t._v("Set password")]):t._e()],1)],1)],1)]),!t.loading&&0==t.numImages&&0==t.folders.length&&t.project.isActive?i("md-empty-state",{attrs:{"md-icon":"add_photo_alternate","md-label":"Upload your first image","md-description":t.project.zoneKey?"Open the spaces editor to add your first 360 image!":"Drag and drop your image here or click this button to start with your first image!"}},[t.project.zoneKey?i("md-button",{staticClass:"md-primary md-accent md-raised",attrs:{to:"./spaces/edit"}},[t._v("Edit in Spaces")]):i("md-button",{staticClass:"md-primary md-accent md-raised",on:{click:function(){return t.selectFile(!1)}}},[t._v("Select image file")])],1):!t.project.isActive||!t.loading&&0==t.numImages&&0==t.folders.length?i("md-empty-state",{attrs:{"md-icon":"restore_page","md-label":"Inactive project","md-description":"This project is currently not active."}}):[i("md-content",[t.$parent.project&&t.$parent.limitReached?i("span",{staticClass:"limit-reached"},[t._v("You have reached your account limits and cannot upload new images. Please upgrade your account, or clean up by deleting unused uploads.")]):t._e()]),t.numImages>t.imagesPerPage?i("Pagination",{attrs:{"num-per-page":t.imagesPerPage,offset:t.offset,total:t.numImages}}):t._e(),t.loading?i("div",{staticClass:"micrio-loader"}):t.listView?i("div",{staticClass:"images-table"},[i("table",[i("thead",[i("tr",[t.folder.zoneKey?t._e():i("th",[i("input",{ref:"selectAll",staticClass:"select-all",class:t.selected.length0},on:{click:t.selectAll}})]),i("th",{staticClass:"center"},[!t.folder.zoneKey&&t.selected.length>0?i("md-menu",{staticClass:"selection-actions"},[i("md-button",{staticClass:"md-icon-button",attrs:{"md-menu-trigger":"",title:"With selection.."}},[i("md-icon",[t._v("list")])],1),i("md-menu-content",[i("md-menu-item",{on:{click:t.publishAll}},[t._v("Publish")]),i("md-menu-item",{on:{click:t.depublishAll}},[t._v("Depublish")]),i("md-menu-item",{on:{click:function(e){return t.setAll360(!0)}}},[t._v("Set as 360°")]),i("md-menu-item",{on:{click:function(e){return t.setAll360(!1)}}},[t._v("Unset as 360°")]),t.isAdmin?i("md-menu-item",{on:{click:t.resetAllVersions}},[t._v("Reset versions")]):t._e(),i("md-menu-item",{staticClass:"md-primary md-accent",on:{click:t.deleteAll}},[t._v("Delete")])],1)],1):t._e()],1),i("th"),i("th",[i("span",{staticClass:"sortable",on:{click:function(e){return t.setSort("Title")}}},[t._v("Name")])]),i("th",{staticClass:"center no-mobile pre"},[i("md-icon",[t._v("publish")]),t._v("Published")],1),i("th",{staticClass:"center no-mobile pre"},[i("md-icon",[t._v("event")]),t._v(" "),i("span",{staticClass:"sortable",on:{click:function(e){return t.setSort("Date")}}},[t._v("Created")])],1),i("th",{staticClass:"center no-tablet pre"},[i("md-icon",[t._v("photo_size_select_actual")]),t._v(" Dimensions")],1),i("th",{staticClass:"center no-tablet pre",attrs:{title:"Total image size (all zoom layers and assets)"}},[i("md-icon",[t._v("storage")]),t._v(" Size")],1),i("th",{staticClass:"menu"})])]),i("tbody",[t.folder.parentId?i("tr",{staticClass:"folder"},[i("td"),i("td",{staticClass:"border"},[i("md-icon",[t._v("folder")])],1),i("td"),i("td",[i("router-link",{staticClass:"italic",attrs:{title:"Parent folder",to:"../"}},[t._v("../")])],1),i("td",{attrs:{colspan:"4"}})]):t._e(),t._l(t.folders,(function(e){return i("tr",{key:e.id,staticClass:"folder"},[i("td"),i("td",{staticClass:"border"},[i("md-icon",[t._v("folder")])],1),i("td"),i("td",[i("router-link",{attrs:{to:e.slug+"/"}},[t._v("./"+t._s(e.title))])],1),i("td",{staticClass:"no-mobile"}),i("td",{staticClass:"right no-mobile pre",attrs:{title:e.created}},[t._v(t._s(t.$root.timeAgo(e.created)))]),i("td",{staticClass:"center no-tablet",attrs:{colspan:"2"}}),i("td",{staticClass:"menu"},[i("md-menu",[i("md-button",{staticClass:"md-icon-button md-primary",attrs:{"md-menu-trigger":""}},[i("md-icon",[t._v("more_vert")])],1),i("md-menu-content",{staticClass:"image-menu"},[i("md-menu-item",{on:{click:function(i){return t.doRenameChild(e.id)}}},[t._v("Rename folder")]),i("md-menu-item",{on:{click:function(i){return t.doMoveChild(e.id)}}},[t._v("Move folder")]),i("md-menu-item",{staticClass:"md-primary md-accent",attrs:{to:e.slug+"/delete"}},[t._v("Delete folder")]),t.isAdmin?i("md-menu-item",{on:{click:function(i){return t.setPassword(e.id)}}},[t._v("Set password")]):t._e()],1)],1)],1)])})),t._l(t.images,(function(t){return i("ImageRow",{key:t.id,ref:"images",refInFor:!0,attrs:{image:t}})}))],2)])]):i("div",{staticClass:"image-view"},[t._l(t.folders,(function(e){return i("div",{key:e.id,staticClass:"image-view-item"},[i("md-card",{staticClass:"project-card active tile"},[i("md-card-media",{staticClass:"md-layout md-ratio-16-9 tile-image-placeholder"},[i("router-link",{staticClass:"image-link image-container",attrs:{to:e.slug+"/"}},[i("md-icon",{staticClass:"folder"},[t._v("folder")])],1)],1),i("md-card-header",[i("md-card-header-text",[i("router-link",{attrs:{to:e.slug+"/"}},[i("p",{staticClass:"card-title"},[t._v("./"+t._s(e.title))])]),i("div",{staticClass:"card-subtitles"},[i("p",{staticClass:"card-subtitle"},[t._v("Created "+t._s(t.$root.timeAgo(e.created)))]),i("p",{staticClass:"card-subtitle"},[t._v(t._s(e.numberOfImages)+" image"+t._s(1==e.numberOfImages?"":"s"))])])],1)],1)],1)],1)})),t.loading?i("div",{staticClass:"micrio-loader"}):t._e(),t._l(t.images,(function(t){return i("div",{key:t.id,staticClass:"image-view-item"},[i("ImageCard",{ref:"images",refInFor:!0,attrs:{image:t}})],1)})),t.folder.zoneKey||t.$parent.limitReached||t.loading?t._e():i("div",{staticClass:"image-view-item"},[i("md-card",{staticClass:"image-view-add tile"},[i("md-card-media",{staticClass:"md-layout md-ratio-16-9"},[i("button",{staticClass:"image-view-icon-card-button",on:{click:function(){return t.selectFile(!1)}}},[i("md-icon",{staticClass:"icon"},[t._v("add")]),i("p",[t._v("Upload image")])],1)])],1)],1)],2),t.numImages>t.imagesPerPage&&!t.loading&&(t.listView&&t.images.length>15||!t.listView&&t.images.length>8)?i("Pagination",{attrs:{"num-per-page":t.imagesPerPage,offset:t.offset,total:t.numImages}}):t._e(),i("md-divider"),i("div",{staticClass:"project-info md-layout md-gutter"},[i("div",{staticClass:"md-layout-item md-size-15 md-small-size-30"},[i("h3",[t._v("Project size")]),i("p",[t._v(t._s(t.$root.getFileSize(t.project.fileSize)))])]),t.project.visitors||t.project.bandwidth?i("div",{staticClass:"md-layout-item md-size-15 md-small-size-30"},[i("h3",[t._v("Usage last 12 months")]),t.project.visitors?i("p",[t._v("Views: "+t._s(t.$root.getReadable(t.project.visitors))+" "),t.subscription&&t.subscription.maxVisitors>0&&!t.store.getters.isSharedLimit?i("span",[t._v(" / "+t._s(t.$root.getReadable(t.subscription.maxVisitors)))]):t._e()]):t._e(),t.project.bandwidth?i("p",[t._v("Bandwidth: "+t._s(t.$root.getFileSize(t.project.bandwidth)))]):t._e()]):t._e(),i("div",{staticClass:"md-layout-item md-size-15 md-small-size-30"},[i("h3",[t._v("Stats")]),t.images.length?i("p",[t._v("Images: "+t._s(t.images.length)),t.subscription&&t.subscription.maxImages>0&&!t.store.getters.isSharedLimit?i("span",[t._v(" / "+t._s(t.$root.getReadable(t.subscription.maxImages)))]):t._e()]):t._e(),i("p",[t._v("Created: "+t._s(t.project.created.split("T")[0]))])])])],i("div",{ref:"zone",class:"drop-zone "+(t.placedDropZone?"placed":"")},[i("md-empty-state",{staticClass:"drop here",attrs:{"md-icon":"add_photo_alternate","md-label":"Drop your image here"}})],1)],2):i("md-empty-state",{attrs:{"md-icon":"error","md-label":"Folder not found"}})},ys=[],ks=i(1524);const ws=!!window["_useDeepZoom"],Ss=navigator.userAgent.toLowerCase(),$s={};$s.webkit=/applewebkit/.test(Ss),$s.firefox=/firefox/.test(Ss)&&!/seamonkey/.test(Ss),$s.safari=/safari/.test(Ss)&&!/chrome/.test(Ss),$s.chrome=/chrome/.test(Ss)&&!/edge/.test(Ss)&&!/chromium/.test(Ss),$s.ie=/msie/.test(Ss)||/trident/.test(Ss)||/edge\//.test(Ss),$s.ielte11=$s.ie&&!/edge\//.test(Ss),$s.iemobile=/iemobile/.test(Ss),$s.iOS=/ipad|iphone|ipod/.test(Ss),$s.iOS10=/iphone os 10/.test(Ss),$s.iOS11=/iphone os 11/.test(Ss),$s.OSX=/macintosh/.test(Ss)&&/os x/.test(Ss),$s.OSX_13=/os x 10_13/.test(Ss),$s.android=/android/.test(Ss),$s.iPad=/ipad/.test(Ss),$s.mobile=$s.iOS||$s.android||$s.iemobile,$s.unknown=!$s.webkit&&!$s.firefox&&!$s.ie&&!$s.iOS&&!$s.android;class Is{constructor(t,e,i,s,a=!1,r=!1,o=!1){this.file=t,this.projectId=e,this.organisationId=i,this.image=s,this.isVideo=r,this.isDeepZoom=ws||o,this.data=null,this.title=t.name,this.isJpg="image/jpeg"==t.type,this.isPng="image/png"==t.type,this.doWebP=!!window._doWebP,this.isTransparentPng=a&&this.isPng,this.complete=null,this.error=null}async start(){return new Promise(((t,e)=>{this.complete=t,this.error=e,this.uploadFull()}))}progress(t){this.image.tilingProgress=100*t}setStatus(t){this.image.sourceImageStatus=t}async uploadFull(){let t={Title:this.title,IsPng:this.isTransparentPng,IsWebP:this.doWebP,TileSize:this.image.tileSize,MimeType:this.file.type,FolderId:this.projectId,IsBig:this.file.size>=1073741824,IsDeepZoom:this.isDeepZoom};this.organisationId&&(t["OrganisationId"]=this.organisationId);const e=await k("/api/micrio/startupload",t).catch((t=>this.error(t)));if(!e)return;this.image.id=e.id,this.setStatus("starting upload..");const i=M.state.organisation&&M.state.organisation.isAzure;if(i){const t=e.url.substr(e.url.indexOf(".net/")+5).split("/")[0],i=e.url.substr(0,e.url.indexOf(".net/"))+".net",s=e.url.substr(e.url.indexOf("?")),a=new ks.N(i+s),r=a.getContainerClient(t),o=`_originals/${e.id}/source-image`,n=r.getBlockBlobClient(o),d=this;await n.uploadBrowserData(this.file,{onProgress:t=>{const e=Math.round(t.loadedBytes/d.file.size*1e3)/10;this.setStatus(`uploading - ${e}%..`),this.progress(t.loadedBytes/d.file.size)}}),setTimeout((()=>this.uploadFullComplete(e)),4e3)}else{let t=new XMLHttpRequest;t.upload.addEventListener("progress",(t=>{this.setStatus("uploading.."),this.progress(t.loaded/t.total)})),t.addEventListener("error",(t=>this.error&&this.error(t))),t.addEventListener("abort",(t=>this.error&&this.error(t))),t.addEventListener("load",(()=>this.uploadFullComplete(e))),t.open("PUT",e.url,!0),t.send(this.file)}}uploadFullComplete(t){this.setStatus("finishing upload.."),k("/api/micrio/finishupload",{id:t.id}).catch((t=>this.error&&this.error(t))).then((()=>{this.setStatus("waiting for tiler.."),this.complete&&this.complete(t)}))}}class Cs{constructor(t){this.file=t,this.canvas=document.createElement("canvas"),this.ctx=this.canvas.getContext("2d"),this.video=null}process(){return new Promise(((t,e)=>{if("video/webm"!=this.file.type&&"video/mp4"!=this.file.type)return e("Please select a WebM or MP4 video file");let i=2;const s=URL.createObjectURL(this.file),a=this.video=document.createElement("video");a.oncanplay=()=>{i=Math.max(.5,Math.min(a.duration-.5,2)),a.currentTime!=i?a.currentTime=i:this.getImage(a).then(t)},a.onerror=()=>e("File error! Did you select a valid video file?"),a.src=s}))}getImage(t){return new Promise((e=>{this.canvas.width=t.videoWidth,this.canvas.height=t.videoHeight,this.ctx.drawImage(t,0,0,this.canvas.width,this.canvas.height),this.canvas.toBlob((t=>{t.name=this.file.name,e(t)}),"image/jpeg",70)}))}}var Ps=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"pages"},[i("md-button",{attrs:{to:t.getOffset(t.currentPage),disabled:!t.hasPrev}},[i("md-icon",[t._v("arrow_back")]),t._v(" previous page")],1),t._l(t.pages,(function(e,s){return i("md-button",{key:s,class:{"md-primary":e-1==t.currentPage,page:!0},attrs:{to:t.getOffset(e),disabled:"..."==e}},[t._v(t._s(e))])})),i("md-button",{attrs:{to:t.getOffset(t.currentPage+2),disabled:!t.hasNext}},[t._v("next page "),i("md-icon",[t._v("arrow_forward")])],1)],2)},xs=[],js={data(){return{}},props:{offset:{type:Number,default:0},numPerPage:{type:Number,default:5},total:{type:Number,default:0}},computed:{hasPrev(){return this.offset>0},hasNext(){return this.offset+this.numPerPage6){let i=[1,2,"...",t-1,t];return i.indexOf(e)<0&&(3==e?i.splice(2,0,e):(i.splice(3,0,e),e!=t-2&&i.splice(4,0,"..."))),i}return t}},methods:{getOffset(t){const e=(t-1)*this.numPerPage;return e?`@${e}`:"./"}}},Ts=js,Ms=(0,N.Z)(Ts,Ps,xs,!1,null,"a6fd2ec8",null),Ds=Ms.exports,As=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("tr",{class:t.deleting&&"deleting"},[this.parent.project.zoneKey?t._e():i("td",[t.isReady?i("input",{ref:"checkbox",attrs:{type:"checkbox"},on:{click:function(e){t.selected=!t.selected}}}):t._e()]),i("td",{ref:"media",staticClass:"image border",class:t.image.mapType>0&&"map-"+t.image.mapType},[t.isReady?t.mobile?i("a",{style:t.background,attrs:{href:""+t.publicLink,target:"_blank","data-id":t.image.shortId,title:"Public viewing link"}}):i("router-link",{style:t.background,attrs:{to:t.image.mapType?"#":"./edit/"+t.image.shortId+"/"+t.language,"data-id":t.image.shortId},nativeOn:{click:function(e){return t.checkMap(e)}}}):i("md-progress-bar",{attrs:{"md-mode":t.polling||t.deleting?"indeterminate":"determinate","md-value":t.image.tilingProgress}})],1),i("td",{staticClass:"status center",class:t.image.published&&"published"},[t.isReady?[i("a",{attrs:{href:""+t.publicLink,target:"_blank",title:"Public viewing link"}},[i("md-icon",[t._v("public")])],1),t.image.is360?i("md-icon",{attrs:{title:"Image is 360 degrees"}},[t._v("360")]):t._e()]:i("md-icon",[t._v("hourglass_empty")])],2),i("td",{staticClass:"pre title"},[t.isReady?[t.mobile?i("a",{attrs:{href:""+t.publicLink,target:"_blank",title:"Public viewing link"}},[t._v(t._s(t.image.title))]):i("router-link",{attrs:{title:"Edit this image",to:t.image.mapType?"#":"./edit/"+t.image.shortId+"/"+t.language},nativeOn:{click:function(e){return t.checkMap(e)}}},[t._v(t._s(t.image.title))])]:i("span",[t._v(t._s(t.image.title))]),t.isReady?t._e():i("div",{staticClass:"md-subhead"},[t._v(t._s(t.status)+" "+t._s(t.error))])],2),i("td",{staticClass:"pre right no-mobile"},[t.image.published?i("span",{attrs:{title:t.image.published}},[t._v(t._s(t.$root.timeAgo(t.image.published)))]):t._e()]),i("td",{staticClass:"pre right no-mobile"},[t.image.created?i("span",{attrs:{title:t.image.created}},[t._v(t._s(t.$root.timeAgo(t.image.created)))]):t._e()]),i("td",{staticClass:"pre right no-tablet"},[t.image.width&&t.image.height?i("span",{attrs:{title:t.mPixels}},[t._v(t._s(t.image.width)+" x "+t._s(t.image.height)+" px")]):t._e()]),i("td",{staticClass:"pre right no-tablet"},[t.image.fileSize&&!t.image.mapType?i("span",[t._v(t._s(t.$root.getFileSize(t.image.fileSize)))]):t._e()]),i("td",{staticClass:"menu"},[t.image.isSpace?t._e():i("md-menu",[i("md-button",{staticClass:"md-icon-button md-primary",attrs:{"md-menu-trigger":""}},[i("md-icon",[t._v("more_vert")])],1),i("md-menu-content",{staticClass:"image-menu"},[t.canUpgrade?i("md-menu-item",{on:{click:t.doUpgrade}},[t._v("Update version")]):t._e(),t.isReady?i("md-menu-item",{attrs:{disabled:t.settingPublished},on:{click:function(e){return t.togglePublished()}}},[t._v(t._s(t.image.published?"Set private":"Publish"))]):t._e(),t.parent.project.isActive&&t.isReady?i("md-menu-item",{on:{click:t.doRename}},[t._v("Rename")]):t._e(),t.isReady?i("md-menu-item",{attrs:{disabled:!t.canMove},on:{click:t.doMove}},[t._v("Move")]):t._e(),t.isReady?i("md-menu-item",{on:{click:t.clone}},[t._v("Clone")]):t._e(),t.canDelete?i("md-menu-item",{staticClass:"md-primary md-accent",on:{click:t.doRemove}},[t._v("Delete")]):t._e(),t.canDownloadOriginal?i("md-menu-item",{attrs:{target:"_blank",href:t.image.originalUri}},[t._v("Original")]):t._e(),t.canSetPassword?i("md-menu-item",{on:{click:t.setPassword}},[t._v("Set password")]):t._e(),t.canRetryTiling?i("md-menu-item",{on:{click:t.retryTiling}},[t._v("Retry tiling")]):t._e()],1)],1)],1)])},Os=[],Es={props:{image:{type:Object}},data(){return{parent:this.$parent,polling:!1,deleting:!1,error:null,isAdmin:M.state.isAdmin,isDevEnv:x,setting360:!1,settingPublished:!1,baseUrl:M.state.baseUrl,pollTimeout:null,selected:!1,b64thumb:null,currentVersion:"4.0"}},computed:{publicLink(){return`https://i.${x?"micrio.dev":"micr.io"}/${this.image.shortId}`},language(){return M.getters.currentCulture},background(){const t=this.getThumbSrc();return t&&!this.image.mapType>0?`background-image:url(${t})`:null},widthPx(){return this.image.width/this.image.height*240},newEditor(){let t=new Date(this.image.created),e=new Date("2018-09-14");return this.image.forceNewEditor||t>e},status(){const t=this.image.sourceImageStatus;for(let e in d)if(d[e]==t)return e;return t},isReady(){return this.image.sourceImageStatus==d.Ready},canUpgrade(){return this.canDelete&&(!this.image.version||this.image.version<4)},canDelete(){return this.isAdmin||M.state.organisation&&!M.state.organisation.isShared},canRetryTiling(){return this.canDelete&&this.image.hasOriginal&&(this.error||!this.isReady)},canMove(){const t=!M.state.organisation||M.state.subscriptions.findIndex((t=>t.id==this.projectId))>=0;return M.getters.isFreeOrg||!t||M.state.folders.filter((t=>t.projectId==this.parent.project.id)).length>=1},canDownloadOriginal(){return this.isAdmin&&"s"!=M.state.currentOrg&&this.image.originalUri},canSetPassword(){return this.isAdmin},mPixels(){let t=this.image.width*this.image.height/1e6;return t>1e3?(t/1e3).toFixed(1)+" GP":t.toFixed(1)+" MP"},publishStatus(){return this.image.published?"Image is public":M.state.organisation&&M.state.organisation.isShared?"Image viewable by your organisation only":"Image is private"},mobile(){return window.innerWidth<=560},rootUrl(){return this.image.mapType>0?location.pathname+"?v=2.9":"."}},watch:{selected(t){if(this.$refs.checkbox.checked=t,t)this.$parent.selected.push(this);else{const t=this.$parent.selected.findIndex((t=>t==this));t>=0&&this.$parent.selected.splice(t,1)}}},mounted(){this.image.sourceImageStatus==d.Error?this.error=this.image.errorMessage:this.image.clientStarted||this.image.sourceImageStatus==d.Ready||this.parent.getImages()},methods:{async toggle360(t){await this.set360(!t.is360)},async set360(t){this.setting360=!0,await b.set360(this.image.id,t),this.image.is360=t,this.setting360=!1},togglePublished(){this.$root.main.confirm("Do you want to "+(this.image.published?"de":"")+"publish this image?").then((async()=>{this.settingPublished=!0,await b.setPublished(this.image.id,!this.image.published),this.image.published=!this.image.published,this.settingPublished=!1}))},async publish(){this.image.published||(this.settingPublished=!0,await b.setPublished(this.image.id,!0),this.image.published=Date.now(),this.settingPublished=!1)},async depublish(){this.image.published&&(this.settingPublished=!0,await b.setPublished(this.image.id,!1),this.image.published=!1,this.settingPublished=!1)},async resetVersion(){await b.resetVersion(this.image.id)},checkPrint(){var t=this.$el.getBoundingClientRect();t.top0&&this.$refs.micrio.print()},doRemove(){this.$root.main.confirm("Do you want to delete this image?").then(this.removeConfirmed).catch((()=>null))},async removeConfirmed(t){this.selected=!1;let e=this.parent.images.findIndex((t=>t.id==this.image.id));e>=0?(clearTimeout(this.pollTimeout),this.deleting=!0,await b.deleteImage(this.image.id),this.parent.images.splice(e,1),this.parent.numImages--,this.parent.$parent.project.numberOfImages--,!0!==t&&this.$root.main.setMessage("Image succesfully deleted")):console.error("Could not find image index!")},doRename(){this.$root.main.prompt("Set the image title",this.image.title).then((async t=>{this.image.title=t,await b.renameImage(this.image.id,this.image.title)})).catch((()=>null))},doUpgrade(){this.$root.main.confirm("Update image version",`\n\t\t\t\tDo you want to upgrade this image${this.image.version?` (Micrio v${this.image.version})`:""} to the latest Micrio version (v${this.currentVersion})?\n\t\t\t\tSome custom JS/CSS might not keep working due to changed APIs. If there is no custom JS/CSS, you can upgrade safely. Are you sure?\n\t\t\t`).then((async()=>{console.log("clicked yes!");const t=this.image.sourceImageStatus;this.image.sourceImageStatus="Upgrading",await b.upgradeImage(this.image.id),this.image.version=this.currentVersion,this.$root.main.setMessage("Succesfully upgraded the image version!"),this.image.sourceImageStatus=t})).catch((()=>null))},async retryTiling(){await b.retryTiling(this.image.id),this.error=this.image.errorMessage=null,this.$root.main.setMessage("Retrying..."),this.polling=!0,this.image.sourceImageStatus="Retrying..",this.$parent.getImages()},async clone(){var t=await this.$root.main.confirm("Include data","Do you also want to copy all data (markers, tours, audio)?").then((()=>!0)).catch((()=>!1));const e=await b.cloneImage(this.image.id,this.parent.folder.id,t);e&&(e.sourceImageStatus=d.Ready,this.parent.images.unshift(e),this.$root.main.setMessage("Image cloned succesfully!"))},doMove(){this.$root.main.folder("Move image",this.parent.project.id,this.parent.folder.id).then((async t=>{if(!t||t==this.parent.folder.id)return;let e=this.parent.images.findIndex((t=>t.id==this.image.id)),i=await b.moveImage(this.image.id,t);this.image.folderId=i.folderId,this.image.projectId=i.projectId,this.parent.images.splice(e,1),this.parent.numImages--,this.parent.$parent.project.numberOfImages--,this.$root.main.setMessage("Image succesfully moved")})).catch((()=>null))},setPassword(){this.$root.main.prompt("Set the image password",this.image.password).then((async t=>{this.image.password=t,await b.setImagePassword(this.image.id,this.image.password),this.$root.main.setMessage("Succesfully "+(this.image.password?"set":"removed")+" password")})).catch((()=>null))},update(t){if(this.polling=!0,t.errorMessage)this.$root.main.setPopup("Error: "+t.errorMessage),this.polling=!1,this.error=t.errorMessage,this.image.sourceImageStatus=d.Error;else{let e=null;switch(t.sourceImageStatus){case d.Ready:return this.image.sourceImageStatus=t.sourceImageStatus,this.image.width=t.width,this.image.height=t.height,this.image.shortId=t.shortId,this.image.isPng=t.isPng,this.image.fileSize=t.fileSize,this.image.created=t.created,this.image.micrioVersion=t.micrioVersion,void(this.polling=!1);case d.Downloading:e="receiving image..";break;case d.TilingStarted:e="tiling image..";break;case d.Resizing:e="diving deeper..";break;case d.Storing:e="putting it online..";break}e&&(this.image.sourceImageStatus=e)}return this.polling},getThumbSrc(){if(!M.state.hasIIIF)return this.$root.main.thumbSrc(this.image,!0);const t=this.image.originalShortId||this.image.shortId,e=this.image.iiifManifest?this.image.iiifManifest.replace("/info.json",""):`${M.state.iiifUrl}${t}`;return`${e}/full/^100,/0/default.jpg`},checkMap(t){this.image.mapType>0&&(t.stopPropagation(),t.preventDefault(),this.$root.main.confirm("Bing Maps are unfortunately no longer supported in the editor"))}}},Ls=Es,Rs=(0,N.Z)(Ls,As,Os,!1,null,null,null),Ns=Rs.exports,Vs=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("md-card",{class:["tile",t.isDemo&&"demo",t.image.iiifManifest&&"iiif"]},[t.isReady?i("md-card-media",{staticClass:"tile-image md-ratio-16-9"},[i("router-link",{attrs:{to:t.image.mapType?"":"./edit/"+t.image.shortId+"/"+t.language,"data-id":t.image.shortId},nativeOn:{click:function(e){return t.checkMap(e)}}},[i("img",{staticClass:"md-image",attrs:{src:t.imgUrl}}),t.image.is360?i("md-icon",{staticClass:"icon-360",attrs:{title:"Image is 360 degrees"}},[t._v("360")]):t._e(),i("p",{class:{published:t.image.published,unpublished:!t.image.published}},[t._v(t._s(t.publishStatus))]),i("div",{staticClass:"edit-overlay"},[i("md-icon",{attrs:{title:"Edit"}},[t._v("edit")])],1)],1)],1):i("md-card-media",{staticClass:"tile-image tile-image-placeholder md-ratio-16-9"},[i("md-icon",[t._v("hourglass_empty")])],1),i("md-card-header",[i("md-card-header-text",[t.isReady?i("router-link",{attrs:{to:t.image.mapType?"#":"./edit/"+t.image.shortId+"/"+t.language,"data-id":t.image.shortId},nativeOn:{click:function(e){return t.checkMap(e)}}},[i("p",{staticClass:"card-title",attrs:{title:t.image.title}},[t._v(t._s(t.image.title))])]):i("p",{staticClass:"card-title"},[t._v(t._s(t.image.title))]),t.isReady?t._e():i("md-progress-bar",{attrs:{"md-mode":t.polling||t.deleting||t.uploadingVideo?"indeterminate":"determinate","md-value":t.image.tilingProgress}}),i("div",{staticClass:"card-subtitles"},[t.isReady?i("p",{staticClass:"card-subtitle"},[t._v(t._s(t.image.published?"Last published":"Created")+" "+t._s(t.$root.timeAgo(t.image.published||t.image.created)))]):t._e(),t.isReady?i("p",{staticClass:"card-subtitle"},[t._v(t._s(t.image.width)+" x "+t._s(t.image.height)+" px - "+t._s(t.$root.getFileSize(t.image.fileSize)))]):i("p",{staticClass:"card-subtitle"},[t._v(" "+t._s(t.status)+" "+t._s(t.error)+" ")])])],1),i("md-menu",[i("md-button",{staticClass:"md-icon-button md-primary",attrs:{"md-menu-trigger":""}},[i("md-icon",[t._v("more_vert")])],1),t.image.isSpace?i("md-menu-content",[t.isReady&&t.image.published?i("md-menu-item",[i("span",[t._v("Id: "),i("b",[t._v(t._s(t.image.shortId))])])]):t._e(),t.isReady&&t.image.published?i("md-menu-item",[i("a",{attrs:{href:t.publicLink,target:"_blank"}},[t._v("Public viewing link")])]):t._e()],1):i("md-menu-content",[t.isReady&&t.image.published?i("md-menu-item",[i("span",[t._v("Id: "),i("b",[t._v(t._s(t.image.shortId))])])]):t._e(),t.isReady&&t.image.published?i("md-menu-item",[i("a",{attrs:{href:t.publicLink,target:"_blank"}},[t._v("Public viewing link")])]):t._e(),t.canUpgrade?i("md-menu-item",{on:{click:t.doUpgrade}},[t._v("Update version")]):t._e(),t.isReady?i("md-menu-item",{attrs:{disabled:t.settingPublished},on:{click:function(e){return t.togglePublished()}}},[t._v(t._s(t.image.published?"Set private":"Publish"))]):t._e(),t.parent.project.isActive&&t.isReady?i("md-menu-item",{on:{click:t.doRename}},[t._v("Rename")]):t._e(),t.isReady?i("md-menu-item",{attrs:{disabled:!t.canMove},on:{click:t.doMove}},[t._v("Move")]):t._e(),t.isReady?i("md-menu-item",{on:{click:t.clone}},[t._v("Clone")]):t._e(),t.canDelete?i("md-menu-item",{staticClass:"md-primary md-accent",on:{click:t.doRemove}},[t._v("Delete")]):t._e(),t.canDownloadOriginal?i("md-menu-item",{attrs:{target:"_blank",href:t.image.originalUri}},[t._v("Original")]):t._e(),t.canSetPassword?i("md-menu-item",{on:{click:t.setPassword}},[t._v("Set password")]):t._e(),t.canRetryTiling?i("md-menu-item",{on:{click:t.retryTiling}},[t._v("Retry tiling")]):t._e()],1)],1)],1)],1)},Us=[],zs={props:{image:{type:Object}},data(){return{parent:this.$parent,polling:!1,uploadingVideo:!1,deleting:!1,error:null,isAdmin:M.state.isAdmin,isDevEnv:x,setting360:!1,settingPublished:!1,baseUrl:M.state.baseUrl,pollTimeout:null,b64thumb:null,currentVersion:"4.1"}},computed:{publicLink(){return"https://i."+(x?"micrio.dev":"micr.io")+"/"+this.image.shortId},language(){return M.getters.currentCulture},imgUrl(){const t=this.getThumbSrc();return this.image.mapType>0?"https://static.micr.io/home/img/editor/maptypes/1.png":t},status(){if(this.uploadingVideo)return"Uploading video...";const t=this.image.sourceImageStatus;for(let e in d)if(d[e]==t)return e;return t},isDemo(){return P.indexOf(this.image.shortId)>=0||P.indexOf(this.image.originalShortId)>=0},isReady(){return this.image.sourceImageStatus==d.Ready&&!this.uploadingVideo},canUpgrade(){return this.canDelete&&(!this.image.version||this.image.version<4)},canDelete(){return this.isAdmin||M.state.organisation&&!M.state.organisation.isShared},canRetryTiling(){return this.canDelete&&this.image.hasOriginal&&(this.error||!this.isReady)},canMove(){const t=!M.state.organisation||M.state.subscriptions.findIndex((t=>t.id==this.projectId))>=0;return M.getters.isFreeOrg||!t||M.state.folders.filter((t=>t.projectId==this.parent.project.id)).length>=1},canDownloadOriginal(){return this.isAdmin&&"s"!=M.state.currentOrg&&this.image.originalUri},canSetPassword(){return this.isAdmin},publishStatus(){return this.image.published?"PUBLISHED":M.state.organisation&&M.state.organisation.isShared?"Published only for organization":"UNPUBLISHED"}},mounted(){this.image.sourceImageStatus==d.Error?this.error=this.image.errorMessage:this.image.clientStarted||this.image.sourceImageStatus==d.Ready||this.parent.getImages()},methods:{togglePublished(){this.$root.main.confirm("Do you want to "+(this.image.published?"de":"")+"publish this image?").then((async()=>{this.settingPublished=!0,await b.setPublished(this.image.id,!this.image.published),this.image.published=!this.image.published,this.settingPublished=!1}))},async publish(){this.image.published||(this.settingPublished=!0,await b.setPublished(this.image.id,!0),this.image.published=Date.now(),this.settingPublished=!1)},async depublish(){this.image.published&&(this.settingPublished=!0,await b.setPublished(this.image.id,!1),this.image.published=!1,this.settingPublished=!1)},async resetVersion(){await b.resetVersion(this.image.id)},doRemove(){this.$root.main.confirm("Do you want to delete this image?").then(this.removeConfirmed).catch((()=>null))},async removeConfirmed(t){let e=this.parent.images.findIndex((t=>t.id==this.image.id));e>=0?(clearTimeout(this.pollTimeout),this.deleting=!0,await b.deleteImage(this.image.id),this.parent.images.splice(e,1),this.parent.numImages--,this.parent.$parent.project.numberOfImages--,!0!==t&&this.$root.main.setMessage("Image succesfully deleted")):console.error("Could not find image index!")},doRename(){this.$root.main.prompt("Set the image title",this.image.title).then((async t=>{this.image.title=t,await b.renameImage(this.image.id,this.image.title)})).catch((()=>null))},doUpgrade(){this.$root.main.confirm("Update image version",`\n\t\t\t\tDo you want to upgrade this image${this.image.version?` (Micrio v${this.image.version})`:""} to the latest Micrio version (v${this.currentVersion})?\n\t\t\t\tSome custom JS/CSS might not keep working due to changed APIs. If there is no custom JS/CSS, you can upgrade safely. Are you sure?\n\t\t\t\t\t`).then((async()=>{console.log("clicked yes!");const t=this.image.sourceImageStatus;this.image.sourceImageStatus="Upgrading",await b.upgradeImage(this.image.id),this.image.version=this.currentVersion,this.$root.main.setMessage("Succesfully upgraded the image version!"),this.image.sourceImageStatus=t})).catch((()=>null))},async retryTiling(){await b.retryTiling(this.image.id),this.error=this.image.errorMessage=null,this.$root.main.setMessage("Retrying..."),this.polling=!0,this.image.sourceImageStatus="Retrying..",this.$parent.getImages()},async clone(){var t=await this.$root.main.confirm("Include data","Do you also want to copy all data (markers, tours, audio)?").then((()=>!0)).catch((()=>!1));const e=await b.cloneImage(this.image.id,this.parent.folder.id,t);e&&(e.sourceImageStatus=d.Ready,this.parent.images.unshift(e),this.$root.main.setMessage("Image cloned succesfully!"))},doMove(){this.$root.main.folder("Move image",this.parent.project.id,this.parent.folder.id).then((async t=>{if(!t||t==this.parent.folder.id)return;let e=this.parent.images.findIndex((t=>t.id==this.image.id)),i=await b.moveImage(this.image.id,t);this.image.folderId=i.folderId,this.image.projectId=i.projectId,this.parent.images.splice(e,1),this.parent.numImages--,this.parent.$parent.project.numberOfImages--,this.$root.main.setMessage("Image succesfully moved")})).catch((()=>null))},setPassword(){this.$root.main.prompt("Set the image password",this.image.password).then((async t=>{this.image.password=t,await b.setImagePassword(this.image.id,this.image.password),this.$root.main.setMessage("Succesfully "+(this.image.password?"set":"removed")+" password")})).catch((()=>null))},update(t){if(this.polling=!0,t.errorMessage)this.$root.main.setPopup("Error: "+t.errorMessage),this.polling=!1,this.error=t.errorMessage,this.image.sourceImageStatus=d.Error;else{let e=null;switch(t.sourceImageStatus){case d.Ready:return this.image.sourceImageStatus=t.sourceImageStatus,this.image.width=t.width,this.image.height=t.height,this.image.shortId=t.shortId,this.image.isPng=t.isPng,this.image.fileSize=t.fileSize,this.image.created=t.created,this.image.micrioVersion=t.micrioVersion,void(this.polling=!1);case d.Downloading:e="receiving image..";break;case d.TilingStarted:e="tiling image..";break;case d.Resizing:e="diving deeper..";break;case d.Storing:e="putting it online..";break}e&&(this.image.sourceImageStatus=e)}return this.polling},getThumbSrc(){if(!M.state.hasIIIF)return this.$root.main.thumbSrc(this.image);const t=this.image.originalShortId||this.image.shortId,e=this.image.height>this.image.width?"^400,":"^!400,200",i=this.image.iiifManifest?this.image.iiifManifest.replace("/info.json",""):`${M.state.iiifUrl}${t}`;return`${i}/full/${e}/0/default.jpg`},checkMap(t){this.image.mapType>0&&(t.stopPropagation(),t.preventDefault(),this.$root.main.confirm("Bing Maps are unfortunately no longer supported in the editor"))}}},Fs=zs,Js=(0,N.Z)(Fs,Vs,Us,!1,null,null,null),Bs=Js.exports,Zs={components:{ImageRow:Ns,Pagination:Ds,ImageCard:Bs},data(){return{store:M,loading:!0,images:[],numImages:0,placedDropZone:!1,project:M.state.projects.find((t=>t.slug==this.$route.params.project)),imagesPerPage:50,doAsTransparent:!1,selected:[],selectingVideo:!1,isPolling:!1,pollTimeout:null,listView:!1,sorting:"Date",acceptedTypes:["image/bmp","image/jpg","image/jpeg","image/png","image/tif","image/tiff",".tif",".psd",".psb",".raw"].join(","),acceptedVideoTypes:["video/mp4","video/webm"].join(",")}},mounted(){this._over=this.over.bind(this),this._out=this.out.bind(this),this._drop=this.drop.bind(this),window.addEventListener("dragover",this._over),document.title=this.folder.title+" - "+(M.state.organisation?M.state.organisation.name+" - ":"")+"Micrio Dashboard",this.getImages();const t=localStorage.getItem("listView");t?this.listView="true"===localStorage.getItem("listView"):localStorage.setItem("listView","false")},watch:{offset(){this.getImages()}},beforeDestroy(){clearTimeout(this.pollTimeout),window.removeEventListener("dragover",this._over),document.title=(M.state.organisation?M.state.organisation.name+" - ":"")+"Micrio Dashboard",this.out()},computed:{subscription(){return M.getters.subscriptionOrg},offset(){const t=this.$route.params.offset;return t&&Number(t.substr(1))||0},imagesThisPage(){return this.images.slice(this.offset,this.offset+this.imagesPerPage)},folder(){if(this.path.length){let t=this.project.id,e=M.state.folders,i=!1;for(let s=0;se.parentId==t&&e.slug==this.path[s]));if(!a)break;t=a.id,i=s==this.path.length-1}return i?e.find((e=>e.id==t)):null}return this.project},folders(){return M.state.folders.filter((t=>t.parentId==this.folder.id))},path(){return this.$route.path.replace(/\/[^/]*$/,"").split("/").slice(4)},isAdmin(){return M.state.isAdmin},publicUrl(){return x?"https://g.micrio.dev/"+this.folder.shortId:"https://g.micr.io/"+this.folder.shortId}},methods:{selectAll(){const t=this.selected.length&&this.selected.lengthe.selected=t))},async setSort(t){t!=this.sorting&&(this.images=[],this.sorting=t,await b.setFolderSorting(this.folder.id,this.sorting),this.getImages())},doCreateFolder(){this.$root.main.prompt("Set a title..").then((t=>{if(!t)return this.$root.main.setPopup("Please enter a title");b.createFolder(t,this.folder.id).then((t=>{M.state.folders.push(t),this.$router.push(t.slug+"/")})).catch((t=>{this.$root.main.setPopup(String(t))}))})).catch((()=>null))},getImages(){if(this.isPolling)return;if(this.busy)return;const t=!this.images.length||this.prevOffset!=this.offset;t&&(this.loading=!0,this.images.length=0),this.busy=!0,b.getImages(this.folder.id,this.offset,this.imagesPerPage).then((e=>{let i=!1;if(this.sorting!=e.sorting&&(this.sorting=e.sortOrder),t)this.images=e.images;else for(let t=0;ti.image.id==e.images[t].id&&i.image.sourceImageStatus!=d.Ready));if(s){const a=s.update(e.images[t]);i||(i=a)}}this.numImages=e.totalImages,this.loading=!1,this.prevOffset=this.offset,this.isPolling=i,i&&(clearTimeout(this.pollTimeout),this.pollTimeout=setTimeout((()=>{this.isPolling=!1,this.getImages()}),2e3)),this.busy=!1})).catch((t=>{this.$root.main.setPopup(String(t))}))},doRename(){this.$root.main.prompt("Set a title..",this.folder.title).then((async t=>{if(!t)return this.$root.main.setPopup("Please enter a title");let e=await b.renameFolder(this.folder.id,t);this.folder.title=e.title,this.folder.slug=e.slug,this.$root.main.setMessage("Folder succesfully renamed"),this.$router.push("../"+e.slug+"/")})).catch((()=>null))},doRenameChild(t){let e=this.folders.find((e=>e.id==t));this.$root.main.prompt("Set a title..",e.title).then((async t=>{if(!t)return this.$root.main.setPopup("Please enter a title");await b.renameFolder(e.id,t),this.$root.main.setMessage("Folder succesfully renamed")})).catch((()=>null))},doMove(){this.$root.main.folder("Select folder or project to move to..",this.project.id,this.folder.parentId,!0,this.folder.id).then((async t=>{if(!t)return;let e=await b.moveFolder(this.folder.id,t);this.folder.projectId=e.projectId,this.folder.parentId=e.parentId,this.$router.push("/"+M.state.currentOrg+"/projects/"+b.getFullPath(t)+"/"+e.slug+"/"),this.$root.main.setMessage("Folder succesfully moved")})).catch((()=>null))},doMoveChild(t){let e=this.folders.find((e=>e.id==t));this.$root.main.folder("Select folder or project to move to..",this.project.id,e.parentId,!0,e.id).then((async t=>{t&&(await b.moveFolder(e.id,t),this.$root.main.setMessage("Folder succesfully moved"))})).catch((()=>null))},selectFile(t=!1){this.doAsTransparent=!0,this.selectingVideo=t,this.$nextTick((()=>this.$refs.file.click()))},async fileSelected(){if(!this.$refs.file.files[0])return;const t=this.$refs.file.files.length;this.selectingVideo||1!=t||"image/png"!=this.$refs.file.files[0].type||(this.doAsTransparent=await this.decideFileTransparency()),this.createImagesVideo(this.$refs.file.files)},async createImagesVideo(t){if(t&&t.length)for(let e=0;e{this.$root.main.setMessage(t),console.error("Video processing error!",t)})):await this.createImage(t[e],e+1,t.length)},createVideo(t,e,i){return new Promise(((s,a)=>{const r=new Cs(t);r.process().catch(a).then((async o=>{const n=await this.createImage(o,e,i,!0,!0);if(!n)return a("Could not create preview image");const l=this.images[0];l.tilingProgress=10,l.fileSize+=t.size;const c=await b.getImage(n.shortId);if(!c)return a("Could not get image data settings");const m=c.settings,u=this.$refs.images[this.$refs.images.length-1];u.uploadingVideo=!0,l.tilingProgress=20;const h={micrioId:n.id,title:t.name,fileName:t.name,fileSize:t.size,mimeType:t.type,type:"video",created:Date.now(),tags:null,duration:r.video.duration,width:r.video.videoWidth,height:r.video.videoHeight},p=await b.uploadFile(h,t),g=t.name.replace(/^.*\.([^.]+)$/i,"$1");h.id=p,h.fileUrl="https:"+M.state.baseUrl+n.shortId+"/assets/"+p+"."+g,l.tilingProgress=90,m._360.video.video=h,await b.setSettings(n.id,m),l.tilingProgress=100,l.sourceImageStatus=d.Ready,u.uploadingVideo=!1,s(!0)}))}))},async createImage(t,e,i,s=!1,a=!1){const r={id:null,title:t.name,tilingProgress:0,sourceImageStatus:"reading file..",clientStarted:!0,is360:s,published:(new Date).toString(),tileSize:1024};this.images.unshift(r),this.numImages++,this.$parent.project.numberOfImages++;const o=M.state.organisation&&M.state.organisation.isAmazon,n=new Is(t,this.folder.id,M.state.currentOrgId,r,this.doAsTransparent,a,o);return new Promise((t=>{n.start().catch((s=>{this.$root.main.setPopup(String(s)),console.error("Tiling error!",s),this.images.splice(0,1),this.numImages--,this.$parent.project.numberOfImages--,e==i&&(this.$refs.file.value=""),t()})).then((s=>{if(s){if(e==i&&(this.$refs.file.value=""),s.sourceImageStatus!=d.Ready){let t=this.$refs.images.find((t=>t.image.id==s.id));t?this.getImages():console.warn("Image not found?")}t(s)}}))}))},decideFileTransparency(){return new Promise((t=>{this.$root.main.confirm("Tile as transparent PNG?","You have selected a PNG file to be uploaded. Do you want this to be a transparent Micrio image?

Note: the download size will be bigger.","Use PNG","Use JPEG").then((()=>{t(!0)})).catch((()=>{t(!1)}))}))},createImageFromIIIFSource(){const t=prompt("Enter the IIIF manifest JSON URL");t&&fetch(t).then((t=>t.json())).then((e=>{let i=e.width,s=e.height;if(e.sequences&&e.sequences.length){const t=e.sequences[0],a="top-to-bottom"==t.viewingDirection,r=t.canvases.map((t=>t.images[0])).map((t=>t.resource));i=a?Math.max(...r.map((t=>t.width))):r.reduce(((t,e)=>t+e.width),0),s=a?r.reduce(((t,e)=>t+e.height),0):Math.max(...r.map((t=>t.height)))}i&&s?b.createImageFromIIIF(t,e.title||e.label||t,i,s,this.folder.id,M.state.currentOrgId).then((t=>{this.images.unshift(t),this.numImages++,this.$parent.project.numberOfImages++,this.$root.main.setMessage("IIIF image succesfully added!")})).catch((t=>{alert("Something went wrong. Check the console."),console.log(t)})):alert("Invalid manifest.")})).catch((()=>alert("The IIIF manifest cannot be downloaded. Is it correct?")))},depublishAll(){this.$root.main.confirm("Do you want to depublish all selected images?").then((async()=>{this.selected.forEach((async t=>await t.depublish())),this.$root.main.setMessage("Images succesfully depublished")}))},publishAll(){this.$root.main.confirm("Do you want to publish all selected images?").then((async()=>{this.selected.forEach((async t=>await t.publish())),this.$root.main.setMessage("Images succesfully published")}))},resetAllVersions(){this.$root.main.confirm("Do you want to set the image Micrio viewer versions to the newest version?").then((async()=>{await Promise.all(this.selected.map((t=>t.resetVersion()))),this.$root.main.setMessage("Images succesfully set to latest Micrio versions!")}))},deleteAll(){this.$root.main.confirm("Do you want to delete all selected images?").then((async()=>{this.selected.forEach((async t=>await t.removeConfirmed(!0))),this.$root.main.setMessage("Images succesfully deleted")}))},setAll360(t){const e=t?"set":"unset";this.$root.main.confirm("Do you want to "+e+" all selected images as 360 images?").then((async()=>{this.selected.forEach((async e=>await e.set360(t))),this.$root.main.setMessage("Images succesfully "+e+" as 360")}))},setPassword(t){let e=this.folder.id==t?this.folder:this.folders.find((e=>e.id==t));e&&this.$root.main.prompt("Set the folder password",this.folder.password).then((async i=>{e.password=i,await b.setFolderPassword(t,i),this.$root.main.setMessage("Succesfully "+(i?"set":"removed")+" password")})).catch((()=>null))},over(t){t.stopPropagation(),t.preventDefault();let e=!1;for(let i=0;i{this.images.unshift(t),this.numImages++,this.$parent.project.numberOfImages++,this.$root.main.setMessage("New image succesfully added!")})).catch((t=>{alert("Something went wrong. Check the console."),console.log(t)}))}}},Ys=Zs,Ws=(0,N.Z)(Ys,_s,ys,!1,null,null,null),Gs=Ws.exports,Xs={components:{Folder:Gs},data(){return{slug:this.$route.params.project,project:M.state.projects.find((t=>t.slug==this.$route.params.project)),loading:!0,state:M.state}},computed:{key(){return this.$route.params[0]||this.$route.params.project+"/"+this.$route.params.folder},limitReached(){if(!M.state.loaded)return!1;const t=this.project.subscription||M.state.subscriptions.find((t=>t.id==this.project.subscriptionOrgId));return M.getters.isLimitReached||t&&t.maxImages>0&&this.project.images>=t.maxImages}}},qs=Xs,Ks=(0,N.Z)(qs,fs,bs,!1,null,null,null),Hs=Ks.exports,Qs=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("form",{staticClass:"md-layout",attrs:{novalidate:""},on:{submit:function(e){return e.stopPropagation(),e.preventDefault(),t.submit(e)}}},[i("md-card",{staticClass:"md-layout-item md-size-50 md-small-size-100"},[i("md-card-header",[i("div",{staticClass:"md-title"},[t._v(t._s(t.project.id?t.project.isTrial?"Activate your trial project":"Upgrade your project":"Create a new project"))])]),t.canPay?i("md-card-content",[t.noChoiceInSubscription()?t._e():i("div",[i("h3",[t._v("1. Set your project name")]),i("p",[t._v("You can always change this later.")])]),i("md-field",[i("label",{attrs:{for:"title"}},[t._v("Project Name")]),i("md-input",{attrs:{type:"text",name:"title",id:"title",disabled:t.sending},model:{value:t.project.title,callback:function(e){t.$set(t.project,"title",e)},expression:"project.title"}}),i("span",{staticClass:"md-error"},[t._v("A title is required")])],1),t.hasSpaces?i("div",[i("md-checkbox",{attrs:{disabled:t.sending},model:{value:t.project.isSpaces,callback:function(e){t.$set(t.project,"isSpaces",e)},expression:"project.isSpaces"}},[t._v(" This is a 360 Spaces project (Closed beta, but you're part of it!) ")])],1):t.noChoiceInSubscription()?t._e():i("div",[i("h3",[t._v("2. Choose your project type")]),i("p",[t._v(" For more information about each type and which features they provide, check out our "),i("a",{attrs:{href:"/plans-and-pricing",target:"_blank"}},[t._v("Plans and Pricing")]),t._v(" page. ")]),i("p",[t._v("Do you need a larger plan, have very large image collections, need shared organisation accounts, or a server API for automatically transferring images from your existing platform? Please "),i("router-link",{attrs:{to:"./quote"}},[t._v("contact us")]),t._v("! ")],1),i("SelectSubscription",{attrs:{project:t.project,sending:t.sending},on:{change:function(e){return t.subscriptionOrgId=e}}}),t.store.state.user.isStripeCustomer?i("md-content",[t._v(" When you click "),i("b",[t._v("Create project")]),t._v(", we will create your project and will take you to the payment screen. ")]):i("md-content",[t._v(" In the next step, we will ask you to provide your payment details. ")])],1)],1):i("md-card-content",[i("h3",[t._v("Please contact us")]),i("p",[t._v(" If you are interested in a Micrio subscription, please send us a mail at "),i("a",{attrs:{href:"mailto:support@micr.io"}},[t._v("support@micr.io")]),t._v(". Thank you! ")])]),t.sending?i("md-progress-bar",{attrs:{"md-mode":"indeterminate"}}):t._e(),i("md-card-actions",[i("md-button",{staticClass:"md-secondary",attrs:{to:"./",disabled:t.sending}},[t._v("Cancel")]),t.canPay?i("md-button",{staticClass:"md-primary md-raised",attrs:{type:"submit",disabled:!t.valid||t.sending}},[t._v(t._s(t.store.getters.isFreeOrg?"Create project":t.store.state.user.isStripeCustomer?"Next: confirm payment":"Next: payment details"))]):t._e()],1)],1)],1)},ta=[],ea=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"select-subscription"},[i("md-field",{staticClass:"select-type",class:t.getValidationClass("subscriptionOrgId")},[i("table",[i("thead",[i("tr",[i("th",{staticClass:"name"},[t._v("Project ype")]),i("th",[t._v("Uploads")])])]),i("tbody",t._l(t.mainSubs,(function(e,s){return i("tr",{key:s,class:t.currentMaxImages==e.maxImages?"selected":null,on:{click:function(i){t.currentMaxImages=e.maxImages,t.subscriptionOrgId=t.initialSubOrgId}}},[i("td",{staticClass:"name"},[i("md-radio",{attrs:{value:e.maxImages,disabled:t.sending},model:{value:t.currentMaxImages,callback:function(e){t.currentMaxImages=e},expression:"currentMaxImages"}},[t._v(t._s(e.name))])],1),i("td",[t._v(t._s(t.$root.getReadable(e.maxImages)))])])})),0)])]),i("md-field",{staticClass:"monthly-yearly-container",class:t.currentMaxImages?null:"disabled"},[t.isEnterprise?i("div",[i("h3",[t._v("Please contact us for this subscription")]),i("p",[t._v(" If you are interested in a high volume account, please send us a mail at "),i("a",{attrs:{href:"mailto:support@micr.io"}},[t._v("support@micr.io")]),t._v(". Thank you! ")])]):[t.isPremium?i("div",[i("h3",[t._v("3. Custom invoicing available!")]),i("p",[t._v("Premium subscriptions allow you to have custom invoicing instead of payment using creditcard. Please "),i("a",{attrs:{href:"mailto:support@micr.io"}},[t._v("mail us at support@micr.io")]),t._v(" to set this up, instead of adding your creditcard in here.")])]):t._e(),i("h3",[t._v(t._s(t.isPremium?"Otherwise, pick":"3. Pick")+" your payment plan")]),t.currentMaxImages?i("div",{staticClass:"monthly-yearly"},t._l(t.getSelectedSub(),(function(e,s){return i("div",{key:s,class:t.subscriptionOrgId==e.id?"selected":null,on:{click:function(i){t.subscriptionOrgId=e.id}}},[i("h3",[t._v("Per "+t._s(e.paymentInterval))]),i("h2",{staticClass:"amount"},[t._v("€ "+t._s((e.monthlyAmount/100/("year"==e.paymentInterval?12:1)).toFixed(0)))]),i("div",[t._v("("),i("b",[t._v("€ "+t._s(t.$root.getReadable((e.monthlyAmount/100).toFixed(0))))]),t._v(" billed "+t._s(e.paymentInterval)+"ly)")])])})),0):i("div",{staticClass:"monthly-yearly"},[i("div",[i("h3",[t._v("Per year")]),i("h2",{staticClass:"amount"},[t._v("€ -")])]),i("div",[i("h3",[t._v("Per month")]),i("h2",{staticClass:"amount"},[t._v("€ -")])])])]],2)],1)},ia=[],sa={props:{project:Object,sending:Boolean},data:function(){return{currentMaxImages:null,subscriptionOrgId:null,initialSubOrgId:null,valid:{subscriptionOrgId:!0}}},created(){var t=M.state.subscriptions.find((t=>t.id==this.project.subscriptionOrgId&&!t.cannotCreateNew));t&&(this.currentMaxImages=t.maxImages,this.initialSubOrgId=t.id,this.subscriptionOrgId=t.id)},watch:{subscriptionOrgId(){this.$emit("change",this.subscriptionOrgId)}},computed:{isEnterprise(){const t=this.getSelectedSub();return t.length&&(/enterprise/i.test(t[0].name)||/premium/i.test(t[0].name))},isPremium(){const t=this.getSelectedSub();return t.length&&/premium/i.test(t[0].name)},mainSubs(){if(M.getters.isFreeOrg)return[];var t=M.state.subscriptions.filter((t=>t.isSubscription));return t.map((t=>t.maxImages)).filter(((t,e,i)=>t&&i.indexOf(t)==e)).sort(((t,e)=>t>e?1:tt.find((t=>t.maxImages==e&&!t.cannotCreateNew&&"year"==t.paymentInterval))))}},methods:{getValidationClass(t){return{"md-invalid":!this.valid[t]}},getSelectedSub(){return M.state.subscriptions.filter((t=>t.isSubscription&&!t.cannotCreateNew&&t.maxImages==this.currentMaxImages))}}},aa=sa,ra=(0,N.Z)(aa,ea,ia,!1,null,null,null),oa=ra.exports,na={components:{SelectSubscription:oa},props:{justSelectSubscription:Boolean,project:{type:Object,default:function(){return{title:"",isSpaces:!1,subscriptionOrgId:M.getters.isFreeOrg&&M.state.organisation.id}}}},data(){return{store:M,saved:!1,sending:!1,currentMaxImages:0,subscriptionOrgId:M.getters.isFreeOrg&&M.state.organisation.id}},computed:{mainSubs(){if(M.getters.isFreeOrg)return[];var t=M.state.subscriptions;return t.map((t=>t.maxImages)).filter(((t,e,i)=>t&&i.indexOf(t)==e)).sort(((t,e)=>t>e?1:tt.find((t=>t.maxImages==e&&!t.cannotCreateNew&&"year"==t.paymentInterval))))},valid(){return this.subscriptionOrgId&&this.project.title},hasSpaces(){return M.state.organisation&&M.state.organisation.hasSpaces},canPay(){return!!M.state.organisation||M.state.user.allowedPayment}},methods:{noChoiceInSubscription(){return M.state.organisation&&!M.state.organisation.isAdmin||M.getters.isFreeOrg},submit(){this.valid&&(this.project.isSetup=!0,this.justSelectSubscription&&!M.getters.isFreeOrg?(this.project.subscriptionOrgId=this.subscriptionOrgId,this.project.trialDaysLeft=0):(this.sending=!0,b.addProject(this.project.title,this.project.description,this.subscriptionOrgId,this.project.isSpaces).then((t=>{this.saved=!0,this.sending=!1,this.project.subscriptionOrgId=t.subscriptionOrgId,this.$root.main.setMessage("New project succesfully created!",t),M.getters.isFreeOrg?this.$router.push("./"+t.slug+"/"):this.$router.push("./"+t.slug+"/activate")}))))}}},da=na,la=(0,N.Z)(da,Qs,ta,!1,null,null,null),ca=la.exports,ma=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("form",{staticClass:"md-layout",attrs:{novalidate:""},on:{submit:function(e){return e.stopPropagation(),e.preventDefault(),t.submit(e)}}},[i("md-card",{staticClass:"md-layout-item md-size-50 md-small-size-100"},[i("md-card-header",[i("div",{staticClass:"md-title"},[t._v("Delete project")])]),i("md-card-content",[i("p",[t._v("If you delete a project, its images will be "),i("b",[t._v("permanently removed")]),t._v(". There is no undo for this.")]),t.sending?i("p",[t._v("Deleting a project containing images could take some time, please wait...")]):t._e()]),t.sending?i("md-progress-bar",{attrs:{"md-mode":"indeterminate"}}):t._e(),i("md-card-actions",[i("md-button",{staticClass:"md-secondary",attrs:{to:"../",disabled:t.sending}},[t._v("Cancel")]),i("md-button",{staticClass:"md-accent md-active md-raised md-delete",attrs:{type:"submit",disabled:t.sending}},[t._v("Delete project")])],1)],1)],1)},ua=[],ha={data(){return{saved:!1,sending:!1,error:null,project:M.state.projects.find((t=>t.slug==this.$route.params.project))}},methods:{submit(){this.sending=!0,b.deleteProject(this.project.id).then((()=>{this.$root.main.setMessage("Project succesfully deleted!"),this.$router.push("../")})).catch((t=>{this.error=String(t),this.sending=!1,this.$root.main.setPopup(this.error),this.$router.push("../")}))}}},pa=ha,ga=(0,N.Z)(pa,ma,ua,!1,null,"299c0b12",null),va=ga.exports,fa=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("form",{staticClass:"md-layout",attrs:{novalidate:""},on:{submit:function(e){return e.stopPropagation(),e.preventDefault(),t.submit(e)}}},[i("md-card",{staticClass:"md-layout-item md-size-50 md-small-size-100"},[i("md-card-header",[i("div",{staticClass:"md-title"},[t._v("Deactivate project")])]),t.project.isTrial?i("md-card-content",[i("p",[t._v("This project is currently still in trial mode. If you deactivate this project, your credit card will not be billed for this project anymore.")]),i("p",[t._v("When the trial period ends and no payment info has been supplied, the containing images will be depublished until you activate the project.")]),i("p",[i("b",[t._v("Nothing gets deleted, just unpublished!")]),t._v(" If you want to permanently delete a project, you can do this after deactivation.")])]):i("md-card-content",[i("p",[t._v("If you deactivate a project, its images will be unpublished, meaning they are no longer publicly accessible.")]),i("p",[t._v("Also, the paid subscription will stop. You will no longer be charged for this project unless you reactivate it.")]),i("p",[i("b",[t._v("Nothing gets deleted, just unpublished!")]),t._v(" If you want to permanently delete a project, you can do this after deactivation.")])]),t.sending?i("md-progress-bar",{attrs:{"md-mode":"indeterminate"}}):t._e(),i("md-card-actions",[i("md-button",{staticClass:"md-secondary",attrs:{to:"../",disabled:t.sending}},[t._v("Cancel")]),i("md-button",{staticClass:"md-primary md-raised md-accent",attrs:{type:"submit",disabled:t.sending}},[t._v("Deactivate project")])],1)],1)],1)},ba=[],_a={data(){return{saved:!1,sending:!1,error:null,project:M.state.projects.find((t=>t.slug==this.$route.params.project))}},methods:{submit(){this.sending=!0,b.deactivateProject(this.project.id).then((()=>{this.$root.main.setMessage("Project succesfully deactivated!"),this.$router.push("../")})).catch((t=>{this.error=String(t),this.sending=!1,this.$root.main.setPopup(this.error),this.$router.back()}))}}},ya=_a,ka=(0,N.Z)(ya,fa,ba,!1,null,null,null),wa=ka.exports,Sa=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("form",{staticClass:"md-layout",attrs:{novalidate:""},on:{submit:function(e){return e.stopPropagation(),e.preventDefault(),t.submit(e)}}},[i("md-card",{staticClass:"md-layout-item md-size-50 md-small-size-100"},[i("md-card-header",[i("div",{staticClass:"md-title"},[t._v("Change plan")])]),i("md-card-content",[i("p",[t._v(" Change "),i("b",[t._v(t._s(t.project.title))]),t._v(" to allow for more storage and bandwidth. ")]),i("p",[t._v(" For more information about each type and which features they provide, check out our "),i("a",{attrs:{href:"https://micr.io/plans-and-pricing",target:"_blank"}},[t._v("Plans and Pricing")]),t._v(" page. ")]),i("p",[t._v("Do you need a larger plan, have very large image collections, need shared organisation accounts, or a server API for automatically transferring images from your existing platform? Please "),i("router-link",{attrs:{to:"./quote"}},[t._v("contact us")]),t._v("! ")],1),i("SelectSubscription",{attrs:{project:t.project,sending:t.sending},on:{change:function(e){return t.subscriptionOrgId=e}}})],1),t.sending?i("md-progress-bar",{attrs:{"md-mode":"indeterminate"}}):t._e(),i("md-card-actions",[i("md-button",{staticClass:"md-secondary",attrs:{to:"../",disabled:t.sending}},[t._v("Cancel")]),i("md-button",{staticClass:"md-primary md-raised",attrs:{type:"submit",disabled:!t.valid||t.sending}},[t._v("Change plan")])],1)],1)],1)},$a=[],Ia={components:{SelectSubscription:oa},data(){return{sending:!1,error:null,project:M.state.projects.find((t=>t.slug==this.$route.params.project)),subscriptionOrgId:null}},computed:{valid(){return this.subscriptionOrgId&&this.project.subscriptionOrgId!=this.subscriptionOrgId}},methods:{submit(){this.valid&&(this.sending=!0,b.upgradeProject(this.project.id,this.subscriptionOrgId).then((t=>{this.project.subscriptionOrgId=t.subscriptionOrgId,this.sending=!1,this.$root.main.setMessage("Project succesfully upgraded!"),this.$router.push("../")})).catch((t=>{this.error=String(t),this.sending=!1,this.$root.main.setPopup(this.error),this.$router.push("../")})))}}},Ca=Ia,Pa=(0,N.Z)(Ca,Sa,$a,!1,null,null,null),xa=Pa.exports,ja=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("form",{staticClass:"md-layout",attrs:{novalidate:""},on:{submit:function(e){return e.stopPropagation(),e.preventDefault(),t.submit(e)}}},[i("md-card",{staticClass:"md-layout-item md-size-50 md-small-size-100"},[i("md-card-header",[i("div",{staticClass:"md-title"},[t._v("Request a quote")])]),i("md-card-content",[t.inTrial?[t.project.trialDaysLeft>0?i("span",[t._v("This project's trial period will expire in "+t._s(this.project.trialDaysLeft)+" days. If you wait too long, the images in this project will be depublished and will not be publicly available anymore. ")]):i("span",[t._v("Your trial period has expired; This means the images you have uploaded are no longer publicly available.")]),i("p",{attrs:{v:""}},[i("b",[t._v("Nothing "),t.project.trialDaysLeft>0?[t._v("will be")]:[t._v("has been")],t._v(" deleted")],2),t._v(", and if you don't wish to keep using Micrio, you can delete this project permanently "),i("router-link",{attrs:{to:"./delete"}},[t._v("here")]),t._v(". ")],1),i("p",[t._v(" To keep using Micrio, please fill out the form below, after which we will get in touch with you about pricing details. ")])]:i("p",[t._v(" If you wish to upgrade or downgrade this project, let us know your preferred changes. ")]),i("p",[t._v(" The questions below are indicative, and will help us to deliver you a better quote. ")]),i("md-field",[i("label",[t._v("How many images do you require in this project?")]),i("md-select",{attrs:{"md-dense":""},model:{value:t.values.numImages,callback:function(e){t.$set(t.values,"numImages",e)},expression:"values.numImages"}},[i("md-option",{attrs:{value:"1"}},[t._v("1")]),i("md-option",{attrs:{value:"2-10"}},[t._v("2 - 10")]),i("md-option",{attrs:{value:"11-25"}},[t._v("11-25")]),i("md-option",{attrs:{value:"26-50"}},[t._v("26-50")]),i("md-option",{attrs:{value:"51-250"}},[t._v("51-250")]),i("md-option",{attrs:{value:"250+"}},[t._v("250+")])],1)],1),i("md-field",[i("label",[t._v("Estimated average uploaded image sizes")]),i("md-select",{attrs:{"md-dense":""},model:{value:t.values.imageSize,callback:function(e){t.$set(t.values,"imageSize",e)},expression:"values.imageSize"}},[i("md-option",{attrs:{value:"0-10"}},[t._v("Up to 10MB")]),i("md-option",{attrs:{value:"10-50"}},[t._v("Up to 50MB")]),i("md-option",{attrs:{value:"50-500"}},[t._v("50 to 500MB")]),i("md-option",{attrs:{value:"500-5000"}},[t._v("500MB to 5GB")]),i("md-option",{attrs:{value:"5000+"}},[t._v("Larger than 5GB")])],1)],1),i("md-field",[i("label",[t._v("Estimated number of monthly views")]),i("md-select",{attrs:{"md-dense":""},model:{value:t.values.numVisitors,callback:function(e){t.$set(t.values,"numVisitors",e)},expression:"values.numVisitors"}},[i("md-option",{attrs:{value:"dunno"}},[t._v("I don't know")]),i("md-option",{attrs:{value:"0-1K"}},[t._v("Less than 1.000 monthly")]),i("md-option",{attrs:{value:"1K-10K"}},[t._v("Up to 10.000 monthly")]),i("md-option",{attrs:{value:"10K-100K"}},[t._v("Up to 100.000")]),i("md-option",{attrs:{value:"100K-1M"}},[t._v("Up to 1 million")]),i("md-option",{attrs:{value:"1M+"}},[t._v("More than 1 million")])],1)],1),i("md-field",[i("label",[t._v("Which sector will this project be used for?")]),i("md-select",{attrs:{"md-dense":""},model:{value:t.values.sector,callback:function(e){t.$set(t.values,"sector",e)},expression:"values.sector"}},[i("md-option",{attrs:{value:"art"}},[t._v("Individual artist or group of artists")]),i("md-option",{attrs:{value:"education"}},[t._v("Children's or adult education")]),i("md-option",{attrs:{value:"museum"}},[t._v("Museum / cultural")]),i("md-option",{attrs:{value:"tv-radio"}},[t._v("TV or radio broadcasting")]),i("md-option",{attrs:{value:"media"}},[t._v("Media company / advertising")]),i("md-option",{attrs:{value:"press"}},[t._v("Journalism / press media")]),i("md-option",{attrs:{value:"finance"}},[t._v("Financial")])],1)],1),i("div",[i("md-checkbox",{model:{value:t.values.video360,callback:function(e){t.$set(t.values,"video360",e)},expression:"values.video360"}},[t._v("I want to use 360° videos")])],1),i("div",[i("md-checkbox",{model:{value:t.values.embed,callback:function(e){t.$set(t.values,"embed",e)},expression:"values.embed"}},[t._v("I want to embed Micrio within my own site")])],1),i("div",[i("md-checkbox",{model:{value:t.values.IIIF,callback:function(e){t.$set(t.values,"IIIF",e)},expression:"values.IIIF"}},[t._v("I want to use the IIIF API")])],1),i("div",[i("md-checkbox",{model:{value:t.values.serverApi,callback:function(e){t.$set(t.values,"serverApi",e)},expression:"values.serverApi"}},[t._v("I want to use the server image tiling API for use in my own environments")])],1),i("div",[i("md-checkbox",{model:{value:t.values.customProject,callback:function(e){t.$set(t.values,"customProject",e)},expression:"values.customProject"}},[t._v("I have a custom project I would like to have developed")])],1),i("md-field",[i("label",[t._v("Do you have any additonal details, feedback, wishes, or ideas?")]),i("md-textarea",{staticClass:"description",model:{value:t.values.additional,callback:function(e){t.$set(t.values,"additional",e)},expression:"values.additional"}})],1),i("p",[t._v(" We will respond within two working days. "),t.inTrial?[0===t.project.trialDaysLeft?i("span",[t._v(" After submitting this form, we will "),i("b",[t._v("reactivate")]),t._v(" this project for an extra "),i("b",[t._v("10 days")]),t._v("! ")]):i("span",[t._v(" After submitting this form, we will add "),i("b",[t._v("10 extra days")]),t._v(" to your trial period. ")])]:t._e()],2)],2),t.sending?i("md-progress-bar",{attrs:{"md-mode":"indeterminate"}}):t._e(),i("md-card-actions",[i("md-button",{staticClass:"md-secondary",attrs:{to:"../",disabled:t.sending}},[t._v("Cancel")]),i("md-button",{staticClass:"md-primary md-raised md-active",attrs:{type:"submit",disabled:t.sending}},[t._v("Send")])],1)],1)],1)},Ta=[],Ma={data(){return{project:M.state.projects.find((t=>t.slug==this.$route.params.project)),sending:!1,values:{numImages:null,imageSize:null,numVisitors:null,sector:null,video360:!1,embed:!1,IIIF:!1,serverApi:!1,customProject:!1,additional:""}}},computed:{inTrial(){return this.project.trialDaysLeft>0||0===this.project.trialDaysLeft}},methods:{submit(){this.sending=!0,b.requestQuote(this.project.id,this.values).then((()=>{this.$root.main.setMessage("Request sent, thank you! This project now has some extra trial time :)"),this.sending=!1,this.$router.push("../")})).catch((t=>{this.error=String(t),this.sending=!1,this.$root.main.setPopup(this.error),this.$router.push("../")}))}}},Da=Ma,Aa=(0,N.Z)(Da,ja,Ta,!1,null,null,null),Oa=Aa.exports,Ea=function(){var t=this,e=t.$createElement,i=t._self._c||e;return!t.project.subscriptionOrgId||t.isTrial?i("SetSubscription",{attrs:{project:t.project,justSelectSubscription:t.isTrial}}):t.store.state.user.isStripeCustomer?i("form",{staticClass:"md-layout",attrs:{novalidate:""},on:{submit:function(e){return e.stopPropagation(),e.preventDefault(),t.submit(e)}}},[i("md-card",{staticClass:"md-layout-item md-size-50 md-small-size-100"},[i("md-card-header",[i("div",{staticClass:"md-title"},[t._v("Activate project")])]),i("md-card-content",[i("p",[t._v("By activating this project, your Credit Card will be billed "+t._s(t.getPeriod())+" for the amount of "),i("b",{staticStyle:{"white-space":"pre"}},[t._v("€ "+t._s(t.getAmount()))]),t._v(".")]),!t.subscription||t.subscription.trialDays>0?[null===t.project.trialDaysLeft?i("p",[t._v("You get a one month trial period and will be first billed one month from now.")]):t.project.trialDaysLeft>0?i("p",[t._v("You still have "+t._s(t.project.trialDaysLeft)+" days left of your trial period, billing will start at "+t._s(t.getDate(t.project.trialEnds))+".")]):t.project.trialDaysLeft<=0?i("p",[t._v("Your trial period for this project is over, billing will be done immediately.")]):t._e()]:t._e(),i("p",[t._v("You can cancel the subscription at any time by deactivating the project.")])],2),t.sending?i("md-progress-bar",{attrs:{"md-mode":"indeterminate"}}):t._e(),i("md-card-actions",[i("md-button",{staticClass:"md-secondary",attrs:{to:"../",disabled:t.sending}},[t._v("Cancel")]),i("md-button",{staticClass:"md-primary md-raised md-active",attrs:{type:"submit",disabled:t.sending}},[t._v("Activate project")])],1)],1)],1):i("SetPaymentSource",{attrs:{redirect:!1}})},La=[],Ra=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("md-card",{staticClass:"set-payment md-layout-item md-size-50 md-small-size-100"},[i("md-card-header",[i("div",{staticClass:"md-title"},[t.isNew?i("span",[t._v("Set your payment details")]):i("span",[t._v("Update your payment details")])])]),i("md-card-content",[t.isNew?i("div",[t.store.state.currentOrgId?i("p",[t._v("Click the button below to link your organisation's account to Stripe, our payment provider.")]):i("p",[t._v("Click the button below to link your account to Stripe, our payment provider.")]),i("p",[t._v("At this point, you will not be billed yet.")])]):i("div",[i("p",[t._v("Click the button below to update your payment details for Stripe, our payment provider.")])]),t.sepa?i("md-content",[i("p",[t._v(" By providing your IBAN and confirming this payment, you are authorizing Micrio and Stripe, our payment service provider, to send instructions to your bank to debit your account and your bank to debit your account in accordance with those instructions. You are entitled to a refund from your bank under the terms and conditions of your agreement with your bank. A refund must be claimed within 8 weeks starting from the date on which your account was debited.")])]):t._e(),i("md-card-content",[t.sepa?i("md-field",[i("div",{staticClass:"form-row"},[i("label",{attrs:{for:"card-name"}},[t._v("Your name")]),i("md-input",{ref:"name",attrs:{type:"text"}})],1)]):t._e(),i("div",{staticClass:"form-row"},[i("label",{attrs:{for:"card-element"}},[t.sepa?i("span",[t._v("Your IBAN account")]):i("span",[t._v("Credit or debit card")])]),i("div",{ref:"stripeElement",attrs:{name:"card-element"}}),i("div",{ref:"cardErrors",attrs:{role:"alert"}})])],1),t.sending?i("md-progress-bar",{attrs:{"md-mode":"indeterminate"}}):t._e(),i("md-card-actions",[i("md-button",{staticClass:"md-secondary",attrs:{to:"../",disabled:t.sending}},[t._v("Cancel")]),i("md-button",{staticClass:"md-primary md-raised md-active",attrs:{disabled:t.sending},on:{click:t.updateCard}},[t.sepa?i("span",[t._v("Select")]):t.isNew?i("span",[t._v("Set your credit card")]):i("span",[t._v("Update your card")])])],1)],1)],1)},Na=[],Va={props:{redirect:{type:Boolean,default:!0}},data(){return{store:M,sending:!1,card:null,sepa:!1}},computed:{isNew(){return M.state.organisation?!M.state.organisation.hasStripeSource:!M.state.user.isStripeCustomer}},async mounted(){M.stripe.api||(this.sending=!0,M.stripe.api=await C(),this.sending=!1);const t=M.stripe.api.elements(),e={style:M.stripe.style};this.sepa&&(e.supportedCountries=["SEPA"]),this.card=t.create(this.sepa?"iban":"card",e),this.card.mount(this.$refs.stripeElement),this.card.addEventListener("change",(t=>{this.$refs.cardErrors.textContent=t.error?t.error.message:""}))},methods:{updateCard(){this.sending=!0,this.sepa?M.stripe.api.createSource(this.card,{type:"sepa_debit",currency:"eur",owner:{name:this.$refs.name.value,email:M.state.user.email},mandate:{notification_method:"email"}}).then((t=>{console.log("got!",t)})):M.stripe.api.createPaymentMethod("card",this.card).then((t=>{t.error?(this.$refs.cardErrors.textContent=t.error.message,this.sending=!1):t.paymentMethod&&b.updatePaymentMethod(t.paymentMethod.id).then(this.userUpdated).catch((t=>{this.sending=!1,this.$root.main.setPopup(String(t))}))}))},userUpdated(){this.sending=!1,this.isNew?this.$root.main.setMessage("Succesfully set up your account"):this.$root.main.setMessage("Succesfully updated your card"),this.redirect&&this.$router.push("/"+this.$route.params.organisation+"/payments/")}}},Ua=Va,za=(0,N.Z)(Ua,Ra,Na,!1,null,null,null),Fa=za.exports,Ja={components:{SetPaymentSource:Fa,SetSubscription:ca},data(){return{saved:!1,sending:!1,error:null,project:M.state.projects.find((t=>t.slug==this.$route.params.project)),store:M,secret:null,methodId:null}},computed:{subscription(){return M.state.subscriptions.find((t=>t.id==this.project.subscriptionOrgId))},isTrial(){return this.project.subscriptionOrgId==M.state.trialSubId}},methods:{getAmount(){let t=M.state.subscriptions.find((t=>t.id==this.project.subscriptionOrgId));return(t.monthlyAmount/100).toFixed(2)},getPeriod(){let t=M.state.subscriptions.find((t=>t.id==this.project.subscriptionOrgId));return t.paymentInterval+"ly"},getDate(t){let e=new Date(t);return e.getDate()+"/"+(e.getMonth()+1)+"/"+e.getFullYear()},async submit(){this.sending=!0,M.stripe.api||(M.stripe.api=await C()),b.createSubscription(this.project.id,this.project.subscriptionOrgId,this.project.title).then(this.stripeIntentResult).catch((t=>this.errorStatus(this.error=String(t))))},stripeIntentResult(t){if(t||this.errorStatus(this.error="No valid payment intent found. Please try again later."),"zero-invoice"==t.status)return this.success();if(t.paymentIntent&&(t=t.paymentIntent),t.error)this.errorStatus(this.error=t.error.message);else if(t.subscriptionOrgId)this.success();else switch(t.status){case"succeeded":b.confirmPaymentIntent(t.id,this.project.id).then((t=>{t.subscriptionOrgId?this.success():this.errorStatus(this.error=t.error)})).catch((t=>this.errorStatus(this.error=String(t))));break;case"requires_action":M.stripe.api.handleCardPayment(t.secret).then(this.stripeIntentResult);break;default:this.errorStatus(this.error="Unsuccesful status.. "+t.status)}},success(){this.sending=!1,this.$root.main.setMessage("Succesfully activated project!"),this.project.isActive=!0,M.state.user.isStripeCustomer&&this.$router.push("./")},errorStatus(){this.sending=!1,this.$root.main.setPopup(this.error)}}},Ba=Ja,Za=(0,N.Z)(Ba,Ea,La,!1,null,null,null),Ya=Za.exports,Wa=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("form",{staticClass:"md-layout",attrs:{novalidate:""},on:{submit:function(e){return e.stopPropagation(),e.preventDefault(),t.submit(e)}}},[i("md-card",{staticClass:"md-layout-item md-size-50 md-small-size-100"},[i("md-card-header",[i("div",{staticClass:"md-title"},[t._v('Delete folder "'+t._s(t.folder&&t.folder.title)+'"')])]),i("md-card-content",[i("p",[t._v("If you delete a folder, its images and all subfolders will be "),i("b",[t._v("permanently removed")]),t._v(". There is no undo for this.")]),t.sending?i("p",[t._v("Deleting a folder containing images could take some time, please wait...")]):t._e()]),t.sending?i("md-progress-bar",{attrs:{"md-mode":"indeterminate"}}):t._e(),i("md-card-actions",[i("md-button",{staticClass:"md-secondary",attrs:{to:"./",disabled:t.sending}},[t._v("Cancel")]),i("md-button",{staticClass:"md-primary md-raised md-accent",attrs:{type:"submit",disabled:t.sending}},[t._v("Delete folder")])],1)],1)],1)},Ga=[],Xa={data(){return{saved:!1,sending:!1,error:null,project:M.state.projects.find((t=>t.slug==this.$route.params.project))}},computed:{path(){return this.$route.path.replace(/\/[^/]*$/,"").split("/").slice(4)},folder(){if(this.path.length){let t=this.project.id,e=M.state.folders,i=!1;for(let s=0;se.parentId==t&&e.slug==this.path[s]));if(!a)break;t=a.id,i=s==this.path.length-1}if(i)return e.find((e=>e.id==t))}}},methods:{submit(){this.sending=!0,b.removeFolder(this.folder.id).then((()=>{this.$root.main.setMessage("Folder succesfully deleted!"),this.$router.push("../")})).catch((t=>{this.error=String(t),this.sending=!1,this.$root.main.setPopup(this.error),this.$router.push("./")}))}}},qa=Xa,Ka=(0,N.Z)(qa,Wa,Ga,!1,null,null,null),Ha=Ka.exports,Qa=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("iframe",{staticClass:"space-editor",attrs:{src:"https://spaces.micr.io/"+(t.project.zoneKey||t.folder.zoneKey)}})},tr=[],er={data(){return{project:M.state.projects.find((t=>t.slug==this.$route.params.project))}},computed:{folder(){if(this.path.length){let t=this.project.id,e=M.state.folders,i=!1;for(let s=0;se.parentId==t&&e.slug==this.path[s]));if(!a)break;t=a.id,i=s==this.path.length-1}return i?e.find((e=>e.id==t)):null}return this.project},path(){return this.$route.path.replace(/\/[^/]*$/,"").split("/").slice(4,-1)}},mounted(){M.state.editing=!0},beforeDestroy(){M.state.editing=!1}},ir=er,sr=(0,N.Z)(ir,Qa,tr,!1,null,null,null),ar=sr.exports,rr=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("iframe",{staticClass:"settings-frame",attrs:{src:"https://dash.micr.io/"+t.org.slug+"/settings?embed"}})},or=[],nr={data(){return{org:M.state.organisation}}},dr=nr,lr=(0,N.Z)(dr,rr,or,!1,null,null,null),cr=lr.exports,mr=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("md-empty-state",{attrs:{"md-icon":"update","md-label":"The profile section has moved"}},[i("p",[t._v("Click the button below to continue to your new account management screen.")]),i("md-button",{staticClass:"md-primary md-raised",attrs:{href:"https://account.micr.io/profile"}},[t._v("To the new version")])],1)},ur=[],hr={},pr=(0,N.Z)(hr,mr,ur,!1,null,null,null),gr=pr.exports;s["default"].use(X.Z);const vr=new X.Z({routes:[{path:"/:organisation/",component:Mt,children:[{path:"/",redirect:"projects/",name:"Home"},{path:"profile/",component:gr},{path:"projects/",component:Xt},{path:"projects/create",component:ca},{path:"projects/:project/delete",component:va},{path:"projects/:project/activate",component:Ya},{path:"projects/:project/deactivate",component:wa},{path:"projects/:project/upgrade",component:xa},{path:"projects/:project/quote",component:Oa},{path:"projects/:project/:folder(.*)/delete",component:Ha},{path:"projects/:project/:folder(.*)/spaces/edit",component:ar},{path:"projects/:project/spaces/edit",component:ar},{path:"projects/:project/edit/:id(\\w{5,8})/:lang(\\w{2})",component:vs},{path:"projects/:project/*/edit/:id(\\w{5,8})/:lang(\\w{2})",component:vs},{path:"projects/:project/:offset(\\@\\d*)?",component:Hs},{path:"projects/:project/:folder([^\\@]*)/:offset(\\@\\d*)?",component:Hs},{path:"payments/",name:"Payments",component:ee},{path:"user/updateCard",name:"UpdateCard",component:Fa},{path:"settings",name:"OrganisationSettings",component:cr}]},{path:"/e/",component:Mt,children:[{path:":id/:lang",name:"Editor",component:vs}]},{path:"*",component:tt,name:"404"}]});vr.beforeEach((async function(t,e,i){if(M.state.isEditor){const e=window._dashboard;return"/"==t.path?i(`/e/${e.id}/${e.lang}`):i()}if(M.state.user||(M.state.user=await b.getUser()),null!=vr.app.editor&&await vr.app.editor.save(),"/"==t.path){let t="s",e=localStorage.getItem("editor_orgId-"+M.state.user.id)||M.state.user.defaultOrganisation||localStorage.getItem("editor_orgId");if(e){let i=M.state.user.organisations.find((t=>t.id==e));i&&(t=i.slug)}else if(!M.state.showUserPrivateAccount){let e=M.state.user.organisations[0];e&&(t=e.slug)}return i("/"+t+"/")}"404"!=t.name?await M.dispatch("organisation",t.params.organisation):(console.warn("Not found!",t),M.state.loaded=!0),i()})),vr.afterEach((t=>{window.gtag&&window.gtag("config","UA-66335683-13",{anonymize_ip:!0,page_path:t.fullPath})}));var fr=vr,br=i(8535),_r=i.n(br);function yr(){new s["default"]({router:fr,render:t=>t(G),data(){return{editor:null,main:null}},methods:{getFileSize(t){if(!t)return"0MB";let e=["B","KB","MB","GB","TB"];for(let i=0;i=1){const e=new Date(t);return`${e.getDate()}-${e.getMonth()+1}-${e.getFullYear()}`}return i=Math.floor(e/86400),i>=1?1==i?"yesterday":`${i} day${1==i?"":"s"} ago`:(i=Math.floor(e/3600),i>=1?`${i} hour${1==i?"":"s"} ago`:(i=Math.floor(e/60),i>=1?`${i} minute${1==i?"":"s"} ago`:`${Math.floor(e)} second${1==i?"":"s"} ago`))},getDuration(t){let e=[0,0];while(t>=3600)t-=3600,e[0]++;while(t>=60)t-=60,e[1]++;return(e[0]>0?e[0]+":":"")+e[1]+":"+(t<10?"0":"")+Math.round(t)},getReadable(t){let e="";return t.toString().endsWith("1")&&(t--,e="+"),t?t.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")+e:"unknown"},createGuid(){function t(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return t()+t()+"-"+t()+"-"+t()+"-"+t()+"-"+t()+t()+t()}}}).$mount("#app")}s["default"].config.productionTip=!1,s["default"].use(_r()),localStorage.setItem("is-dashboard","1"),h&&36==h.length?fetch(y("/edit-session/start/"+h),{credentials:"include",method:"POST"}).then((async t=>{const e=await t.text();if(t.ok){M.state.isEditor=!0;const t=e.split(",");window._dashboard={id:t[0],lang:t[1]||"en"},yr()}else document.body.textContent=e})):yr()},4598:function(){}},e={};function i(s){var a=e[s];if(void 0!==a)return a.exports;var r=e[s]={id:s,loaded:!1,exports:{}};return t[s].call(r.exports,r,r.exports,i),r.loaded=!0,r.exports}i.m=t,function(){var t=[];i.O=function(e,s,a,r){if(!s){var o=1/0;for(c=0;c=r)&&Object.keys(i.O).every((function(t){return i.O[t](s[d])}))?s.splice(d--,1):(n=!1,r0&&t[c-1][2]>r;c--)t[c]=t[c-1];t[c]=[s,a,r]}}(),function(){i.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return i.d(e,{a:e}),e}}(),function(){i.d=function(t,e){for(var s in e)i.o(e,s)&&!i.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})}}(),function(){i.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"===typeof window)return window}}()}(),function(){i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)}}(),function(){i.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}}(),function(){i.nmd=function(t){return t.paths=[],t.children||(t.children=[]),t}}(),function(){var t={143:0};i.O.j=function(e){return 0===t[e]};var e=function(e,s){var a,r,o=s[0],n=s[1],d=s[2],l=0;if(o.some((function(e){return 0!==t[e]}))){for(a in n)i.o(n,a)&&(i.m[a]=n[a]);if(d)var c=d(i)}for(e&&e(s);l