From 0af1a04e862fefd51f22d315bfa493b110cdec83 Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 19 Nov 2024 14:26:40 +0000 Subject: [PATCH] deploy: 15574bf6a503b93418f09907e03d624ab6d951c9 --- 4.4.1/hashWorker.worker.52fb74a7a206414c3233.worker.js | 1 + 4.4.1/main_4.4.1.js | 2 +- @latest/hashWorker.worker.52fb74a7a206414c3233.worker.js | 1 + @latest/main.js | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 4.4.1/hashWorker.worker.52fb74a7a206414c3233.worker.js create mode 100644 @latest/hashWorker.worker.52fb74a7a206414c3233.worker.js diff --git a/4.4.1/hashWorker.worker.52fb74a7a206414c3233.worker.js b/4.4.1/hashWorker.worker.52fb74a7a206414c3233.worker.js new file mode 100644 index 0000000..ccbf941 --- /dev/null +++ b/4.4.1/hashWorker.worker.52fb74a7a206414c3233.worker.js @@ -0,0 +1 @@ +(()=>{var t={735:t=>{t.exports=function(t){"use strict";var r=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function e(t,r){var e=t[0],n=t[1],s=t[2],o=t[3];n=((n+=((s=((s+=((o=((o+=((e=((e+=(n&s|~n&o)+r[0]-680876936|0)<<7|e>>>25)+n|0)&n|~e&s)+r[1]-389564586|0)<<12|o>>>20)+e|0)&e|~o&n)+r[2]+606105819|0)<<17|s>>>15)+o|0)&o|~s&e)+r[3]-1044525330|0)<<22|n>>>10)+s|0,n=((n+=((s=((s+=((o=((o+=((e=((e+=(n&s|~n&o)+r[4]-176418897|0)<<7|e>>>25)+n|0)&n|~e&s)+r[5]+1200080426|0)<<12|o>>>20)+e|0)&e|~o&n)+r[6]-1473231341|0)<<17|s>>>15)+o|0)&o|~s&e)+r[7]-45705983|0)<<22|n>>>10)+s|0,n=((n+=((s=((s+=((o=((o+=((e=((e+=(n&s|~n&o)+r[8]+1770035416|0)<<7|e>>>25)+n|0)&n|~e&s)+r[9]-1958414417|0)<<12|o>>>20)+e|0)&e|~o&n)+r[10]-42063|0)<<17|s>>>15)+o|0)&o|~s&e)+r[11]-1990404162|0)<<22|n>>>10)+s|0,n=((n+=((s=((s+=((o=((o+=((e=((e+=(n&s|~n&o)+r[12]+1804603682|0)<<7|e>>>25)+n|0)&n|~e&s)+r[13]-40341101|0)<<12|o>>>20)+e|0)&e|~o&n)+r[14]-1502002290|0)<<17|s>>>15)+o|0)&o|~s&e)+r[15]+1236535329|0)<<22|n>>>10)+s|0,n=((n+=((s=((s+=((o=((o+=((e=((e+=(n&o|s&~o)+r[1]-165796510|0)<<5|e>>>27)+n|0)&s|n&~s)+r[6]-1069501632|0)<<9|o>>>23)+e|0)&n|e&~n)+r[11]+643717713|0)<<14|s>>>18)+o|0)&e|o&~e)+r[0]-373897302|0)<<20|n>>>12)+s|0,n=((n+=((s=((s+=((o=((o+=((e=((e+=(n&o|s&~o)+r[5]-701558691|0)<<5|e>>>27)+n|0)&s|n&~s)+r[10]+38016083|0)<<9|o>>>23)+e|0)&n|e&~n)+r[15]-660478335|0)<<14|s>>>18)+o|0)&e|o&~e)+r[4]-405537848|0)<<20|n>>>12)+s|0,n=((n+=((s=((s+=((o=((o+=((e=((e+=(n&o|s&~o)+r[9]+568446438|0)<<5|e>>>27)+n|0)&s|n&~s)+r[14]-1019803690|0)<<9|o>>>23)+e|0)&n|e&~n)+r[3]-187363961|0)<<14|s>>>18)+o|0)&e|o&~e)+r[8]+1163531501|0)<<20|n>>>12)+s|0,n=((n+=((s=((s+=((o=((o+=((e=((e+=(n&o|s&~o)+r[13]-1444681467|0)<<5|e>>>27)+n|0)&s|n&~s)+r[2]-51403784|0)<<9|o>>>23)+e|0)&n|e&~n)+r[7]+1735328473|0)<<14|s>>>18)+o|0)&e|o&~e)+r[12]-1926607734|0)<<20|n>>>12)+s|0,n=((n+=((s=((s+=((o=((o+=((e=((e+=(n^s^o)+r[5]-378558|0)<<4|e>>>28)+n|0)^n^s)+r[8]-2022574463|0)<<11|o>>>21)+e|0)^e^n)+r[11]+1839030562|0)<<16|s>>>16)+o|0)^o^e)+r[14]-35309556|0)<<23|n>>>9)+s|0,n=((n+=((s=((s+=((o=((o+=((e=((e+=(n^s^o)+r[1]-1530992060|0)<<4|e>>>28)+n|0)^n^s)+r[4]+1272893353|0)<<11|o>>>21)+e|0)^e^n)+r[7]-155497632|0)<<16|s>>>16)+o|0)^o^e)+r[10]-1094730640|0)<<23|n>>>9)+s|0,n=((n+=((s=((s+=((o=((o+=((e=((e+=(n^s^o)+r[13]+681279174|0)<<4|e>>>28)+n|0)^n^s)+r[0]-358537222|0)<<11|o>>>21)+e|0)^e^n)+r[3]-722521979|0)<<16|s>>>16)+o|0)^o^e)+r[6]+76029189|0)<<23|n>>>9)+s|0,n=((n+=((s=((s+=((o=((o+=((e=((e+=(n^s^o)+r[9]-640364487|0)<<4|e>>>28)+n|0)^n^s)+r[12]-421815835|0)<<11|o>>>21)+e|0)^e^n)+r[15]+530742520|0)<<16|s>>>16)+o|0)^o^e)+r[2]-995338651|0)<<23|n>>>9)+s|0,n=((n+=((o=((o+=(n^((e=((e+=(s^(n|~o))+r[0]-198630844|0)<<6|e>>>26)+n|0)|~s))+r[7]+1126891415|0)<<10|o>>>22)+e|0)^((s=((s+=(e^(o|~n))+r[14]-1416354905|0)<<15|s>>>17)+o|0)|~e))+r[5]-57434055|0)<<21|n>>>11)+s|0,n=((n+=((o=((o+=(n^((e=((e+=(s^(n|~o))+r[12]+1700485571|0)<<6|e>>>26)+n|0)|~s))+r[3]-1894986606|0)<<10|o>>>22)+e|0)^((s=((s+=(e^(o|~n))+r[10]-1051523|0)<<15|s>>>17)+o|0)|~e))+r[1]-2054922799|0)<<21|n>>>11)+s|0,n=((n+=((o=((o+=(n^((e=((e+=(s^(n|~o))+r[8]+1873313359|0)<<6|e>>>26)+n|0)|~s))+r[15]-30611744|0)<<10|o>>>22)+e|0)^((s=((s+=(e^(o|~n))+r[6]-1560198380|0)<<15|s>>>17)+o|0)|~e))+r[13]+1309151649|0)<<21|n>>>11)+s|0,n=((n+=((o=((o+=(n^((e=((e+=(s^(n|~o))+r[4]-145523070|0)<<6|e>>>26)+n|0)|~s))+r[11]-1120210379|0)<<10|o>>>22)+e|0)^((s=((s+=(e^(o|~n))+r[2]+718787259|0)<<15|s>>>17)+o|0)|~e))+r[9]-343485551|0)<<21|n>>>11)+s|0,t[0]=e+t[0]|0,t[1]=n+t[1]|0,t[2]=s+t[2]|0,t[3]=o+t[3]|0}function n(t){var r,e=[];for(r=0;r<64;r+=4)e[r>>2]=t.charCodeAt(r)+(t.charCodeAt(r+1)<<8)+(t.charCodeAt(r+2)<<16)+(t.charCodeAt(r+3)<<24);return e}function s(t){var r,e=[];for(r=0;r<64;r+=4)e[r>>2]=t[r]+(t[r+1]<<8)+(t[r+2]<<16)+(t[r+3]<<24);return e}function o(t){var r,s,o,a,i,f,h=t.length,u=[1732584193,-271733879,-1732584194,271733878];for(r=64;r<=h;r+=64)e(u,n(t.substring(r-64,r)));for(s=(t=t.substring(r-64)).length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],r=0;r>2]|=t.charCodeAt(r)<<(r%4<<3);if(o[r>>2]|=128<<(r%4<<3),r>55)for(e(u,o),r=0;r<16;r+=1)o[r]=0;return a=(a=8*h).toString(16).match(/(.*?)(.{0,8})$/),i=parseInt(a[2],16),f=parseInt(a[1],16)||0,o[14]=i,o[15]=f,e(u,o),u}function a(t){var r,n,o,a,i,f,h=t.length,u=[1732584193,-271733879,-1732584194,271733878];for(r=64;r<=h;r+=64)e(u,s(t.subarray(r-64,r)));for(n=(t=r-64>2]|=t[r]<<(r%4<<3);if(o[r>>2]|=128<<(r%4<<3),r>55)for(e(u,o),r=0;r<16;r+=1)o[r]=0;return a=(a=8*h).toString(16).match(/(.*?)(.{0,8})$/),i=parseInt(a[2],16),f=parseInt(a[1],16)||0,o[14]=i,o[15]=f,e(u,o),u}function i(t){var e,n="";for(e=0;e<4;e+=1)n+=r[t>>8*e+4&15]+r[t>>8*e&15];return n}function f(t){var r;for(r=0;ru?new ArrayBuffer(0):(s=u-h,o=new ArrayBuffer(s),a=new Uint8Array(o),i=new Uint8Array(this,h,s),a.set(i),o)}}(),l.prototype.append=function(t){return this.appendBinary(h(t)),this},l.prototype.appendBinary=function(t){this._buff+=t,this._length+=t.length;var r,s=this._buff.length;for(r=64;r<=s;r+=64)e(this._hash,n(this._buff.substring(r-64,r)));return this._buff=this._buff.substring(r-64),this},l.prototype.end=function(t){var r,e,n=this._buff,s=n.length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(r=0;r>2]|=n.charCodeAt(r)<<(r%4<<3);return this._finish(o,s),e=f(this._hash),t&&(e=y(e)),this.reset(),e},l.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},l.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},l.prototype.setState=function(t){return this._buff=t.buff,this._length=t.length,this._hash=t.hash,this},l.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},l.prototype._finish=function(t,r){var n,s,o,a=r;if(t[a>>2]|=128<<(a%4<<3),a>55)for(e(this._hash,t),a=0;a<16;a+=1)t[a]=0;n=(n=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),s=parseInt(n[2],16),o=parseInt(n[1],16)||0,t[14]=s,t[15]=o,e(this._hash,t)},l.hash=function(t,r){return l.hashBinary(h(t),r)},l.hashBinary=function(t,r){var e=f(o(t));return r?y(e):e},l.ArrayBuffer=function(){this.reset()},l.ArrayBuffer.prototype.append=function(t){var r,n=c(this._buff.buffer,t,!0),o=n.length;for(this._length+=t.byteLength,r=64;r<=o;r+=64)e(this._hash,s(n.subarray(r-64,r)));return this._buff=r-64>2]|=n[r]<<(r%4<<3);return this._finish(o,s),e=f(this._hash),t&&(e=y(e)),this.reset(),e},l.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},l.ArrayBuffer.prototype.getState=function(){var t=l.prototype.getState.call(this);return t.buff=p(t.buff),t},l.ArrayBuffer.prototype.setState=function(t){return t.buff=u(t.buff,!0),l.prototype.setState.call(this,t)},l.ArrayBuffer.prototype.destroy=l.prototype.destroy,l.ArrayBuffer.prototype._finish=l.prototype._finish,l.ArrayBuffer.hash=function(t,r){var e=f(a(new Uint8Array(t)));return r?y(e):e},l}()}},r={};function e(n){var s=r[n];if(void 0!==s)return s.exports;var o=r[n]={exports:{}};return t[n](o,o.exports,e),o.exports}e.n=t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},e.d=(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},e.o=(t,r)=>Object.prototype.hasOwnProperty.call(t,r),(()=>{"use strict";var t=e(735),r=e.n(t);self.onmessage=async function(t){if(t.data.file&&"begin hash"==t.data.msg){console.log("ello chum!");const e=t.data.file,n=PydioApi.getMultipartPartSize();if(e.size>n)try{const t=await((t,e)=>new Promise(((n,s)=>{const o=e,a=Math.ceil(t.size/o),i=[];let f=0;const h=new FileReader,u=new(r().ArrayBuffer),p=()=>{const r=f*o,e=r+o>=t.size?t.size:r+o;h.readAsArrayBuffer(t.slice(r,e))};h.onload=t=>{u.append(t.target.result);const e=u.end();if(i.push(e),u.reset(),f++,fs(h.error),p()})))(e,n);postMessage({status:"complete",hash:t})}catch(t){postMessage({status:"error",message:t.message})}else{const t=await incrementalMD5(e);postMessage({status:"complete",hash:t})}self.close()}}})()})(); \ No newline at end of file diff --git a/4.4.1/main_4.4.1.js b/4.4.1/main_4.4.1.js index 38ac74d..e5d12b3 100644 --- a/4.4.1/main_4.4.1.js +++ b/4.4.1/main_4.4.1.js @@ -1 +1 @@ -(()=>{var e={125:()=>{async function e(){const e=`${window.location.origin}/api/preservation`,t=await PydioApi._PydioRestClient.getOrUpdateJwt();return fetch(e,{headers:{Authorization:`Bearer ${t}`},method:"GET"}).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return e.json()})).then((e=>{sessionStorage.setItem("preservationConfigs",JSON.stringify(e))})).catch((e=>{console.error("Fetch error:",e)}))}function t(t,n,o){const s=document.createElement("div");s.id="preservationConfigsSubMenu",s.style.maxHeight="8em",s.style.overflowY="scroll",s.innerHTML=n,o.forEach((e=>{let t=document.createElement("div");const n=JSON.parse(localStorage.getItem(e.id));if(t.style.transition="0.3s ease all",t.addEventListener("mouseenter",(e=>{e.target.style.background="var(--md-sys-color-outline-variant-50)"})),t.addEventListener("mouseleave",(e=>{e.target.style.background="none"})),t.addEventListener("click",(t=>{t.target.classList.contains("mdi-star-outline")?(console.info("bookmarked!"),localStorage.setItem(e.id,JSON.stringify({name:e.name,bookmarked:!0})),t.target.classList.remove("mdi-star-outline"),t.target.classList.add("mdi-star"),s.remove()):t.target.classList.contains("mdi-star")?(console.info("un-bookmarked!"),localStorage.setItem(e.id,JSON.stringify({name:e.name,bookmarked:!1})),t.target.classList.remove("mdi-star"),t.target.classList.add("mdi-star-outline"),s.remove()):(!async function(e){const t=await PydioApi._PydioRestClient.getOrUpdateJwt(),n=`${window.location.origin}/a/scheduler/hooks/a3m-transfer`,o=pydio._dataModel._selectedNodes.map((e=>({path:Curate.workspaces.getOpenWorkspace()+e._path,slug:e._metadata.get("usermeta-atom-linked-description")||""}))),i=JSON.stringify({Paths:o,JobParameters:{ConfigId:e.toString()}});fetch(n,{method:"POST",mode:"cors",headers:{accept:"application/json","accept-language":"en-GB,en-US;q=0.9,en;q=0.8",authorization:`Bearer ${t}`,"cache-control":"no-cache","content-type":"application/json",pragma:"no-cache","sec-fetch-mode":"cors","sec-fetch-site":"same-origin","x-pydio-language":"en-us"},body:i}).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return e.json()})).then((e=>{console.info("Preservation config initiated successfully")})).catch((e=>{console.error("Fetch error:",e)}))}(e.id),s.remove())})),t.innerHTML='
Source Editor
',t.querySelector('[role="menuLabel"]').innerText=e.name,s.querySelector('[role="menu"]').appendChild(t),n&&n.bookmarked){let e=t.querySelector(".mdi-star-outline");e.classList.remove("mdi-star-outline"),e.classList.add("mdi-star")}}));const l=document.createElement("div");l.innerHTML='
Source Editor
',l.querySelector('[role="menuLabel"]').innerText="Create New",l.style.transition="0.3s ease all",l.addEventListener("mouseenter",(e=>{e.target.style.background="var(--md-sys-color-outline-variant-50)"})),l.addEventListener("mouseleave",(e=>{e.target.style.background="none"})),l.addEventListener("click",(t=>{document.querySelector("#preservationConfigsSubMenu").remove(),function(t,n){const o=document.createElement("div");o.classList.add("config-modal-container");const r=document.createElement("div");r.classList.add("config-modal-scroll-container");const s=document.createElement("div");s.classList.add("config-modal-content");const l=document.createElement("div");l.textContent=t,l.classList.add("config-popup-title"),s.appendChild(l);const d=document.createElement("div");d.classList.add("config-main-options-container"),s.appendChild(d),n.forEach((e=>{const t=document.createElement("div");t.classList.add("config-input-category"),t.id=e.category.replaceAll(" ","_");const n=document.createElement("div");n.classList.add("config-text-label"),n.textContent=e.category,t.appendChild(n),e.inputs.forEach((e=>{a(e,t)})),r.appendChild(t)}));const c=document.createElement("button");c.classList.add("config-clear-form"),c.textContent="Clear Form",c.addEventListener("click",(e=>{r.querySelectorAll("input").forEach((e=>{"text"==e.type?e.value="":"checkbox"==e.type?e.checked=!1:e.value=0,e.dispatchEvent(new CustomEvent("change",{bubbles:!0})),e.dispatchEvent(new CustomEvent("input",{bubbles:!0}))}))})),r.appendChild(c);const p=document.createElement("div");p.classList.add("config-options-container"),p.style="display: flex;align-items: center;flex-wrap: nowrap;flex-direction: column;";const u=document.createElement("div");u.classList.add("config-text-label"),u.textContent="Create or Edit Configs",u.style="padding-bottom: 1em !important",p.appendChild(u),p.appendChild(r);const m=document.createElement("div");m.classList.add("config-modal-scroll-container");const h=document.createElement("button");h.classList.add("config-save-button"),h.textContent="Save Config",h.addEventListener("click",(t=>{const o=JSON.parse(sessionStorage.getItem("preservationConfigs")),a=p.querySelector("#name").value,r=n.flatMap((e=>e.inputs.map((e=>e.name)).concat(e.inputs.flatMap((e=>e.suboptions?e.suboptions.map((e=>e.name)):[]))))),s={},l=o?.find((e=>e.name==a));l?s.id=l.id:s.user=pydio.user.id,r.forEach((e=>{const t=document.querySelector("#"+e);t&&"submit"!=t.type&&(t.disabled&&(s[e.toLowerCase()]=!1),"checkbox"==t.type?s[e.toLowerCase()]=+t.checked:t.querySelector("input[type='range']")?s[e.toLowerCase()]=t.querySelector("input[type='range']").value:"name"==e?s.name=t.value:"image_normalization_tiff"==e?s[e.toLowerCase()]="TIFF"===t.value?1:0:"string"==typeof t.value?s[e.toLowerCase()]=t.value.toLowerCase():s[e.toLowerCase()]=t.value)})),l?async function(e){const t=`${window.location.origin}/api/preservation/${e.id}`,n=await PydioApi._PydioRestClient.getOrUpdateJwt();fetch(t,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify(e)}).then((e=>{if(!e.ok)throw new Error(`HTTP error while updating config, Status: ${e.status}`);if(200==e.status)return console.info("config saved successfully"),e.json()})).catch((e=>{console.error("Fetch error:",e),Curate.ui.modals.curatePopup({title:"Error",type:"error",content:"There was an error saving your modified configuration. Please try again, or contact support if the problem persists."}).fire()}))}(s):async function(e){const t=`${window.location.origin}/preservation`,n=await PydioApi._PydioRestClient.getOrUpdateJwt();return fetch(t,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify(e)}).then((e=>{if(e.ok)return console.info("config saved successfully"),e.json();throw new Error(`HTTP error! Status: ${e.status}`)})).catch((e=>{console.error("Fetch error:",e),Curate.ui.modals.curatePopup({title:"Error",type:"error",content:"There was an error saving your configuration. Please try again, or contact support if the problem persists."}).fire()}))}(s).then((t=>{if(t){const t=JSON.parse(sessionStorage.getItem("preservationConfigs"));e().then((e=>{const n=JSON.parse(sessionStorage.getItem("preservationConfigs"));if(s.id)document.querySelector("#config-"+s.id).remove(),i(m,[n.find((e=>e.id===s.id))]);else{const e=n.find((e=>!t.some((t=>t.id===e.id))));i(m,[e])}}))}}))})),p.appendChild(h),d.appendChild(p),p.addEventListener("input",(e=>{let t=p.querySelector("#name").value;0==t.length?h.style.display="none":t.trim().length<3?(h.textContent="Add a name 3 characters or longer",h.style.display="block"):(h.textContent="Save Config",h.style.display="block")}));const g=document.createElement("div");g.classList.add("config-options-container"),g.id="savedConfigsContainer",g.style="display:flex;align-items:center;justify-content:flex-start;flex-direction:column;";const f=document.createElement("div");f.classList.add("config-text-label"),f.style="padding-bottom: 1em; !important",f.textContent="Saved Configs",g.appendChild(f);const y=JSON.parse(sessionStorage.getItem("preservationConfigs"));i(m,g,y),g.appendChild(m),d.appendChild(g),o.appendChild(s);const b=document.createElement("div");b.classList.add("action-buttons");const v=document.createElement("button");v.classList.add("config-modal-close-button"),v.textContent="Close",v.addEventListener("click",(()=>{document.body.removeChild(o)})),b.appendChild(v),s.appendChild(b),document.body.appendChild(o),o.style.display="flex"}("Preservation Configs",r)})),s.querySelector('[role="menu"]').appendChild(l),document.body.appendChild(s);const d=s.firstChild.getBoundingClientRect(),c=t.getBoundingClientRect(),p=c.left,u=window.innerWidth-c.right;var m;return pu?(m=c.top,newRight=window.innerWidth-c.left+d.width,s.style.position="absolute",s.style.top=`${m}px`,s.style.right=`${newRight}px`):(m=c.top,newRight=window.innerWidth-c.right,s.style.position="absolute",s.style.top=`${m}px`,s.style.right=`${newRight}px`),s}function n(e,t,n="16px",o="5px"){const i=document.createElement("div");return i.style.transition="0.3s ease all",i.style.maxWidth="20em",i.addEventListener("mouseenter",(e=>{e.target.style.background="var(--md-sys-color-outline-variant-50)"})),i.addEventListener("mouseleave",(e=>{e.target.style.background="none"})),i.id="preservationConfigDropdown",i.innerHTML='
'+e+"
",i}function o(e){const o=JSON.parse(sessionStorage.getItem("preservationConfigs"));setTimeout((()=>{for(const i of e.querySelectorAll("div")){if("Preserve"==i.innerText){const a=n("Preservation Configs","mdi-menu-right","24px","0px");e.insertBefore(a,i.nextSibling);const r=document.querySelector("#preservationConfigDropdown"),s=[1,3];return document.addEventListener("mousedown",(e=>{}),{once:!0}),r.addEventListener("click",(e=>{const n=t(r,'
',o);setTimeout((()=>{document.addEventListener("mousedown",(e=>{s.includes(e.which)&&(n.contains(e.target)||n.remove())}),{once:!0})}),100)})),void o.forEach((t=>{const o=JSON.parse(localStorage.getItem(t.id.toString()));if(o&&o.bookmarked){const o=n(t.name,"mdi-console");e.insertBefore(o,i.nextSibling)}}))}document.querySelector("#preservationConfigDropdown")&&document.querySelector("#preservationConfigDropdown").remove()}}),10)}function i(t,n,o){console.log(o),o?.forEach((n=>{const o=document.createElement("div");o.id="config-"+n.id,o.classList.add("saved-config-item"),o.style.opacity="0",o.addEventListener("mouseenter",(e=>{o.style.backgroundColor="var(--md-sys-color-outline-variant)"})),o.addEventListener("mouseleave",(e=>{o.style.backgroundColor="var(--md-sys-color-on-secondary)"})),o.addEventListener("click",(e=>{if(!["saved-config-delete","config-bookmark-container","mdi-star","mdi-star-outline"].includes(e.target.className))for(var t in n)if(n.hasOwnProperty(t)){var o="#"+t,i=document.querySelector(o);i&&("checkbox"==i.type?i.checked=!!n[t]:"select-one"==i.type?"image_normalization_tiff"==i.id&&(i.value=1===n[t]?"TIFF":"JPEG2000"):"range"==i.type?(i.value=n[t],i.dispatchEvent(new CustomEvent("input",{bubbles:!0}))):i.value=n[t],i.dispatchEvent(new CustomEvent("change",{bubbles:!0})))}}));const i=document.createElement("div");i.classList.add("saved-config-information");const a=document.createElement("label");a.textContent=n.name,a.style.fontWeight="500",a.style.marginBottom="0";const r=document.createElement("label");r.classList.add("config-text-label");const s=document.createElement("div"),l=document.createElement("label");l.for="config-description-"+n.id,l.textContent="Description: ";const d=document.createElement("span");d.textContent=n.description,d.id="config-description-"+n.id,s.appendChild(l),s.appendChild(d);const c=document.createElement("div"),p=document.createElement("label");p.id="config-user-"+n.id,p.textContent="User: ";const u=document.createElement("span");u.id="config-user-"+n.id,u.textContent=n.user,c.appendChild(p),c.appendChild(u),r.appendChild(s),r.appendChild(c),i.appendChild(a),i.appendChild(r);const m=document.createElement("button");m.classList.add("saved-config-delete"),m.addEventListener("mouseenter",(e=>{o.style.backgroundColor="var(--md-sys-color-on-secondary)",m.style.backgroundColor="#ff2c2c"})),m.addEventListener("mouseleave",(e=>{m.style.backgroundColor="var(--md-sys-color-error-container)",e.toElement==o||e.toElement==o.querySelector(".saved-config-information")?o.style.backgroundColor="var(--md-sys-color-outline-variant)":o.style.backgroundColor="var(--md-sys-color-on-secondary)"})),m.addEventListener("click",(t=>{confirm("Deleting a config is permanent and cannot be reverted, do you wish to continue?")&&(o.style.opacity="1",async function(t){const n=`${window.location.origin}/preservation/${t}`,o=await PydioApi._PydioRestClient.getOrUpdateJwt();return fetch(n,{method:"DELETE",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${o}`}}).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return e.json()})).then((t=>{if(t)return e(),t;throw new Error("Delete operation failed.")})).catch((e=>{console.error("Fetch error:",e),Curate.ui.modals.curatePopup({title:"Error",type:"error",content:"There was an error deleting your configuration. Please try again, or contact support if the problem persists."}).fire()}))}(n.id).then((e=>{console.info("Delete successful:",e),o.style.animation="none",o.offsetWidth,o.style.animation="config-slide-and-fade-in 0.4s forwards reverse",setTimeout((e=>{o.remove()}),400)})).catch((e=>{o.style.animation="delete-failed-shake-animation 0.5s 0s infinite";const t=o.style.backgroundColor;o.style.backgroundColor="red",console.error("Delete failed:",e),setTimeout((()=>{o.style.animation="none",o.style.backgroundColor=t}),500)})))})),m.textContent="Delete Config";const h=document.createElement("div");h.classList.add("config-bookmark-container"),h.addEventListener("click",(e=>{e.target.classList.contains("mdi-star-outline")?(console.info("bookmarked!"),localStorage.setItem(n.id,JSON.stringify({name:n.name,bookmarked:!0})),e.target.classList.remove("mdi-star-outline"),e.target.classList.add("mdi-star")):e.target.classList.contains("mdi-star")&&(console.info("un-bookmarked!"),localStorage.setItem(n.id,JSON.stringify({name:n.name,bookmarked:!1})),e.target.classList.remove("mdi-star"),e.target.classList.add("mdi-star-outline"))}));const g=document.createElement("span"),f=JSON.parse(localStorage.getItem(n.id.toString()));f&&f.bookmarked?g.classList.add("mdi-star"):g.classList.add("mdi-star-outline"),h.appendChild(g),o.appendChild(h),o.appendChild(i),o.appendChild(m),t.appendChild(o)}));const i=t.querySelectorAll(".saved-config-item");if(i?.forEach(((e,t)=>e.style.animationDelay=.55*t/i.length+"s")),i?.forEach(((e,t,n)=>{const o=.05*(t+1),i=1-o;e.style.animationDelay=`${o}s`,e.style.animationDuration=`${i}s`})),!o||0==o?.length){const e=document.createElement("div");e.textContent="No Saved Preservation Configs Found",e.style.margin="3em",e.style.width="80%",e.style.height="10%",e.style.textAlign="center",e.style.display="flex",e.style.color="white",e.style.background="var(--md-sys-color-outline-variant-50)",e.style.justifyContent="center",e.style.alignItems="center",e.style.borderRadius="1.5em",n.appendChild(e)}}function a(e,t){const n=document.createElement("div");if(n.classList.add("input-container"),"info"===e.type){const t=document.createElement("div");t.classList.add("config-info"),t.textContent=e.text,n.appendChild(t)}if("text"===e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const o=document.createElement("input");o.id=e.name,o.setAttribute("type","text"),o.classList.add("config-text-input"),n.appendChild(t),n.appendChild(o)}else if("toggle"===e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const o=document.createElement("input");o.setAttribute("type","checkbox"),o.classList.add("tgl"),o.classList.add("tgl-light"),o.id=e.name;const i=document.createElement("label");i.classList.add("tgl-btn"),i.htmlFor=e.name,n.appendChild(t),n.appendChild(o),n.appendChild(i)}else if("dropdown"===e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const o=document.createElement("select");o.id=e.name,o.classList.add("config-dropdown-select"),e.options.forEach((e=>{const t=document.createElement("option");t.value=e,t.textContent=e,o.appendChild(t)})),n.appendChild(t),n.appendChild(o)}else if("slider"==e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const i=document.createElement("div");i.classList.add("config-slider-container");const a=document.createElement("div");a.classList.add("config-slider-value"),a.textContent=e.min;const r=document.createElement("input");r.id=e.name,r.setAttribute("type","range"),r.classList.add("config-slider"),r.setAttribute("min",e.min),r.setAttribute("max",e.range),r.setAttribute("step",e.step),r.setAttribute("value",e.min);const s=document.createElement("div");s.classList.add("config-slider-minmax-container");const l=document.createElement("span");l.classList.add("config-slider-minmax"),l.textContent=e.min;const d=document.createElement("span");d.classList.add("config-slider-minmax"),d.textContent=e.range,r.addEventListener("input",(()=>{const e=r.value;a.textContent=e})),s.appendChild(l);for(var o=0;o{const n=e.name;t.target.id==n&&(t.target.checked?e.suboptions.forEach((e=>{if("info"==e.type)return;const t="#"+e.name;document.querySelector(t).disabled=!1,document.querySelector(t).parentElement.style.opacity="1"})):e.suboptions.forEach((e=>{if("info"==e.type)return;const t="#"+e.name;document.querySelector(t).disabled=!0,document.querySelector(t).checked=!1,document.querySelector(t).parentElement.style.opacity="0.3"})))})),t.appendChild(n),e.suboptions&&e.suboptions.forEach((e=>{a(e,n),setTimeout((t=>{if("info"==e.type)return;const n="#"+e.name;document.querySelector(n).disabled=!0,document.querySelector(n).parentElement.style.opacity="0.3"}),50)}))}const r=[{category:"Details",inputs:[{label:"Config Name",name:"name",type:"text"},{label:"Config Description",name:"description",type:"text"}]},{category:"Normalisation",inputs:[{label:"Normalise Objects",name:"normalize",type:"toggle",suboptions:[{label:"Image Normalisation Format",name:"image_normalization_tiff",type:"dropdown",options:["TIFF","JPEG2000"]}]}]},{category:"Dissemination",inputs:[{label:"Create Dissemination Package",name:"dip_enabled",type:"toggle",suboptions:[{label:"Dissemination Information",name:"dip_info",type:"info",text:"Create dissemination packages from AIPs generated by this config. Created DIPs will automatically be connected to the linked description of the source data. For this option to work, you must configure a connected AtoM instance."},{label:"Go to AtoM Configuration",name:"atom_config",type:"button",text:"Go to AtoM Configuration",onclick:e=>{Curate.ui.modals.curatePopup({title:"Connect to Your AtoM Instance"},{afterLoaded:e=>{const t=document.createElement("connect-to-atom");e.querySelector(".config-main-options-container").appendChild(t)}}).fire()}}]}]},{category:"Packaging and Compression",inputs:[{label:"AIP Packaging Type",name:"process_type",type:"dropdown",options:["standard","eark"]},{label:"Compress AIPs",name:"compress_aip",type:"toggle",suboptions:[{label:"Warning",name:"compression_warning",type:"info",text:"Compressing AIPs will make their contents unsearchable and prevent descriptive metadata from being reassociated with output objects. You can compress your AIPs for distribution or deep-storage while conserving the uncompressed AIP by right-clicking an AIP in a workspace."},{label:"Compression Algorithm",name:"compression_algorithm",type:"dropdown",options:["tar","tar_bzip2","tar_gzip","s7_copy ","s7_bzip2","s7_lzma"]},{label:"Compression Level",name:"compression_level",type:"slider",min:1,range:9,step:1}]}]},{category:"Transfer Options",inputs:[{label:"Generate Transfer Structure Report",name:"gen_transfer_struct_report",type:"toggle"},{label:"Document Empty Directories",name:"document_empty_directories",type:"toggle"},{label:"Extract Packages",name:"extract_packages",type:"toggle",suboptions:[{label:"Delete Packages After Extraction",name:"delete_packages_after_extraction",type:"toggle"}]}]}];window.addEventListener("load",(t=>{!async function(){try{await((e,t=50)=>new Promise((n=>{const o=setInterval((()=>{void 0!==window[e]&&(clearInterval(o),n(window[e]))}),t)})))("PydioApi");e()}catch(e){console.error("An error occurred:",e)}}(),setTimeout((()=>{document.addEventListener("mousedown",(e=>{document.querySelector('.context-menu [role="menu"]')&&document.querySelector('.context-menu [role="menu"]').contains(e.target)||document.querySelector(".main-files-list")&&(3==e.which&&document.querySelector(".main-files-list").contains(e.target)?document.querySelector('.context-menu [role="menu"]')&&!document.querySelector("#preservationConfigDropdown")?setTimeout((()=>{o(document.querySelector('.context-menu [role="menu"]'))}),100):function(e){if(document.querySelector("#\\/recycle_bin")&&document.querySelector("#\\/recycle_bin").contains(e.target))return void(document.querySelector("#preservationConfigDropdown")&&document.querySelector("#preservationConfigDropdown").remove());const t=new MutationObserver((e=>{e.forEach((e=>{e.addedNodes.forEach((e=>{if(e.nodeType===Node.ELEMENT_NODE){const n=e.querySelector('.context-menu [role="menu"]');n&&(o(n),t.disconnect())}}))}))}));t.observe(document.body,{childList:!0,subtree:!0,once:!0})}(e):document.querySelector("#preservationConfigDropdown")&&setTimeout((()=>{document.querySelector("#preservationConfigDropdown")&&document.querySelector("#preservationConfigDropdown").remove()}),150))}),150)}))}))},627:()=>{document.addEventListener("change",(function(e){if(1===pydio._dataModel._selectedNodes.length&&e.target.nextElementSibling?.textContent.includes("Enable OAI Harvesting")&&"checkbox"===e.target.type){const t=e.target.nextElementSibling?.textContent.includes("Enable OAI-PMH Harvesting"),n=pydio._dataModel._selectedNodes[0],o=!n._isLeaf;t&&o&&Curate.ui.modals.curatePopup({title:"Send Update to Children",buttonType:"okCancel"},{afterLoaded:e=>{e.querySelector(".config-main-options-container").appendChild(function(){const e=document.createElement("div");e.style="margin: 12px 0px 6px;";const t=document.createElement("div");t.style="cursor: pointer; position: relative; overflow: visible; display: table; height: 52px; width: 100%; background-color: var(--md-sys-color-surface-variant); border-radius: 4px; margin-top: 8px; font-size: 15px; padding: 15px 10px 4px;";const n=document.createElement("input");n.type="checkbox",n.id="inheritValues",n.checked=!1,n.style="position: absolute; cursor: inherit; pointer-events: all; opacity: 0; width: 100%; height: 100%; z-index: 2; left: 0px; box-sizing: border-box; padding: 0px; margin: 0px;";const o=document.createElement("div");o.style="display: flex; width: 100%; height: 100%;";const i=document.createElement("div");i.style="transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; float: left; position: relative; display: block; flex-shrink: 0; width: 36px; margin-right: 8px; margin-left: 0px; padding: 4px 0px 6px 2px;";const a=document.createElement("div");a.style="transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; width: 100%; height: 14px; border-radius: 30px; background-color: var(--md-sys-color-outline-variant);";const r=document.createElement("div");r.style="color: rgb(25, 28, 30); background-color: var(--md-sys-color-primary); transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; box-sizing: border-box; font-family: Roboto, sans-serif; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 6px, rgba(0, 0, 0, 0.12) 0px 1px 4px; border-radius: 50%; position: absolute; top: 1px; left: 100%; width: 20px; height: 20px; line-height: 24px; margin-left: -20px;";const s=document.createElement("label");return s.style="float: left; position: relative; display: block; width: calc(100% - 46px); line-height: 24px; color: rgb(25, 28, 30); font-family: Roboto, sans-serif;",s.textContent="Update Children With New Value ",i.appendChild(a),i.appendChild(r),o.appendChild(i),o.appendChild(s),t.appendChild(n),t.appendChild(o),e.appendChild(t),n.addEventListener("change",(function(){n.checked?(a.style.backgroundColor="rgba(0, 102, 137, 0.5)",r.style.left="100%",s.textContent="Update Children With New Value (yes)"):(r.style.left="55%",a.style.backgroundColor="var(--md-sys-color-outline-variant)",s.textContent="Update Direct Descendant Files With New Value (no)")})),n.dispatchEvent(new Event("change")),e}())},onOk:()=>{const t=this.querySelector("#inheritValues[type='checkbox']");if(t&&t.checked){(async function(e,t=100){const n=async(e,n=0)=>{const o={NodePaths:[e+"/*"],Limit:t.toString(),Offset:n.toString()};return await Curate.api.fetchCurate("/a/tree/stats","POST",o)};let o=[],i=0,a=!0;for(;a;){const r=(await n(e,i)).Nodes||[];o=o.concat(r),a=r.length===t,i+=r.length}return o})(Curate.workspaces.getOpenWorkspace()+"/"+n._path).then((t=>{const n=[];t.forEach((e=>"LEAF"===e.Type?n.push(e.Uuid):null));var o,i;(o=n,i=50,Array.from({length:Math.ceil(o.length/i)},((e,t)=>o.slice(t*i,t*i+i)))).forEach((t=>{const n=((e,t)=>({MetaDatas:e.map((e=>({NodeUuid:e,Namespace:"usermeta-export-oai-harvest-enabled",JsonValue:t.toString(),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]}))),Operation:"PUT"}))(t,e.target.checked);Curate.api.fetchCurate("/a/user-meta/update","PUT",n)}))})).catch((e=>{console.error("Error retrieving nodes:",e)}))}}}).fire()}}))},93:()=>{const e={upload:{enforceWorkspaceUpload:{event:"drop",target:document,description:"enforce workspace upload permissions for standard users",handler:e=>{pydio.user.getIdmUser().then((t=>{if(!["quarantine","personal-files","common files"].includes(Curate.workspaces.getOpenWorkspace())&&!t.Roles.find((e=>e.Label="Admin"))&&e.dataTransfer?.files.length>0){e.stopImmediatePropagation();const t="
\n

Please upload your content to the Quarantine workspace instead. This will ensure your content is correctly scanned for malware before being released into the system.

\n

You can also upload your content to the Personal and Common Files workspaces, which is scanned for malware once but will not be quarantined and cannot be released into the system.

\n
";Curate.ui.modals.curatePopup({title:"You do not have permission to upload to this workspace",type:"warning",content:t}).fire()}}))}}},sharedSite:{enforceNoCustomActions:{event:"readystatechange",target:document,description:"enforce no custom actions for shared sites",handler:e=>{if(console.log("shared site enforce no custom actions"),window.location.pathname.includes("/public/"),window.location.pathname.includes("/public/")){const e=document.querySelector(".toolbars-button-menu.action-group_more_action"),t=Array.from(document.querySelector("#main-toolbar").children).find((e=>"button"===e.type&&e.querySelector(".action-local_toggle_theme"))),n=Array.from(document.querySelectorAll(".toolbars-button-menu")).find((e=>1==e.classList.length));e&&e.remove(),t&&t.remove(),n&&n.remove()}}}},move:{}};document.addEventListener("DOMContentLoaded",(t=>{var n;n=e,Object.entries(n).forEach((([e,t])=>{Object.entries(t).forEach((([t,{event:o,target:i,handler:a}])=>{console.log("attaching event handler",n[e][t]);try{i.addEventListener(o,a)}catch(o){console.error("could not attach: ",n[e][t])}}))}))}))},937:()=>{const e=[e=>e.querySelector(".icomoon-cells")?.closest("button"),e=>e.querySelector(".layout-fill")];window.addEventListener("load",(function t(){if(window.location.pathname.includes("/login")){const e=new MutationObserver((()=>{window.location.pathname.includes("/login")||(e.disconnect(),t())}));e.observe(document.documentElement,{childList:!0,subtree:!0})}else pydio?.user?(pydio.user.isAdmin||pydio.observe("context_changed",(t=>{if("Settings"===t._label){const t=new MutationObserver((()=>{let n=!1;e.forEach((e=>{const t=e(document);t&&(t.remove(),n=!0)})),n&&t.disconnect()}));t.observe(document.body,{childList:!0,subtree:!0})}})),window.removeEventListener("load",t)):setTimeout(t,100)}))},678:()=>{const e=e=>{try{return pydio._dataModel._selectedNodes[0]._metadata.get(e)||null}catch(e){return null}},t=(e,t,n,o)=>{const i=Curate.workspaces.getOpenWorkspace();return n&&"File has not been scanned"!=e||"quarantine"!=i||"Scan Limit Exceeded"===n?n&&"File has not been scanned"!=e||"quarantine"===i||"Scan Limit Exceeded"===n?"Quarantined"==n?`File in quarantine, current period: ${(e=>Math.floor((new Date-new Date(e))/864e5))(o)} days.`:"Scan Limit Exceeded"==n?"File is too large to be scanned.":"Passed"!=n||"personal-files"!=i&&"common files"!=i?"Passed"==n?"File has passed an initial scan but will not be scanned again, please move it into the Quarantine workspace.":"Released"==n?"File has been released from quarantine.":"Risk"==n?"File has not completed its quarantine period and is at risk.":void 0:`File has passed the ${i.replace("-"," ")} scan.`:"This file has not been scanned and is at risk. Please move it into the Quarantine workspace to be scanned.":"This file has not been scanned and is at risk."},n=(e,t)=>{const n=(e,t,n={})=>{const o=document.createElement("div");return o.className=e,o.textContent=t,Object.assign(o.style,n),o},o=n("infoPanelRow",null,{padding:"0px 16px 6px"}),i=n("infoPanelLabel",e,{fontWeight:"415"}),a=n("infoPanelValue",t);return o.appendChild(i),o.appendChild(a),o};function o(o){var i=e("files")?.[0]?.matches?.[0]?.id??"File has not been characterised",a=["usermeta-virus-scan-first","usermeta-virus-scan-second"].map((t=>e(t)||"File has not been scanned")),r=pydio._dataModel._selectedNodes[0]._metadata.get("etag");r.endsWith("-1")&&(r="Local hash");var s=e("mime");const l=e("usermeta-virus-scan"),d=e("usermeta-virus-scan-passed-date");var c=t(...a,l,d);setTimeout((function(){let e=document.createElement("div");e.style.marginTop="-11px",e.id="curateAdditionalInfo";let t=n("Pronom ID",i);"File has not been characterised"!==i&&(t.style.cursor="pointer",t.style.transition="all 0.2s ease-in-out",t.addEventListener("mouseenter",(e=>{t.style.textDecoration="underline",t.style.backgroundColor="rgba(153, 153, 153, 0.2)"})),t.addEventListener("mouseleave",(e=>{t.style.textDecoration="none",t.style.backgroundColor="transparent"})),t.addEventListener("click",(e=>{window.open(`https://www.nationalarchives.gov.uk/pronom/${i}`)})));let l=n("First virus scan result",a[0]),d=n("Second virus scan result",a[1]),p=(n("Mimetype",s),n("Status",c));o.querySelector(".panelContent").childNodes.forEach((e=>{e.innerText.includes("ETag")&&(e.firstChild.innerText="Checksum",e.querySelector(".infoPanelValue").innerText=r)}));let u=document.createElement("HR"),m=document.createElement("div"),h=document.createElement("div");h.style.marginBottom="5px",m.textContent="Quarantine Info",m.id="quarantineInfoLabel",m.style.color="rgb(77, 122, 143)",m.style.fontSize="14px",m.style.fontWeight="500",m.style.marginLeft="15px",m.style.marginBottom="10px",e.appendChild(t),e.appendChild(u),e.appendChild(m),e.appendChild(p),e.appendChild(l),e.appendChild(d),e.appendChild(h),o.querySelector("#curateAdditionalInfo")?(Array.from(document.querySelectorAll(".panelCard")).find((e=>e.textContent.includes("File Info")))?.querySelector("#curateAdditionalInfo")?.remove(),o.appendChild(e)):o.appendChild(e)}),5)}const i=(e,t)=>{t=Array.from(document.querySelectorAll(".panelCard")).find((e=>e.textContent.includes("File Info")));e.memo._selectedNodes&&0!=e.memo._selectedNodes.length&&e.memo._selectedNodes[0]!=a&&t&&t.querySelector(".panelContent")&&(o(t),a=e.memo._selectedNodes[0])};var a;const r=e=>{if(e)return pydio._dataModel._observers.selection_changed.includes(i)||pydio._dataModel.observe("selection_changed",(e=>{i(e)})),e.firstElementChild.addEventListener("click",(t=>{e.querySelector('[class*="mdi-chevron-"]').classList.contains("mdi-chevron-up")||e.querySelector('[class*="mdi-chevron-"]').classList.contains("mdi-chevron-down")})),function(e,t){if(!e||!e.parentElement)return void console.error("The element or its parent is not defined.");const n=new MutationObserver((o=>{for(let i of o)if(i.removedNodes.length)for(let o of i.removedNodes)if(o===e||o.contains(e))return t(),void n.disconnect()}));n.observe(e.parentElement,{childList:!0,subtree:!0})}(e.querySelector(".panelContent"),(()=>{e.querySelector("#curateAdditionalInfo").remove()})),void(e.querySelector(".panelContent")&&o(e))};new MutationObserver(((e,t)=>{for(const t of e)if("childList"===t.type)for(const e of t.addedNodes)e instanceof HTMLElement&&e.classList.contains("panelCard")&&e.innerText.includes("File Info")?r(e):e instanceof HTMLElement&&e.classList.contains("panelContent")&&e.parentElement.classList.contains("panelCard")&&e.parentElement.innerText.includes("File Info")&&r(e.parentElement)})).observe(document.documentElement,{childList:!0,subtree:!0})},663:()=>{window.addEventListener("load",(function(){new Promise(((e,t)=>{!function t(){"undefined"!=typeof pydio?e():setTimeout(t,100)}()})).then((()=>{pydio._dataModel.observe("selection_changed",(function(e){setTimeout((()=>{const e=document.querySelector("#info_panel > div");e&&e.scrollTo({top:0,left:0})}),50)}))}))}))},711:()=>{const e=window.curateDistrobution||"Soteria+",t=()=>{console.log("message modifier");const n=pydioBootstrap.parameters.get("i18nMessages");Object.keys(n).forEach((t=>{"string"==typeof n[t]&&(n[t]=n[t].replace(/Pydio\s*Cells/gi,e).replace(/(?{function e(e){let t=document.createElement("div"),n=document.createElement("button"),o=document.createElement("span"),i=document.createElement("text"),a=document.createElement("hr");i.textContent=e,i.style.marginTop="1em",o.style.ariaHidden="true",o.innerHTML="×",n.style.ariaLabel="Close alert",n.style.type="button",n.style.backgroundColor="white",n.style.border="0",n.style.position="absolute",n.style.top="0",n.style.right="0",n.onclick=function(){this.parentNode.className="slideOut",setTimeout((function(){t.remove()}),1e3)},n.appendChild(o),t.style.backgroundColor="white",t.style.borderRadius="0.5em",t.style.width="16em",t.style.height="auto",t.style.padding="1.8em",t.style.paddingBottom="0em",t.style.margin="2em",t.style.position="absolute",t.style.bottom="5em",t.style.right="0",t.style.boxShadow="0 10px 16px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19)",t.className="slideIn",a.style.borderTop="1px solid black",a.style.marginTop="1em",a.className="lineLoad",n.appendChild(o),t.appendChild(n),t.appendChild(i),t.appendChild(a),document.querySelector("body").appendChild(t),setTimeout((function(){t.classList.remove("slideIn")}),1e3),setTimeout((function(){t.className="slideOut",setTimeout((function(){t.remove()}),1e3)}),6e3)}let t=e=>new Promise((t=>setTimeout(t,e)));function n(){setTimeout((function(){let e=["Generate mimetype report","Export Archivematica JSON"];for(let t=0;t{window.addEventListener("load",(function(){var t=Object.fromEntries(pydioBootstrap.parameters).i18nMessages;Object.entries(e).forEach((function(e){t[e[0]]=e[1]}))}));var e={"ajax_gui.tour.welcomemodal.title":"Welcome to Curate","ajax_gui.tour.welcomemodal.subtitle":"Drag'n'drop a photo of you for your profile! This quick tour will guide you through the web interface.","ajax_gui.tour.welcomemodal.start":"Start the tour","ajax_gui.tour.workspaces.1":"Workspaces are top-level folders that help you manage your archiving workflow and organise your data. The Personal Files workspace can only be accessed by you and the Quarantine, Appraisal and Archive workspaces are shared with your workgroup. The Package Templates workspace is common to all accounts and is read only.","ajax_gui.tour.workspaces.2":"You can upload into the Personal Files and Quarantine workspaces, move files to Appraisal to work on them and deposit packages in the Archive when you are finished.","ajax_gui.tour.globsearch.title":"Global Search","ajax_gui.tour.globsearch.1":"Use this search form to find files or folders in any workspace. Only the first 5 results are shown, enter a workspace to get more results, and more search options. Tip: you can use an asterisk as a wild card.","ajax_gui.tour.globsearch.2":"When no search is entered, the history of your recently accessed files and folder is displayed instead.","ajax_gui.tour.openworkspace.title":"Open a workspace","ajax_gui.tour.openworkspace":"At the first connection, your history is probably empty. Enter the Personal or Quarantine workspaces to start adding files. Tip: files are virus checked when they are uploaded and should be kept in Quarantine for 30 days, after which they are scanned again.","ajax_gui.tour.create-menu.title":"Add files","ajax_gui.tour.create-menu":"Start adding new files or folders to the current workspace.","ajax_gui.tour.display-bar.title":"Display Options","ajax_gui.tour.display-bar":"This toolbar allows you to change the display: switch to thumbnails or detail mode depending on your usage, and sort files by name, date, etc...","ajax_gui.tour.infopanel.title":"Info Panel","ajax_gui.tour.infopanel.1":"Here, you will find a preview and comprehensive information about your current selection: file information, virus scan status, metadata, etc.","ajax_gui.tour.infopanel.2":"You can close this panel by using the info button in the display toolbar","ajax_gui.tour.uwidget.title":"User Settings","ajax_gui.tour.uwidget.addressbook":"Directory of all the users accessing to the platform. Create your own users, and constitute teams that can be used to share resources","ajax_gui.tour.uwidget.alerts":"Alerts panel will inform you when a user with whom you shared some resources did access it. They can be sent to you directly by email.","ajax_gui.tour.uwidget.menu":"Access to other options : manage your profile and password, view all of the public links you have created, send a support message, configure the Archivematica Connector and sign out of the platform.","ajax_gui.tour.uwidget.home":"Go back to the welcome panel with this button"}},92:()=>{[{name:"he",url:"https://cdn.jsdelivr.net/npm/he@1.2.0/he.min.js"},{name:"swal",url:"https://cdn.jsdelivr.net/npm/sweetalert2@11"},{name:"papaparse",url:"https://cdn.jsdelivr.net/npm/papaparse@5.4.1/papaparse.min.js"},{name:"chart.js",url:"https://cdn.jsdelivr.net/npm/chart.js"},{name:"spark-md5",url:"https://cdnjs.cloudflare.com/ajax/libs/spark-md5/3.0.2/spark-md5.min.js"}].forEach((e=>{let t=document.createElement("script");t.src=e.url,t.onerror=function(){console.error("Failed to load external library: ",e.name,"please reload the page or contact your admin if the issue persists.")},document.head.appendChild(t)}))},380:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.apiKey="",this.atomUrl="",this.username="",this.password="",this.retrieveDetails(),this.render()}async retrieveDetails(){try{const e=await Curate.api.fetchCurate("/api/atom","GET");this.apiKey=e.atom_api_key,this.atomUrl=e.atom_url,this.username=e.atom_username,this.password=e.atom_password,this.render()}catch(e){console.error("Error retrieving details from Atom:",e)}}saveDetails(e){e.preventDefault(),Curate.api.fetchCurate("/api/atom","POST",{atom_api_key:this.apiKey,atom_url:this.atomUrl,atom_username:this.username,atom_password:this.password}).then((e=>{console.log("Saved Atom details:",e)})).catch((e=>{console.error("Error saving Atom details:",e)})),""!==this.apiKey&&(localStorage.setItem("atom_api_key",this.apiKey),console.log("Saving API Key:",this.apiKey)),""!==this.atomUrl&&(localStorage.setItem("atom_url",this.atomUrl),console.log("Saving Atom URL:",this.atomUrl)),""!==this.username&&(localStorage.setItem("atom_username",this.username),console.log("Saving Atom Username:",this.username)),""!==this.password&&(localStorage.setItem("atom_password",this.password),console.log("Saving Atom Password:",this.password)),this.render()}handleApiKeyChange(e){this.apiKey=e.target.value}handleUrlChange(e){this.atomUrl=e.target.value}handleUsernameChange(e){this.username=e.target.value}handlePasswordChange(e){this.password=e.target.value}togglePasswordVisibility(){const e=this.shadowRoot.querySelector("#password"),t=this.shadowRoot.querySelector("#toggle-password");"password"===e.type?(e.type="text",t.textContent="Hide"):(e.type="password",t.textContent="Show")}render(){this.shadowRoot.innerHTML=`\n \n
\n
\n
\n Current API Key:\n ${"*".repeat(this.apiKey?.length)||"Not Set"}\n
\n
\n Current Atom URL:\n ${this.atomUrl||"Not Set"}\n
\n
\n Current Username:\n ${this.username||"Not Set"}\n
\n
\n Current Password:\n ${"*".repeat(this.password?.length)||"Not Set"}\n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n \n
\n \n
\n
\n `,this.shadowRoot.querySelector("#details-form").addEventListener("submit",(e=>this.saveDetails(e))),this.shadowRoot.querySelector("#api-key").addEventListener("input",(e=>this.handleApiKeyChange(e))),this.shadowRoot.querySelector("#atom-url").addEventListener("input",(e=>this.handleUrlChange(e))),this.shadowRoot.querySelector("#username").addEventListener("input",(e=>this.handleUsernameChange(e))),this.shadowRoot.querySelector("#password").addEventListener("input",(e=>this.handlePasswordChange(e))),this.shadowRoot.querySelector("#toggle-password").addEventListener("click",(()=>this.togglePasswordVisibility()))}}customElements.define("connect-to-atom",e)},543:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.atomUrl=null,this.criteria=[{id:0,query:"",field:"",operator:""}],this.results=[],this.criterionIndex=1,this.node=null,this.error=null,this.isLoading=!1,this.currentPage=1,this.totalResults=0,this.resultsPerPage=10,this.initialise(),this.render()}async initialise(){this.atomUrl=await this.getAtomUrl()}setNode(e){this.node=e,this.render()}addCriterion(){this.criteria.push({id:this.criterionIndex,query:"",field:"",operator:"and"}),this.criterionIndex++,this.render()}removeCriterion(e){this.criteria=this.criteria.filter((t=>t.id!==e)),this.render()}handleInputChange(e,t,n){this.criteria=this.criteria.map((o=>o.id===e?{...o,[t]:n}:o));const o=this.shadowRoot.querySelector(`[data-id="${e}"][data-field="${t}"]`);o&&(o.value=n)}async performSearch(e=1){this.isLoading=!0,this.error=null,this.currentPage=e,this.render();const t=new URLSearchParams;this.criteria.forEach(((e,n)=>{n>0&&t.append(`so${n}`,e.operator),t.append(`sq${n}`,e.query),t.append(`sf${n}`,e.field)})),t.append("topLod",0),t.append("skip",(e-1)*this.resultsPerPage);try{const e=`${window.location.protocol}//${window.location.hostname}/api/atom/search`,n=await PydioApi._PydioRestClient.getOrUpdateJwt(),o=await fetch(`${e}?${t.toString()}`,{headers:{Authorization:`Bearer ${n}`}});if(!o.ok)throw new Error(`HTTP error! status: ${o.status}`);const i=await o.json();console.log("Retrieved results:",i),this.results=i.results,this.totalResults=i.total}catch(e){console.error("Error performing search:",e),this.error=`An error occurred while searching: ${e.message}`}finally{this.isLoading=!1,this.render()}}handleResultClick(e){console.log("Result clicked:",e);var t=[];if(!this.node)throw new Error("No node set");console.log("node to link to:",this.node),t.push({NodeUuid:this.node._metadata.get("uuid"),JsonValue:JSON.stringify(e),Namespace:"usermeta-atom-linked-description",Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]}),Curate.api.fetchCurate("/a/user-meta/update","PUT",{MetaDatas:t,Operation:"PUT"}),this.dispatchEvent(new CustomEvent("description-linked",{detail:e})),this.remove()}toggleAccordion(e){e.classList.toggle("collapsed");const t=e.nextElementSibling,n=e.querySelector(".chevron");t.classList.contains("show")?(t.classList.remove("show"),n.classList.remove("down"),localStorage.setItem("accordionState","true")):(t.classList.add("show"),n.classList.add("down"),localStorage.setItem("accordionState","false"))}renderPagination(){const e=Math.ceil(this.totalResults/this.resultsPerPage);let t="";if(e>1){t+='
',t+='
Showing results '+((this.currentPage-1)*this.resultsPerPage+1)+" - "+Math.min(this.currentPage*this.resultsPerPage,this.totalResults)+" of "+this.totalResults+"
",t+='",t+="
"}return t}getPageRange(e,t){let n=[];const o=e-2,i=e+2+1;for(let e=1;e<=t;e++)(1===e||e===t||e>=o&&e1===e||e===t||(!i[o-1]||i[o-1]+1===e||(n.splice(o,0,null),!0)))),n}async getAtomUrl(){return Curate.api.fetchCurate(":6900/atom","GET").then((e=>e.atom_url))}render(){this.shadowRoot.innerHTML=`\n \n
\n \n
\n
\n

This interface allows you to search for descriptions in your AtoM instance using a set of search criteria.

\n

You can add as many search criteria as you like, and then perform a search to find descriptions that match your criteria.

\n

Once you have found a description, you can link it to your selected node in Curate.

\n

Please note: only the top-level linked description will be considered when associating your dissemination package with AtoM.

\n

For example, if you create an AIP from a folder containing multiple files, only the folder itself will be checked for a linked description.

\n

AtoM automatically links the sub-files or folders as child level descendants of the top-level linked description.

\n
\n
\n
\n
\n
\n ${this.criteria.map(((e,t)=>`\n
\n ${t>0?`\n \n `:""}\n \n \n \n
\n `)).join("")}\n
\n \n \n\n ${this.isLoading?'
':""}\n \n ${this.error?`
${this.error}
`:""}\n\n
\n ${0!==this.results.length||this.isLoading||this.error?this.results.map((e=>`\n
\n
\n

${e.title}

\n

Reference code: ${e.reference_code}

\n

Level of description: ${e.level_of_description}

\n

URL: ${this.atomUrl}/${e.slug}

\n \n
\n ${e.thumbnail_url?`\n \n `:""}\n
\n `)).join(""):"

No results found. Please try a different search.

"}\n
\n ${this.renderPagination()}\n
\n \n `}}customElements.define("atom-search-interface",e)},738:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this.render(),console.log("connected help"),this.updateContent()}render(){this.shadowRoot.innerHTML='\n \n
\n '}updateContent(){const e=Curate.contextualHelp.context;this.shadowRoot.querySelector(".help-content").textContent=this.getHelpContent(e)}getHelpContent(e){const{page:t,lastRightClickedElement:n,selection:o}=e,i=o&&o.length>0;n&&n.tagName.toLowerCase();return!0===i?`You've selected ${o.length} item(s). This area allows you to perform actions on your selection.`:`You're on the ${t} page. Right-click on elements to see context-specific help.`}}customElements.define("contextual-help",e)},523:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.processQueue=[],this.runningProcesses=new Map,this.maxConcurrent=5}connectedCallback(){this.render(),this.processQueueInterval=setInterval((()=>this.processQueuedItems()),1e3)}disconnectedCallback(){clearInterval(this.processQueueInterval)}render(){this.shadowRoot.innerHTML='\n \n
\n '}addToQueue(e){const t={id:this.generateUniqueId(e),node:e,status:"queued",title:`Queued: ${e._metadata.get("usermeta-import-oai-link-id")}`,details:`Repository: ${e._metadata.get("usermeta-import-oai-repo-url")}`,nodeTitle:e._label};this.processQueue.push(t),this.updateStatusCard(t)}async processQueuedItems(){for(;this.runningProcesses.size0;){const e=this.processQueue.shift();this.runningProcesses.set(e.id,e),this.initiateHarvest(e)}}async initiateHarvest(e){const{node:t,id:n}=e,o=t._metadata.get("usermeta-import-oai-repo-url"),i=t._metadata.get("usermeta-import-oai-link-id"),a=t._metadata.get("usermeta-import-oai-metadata-prefix");if(o&&i&&a){this.updateProcessStatus(n,"loading",`Harvesting ${i}`,`Repository: ${o}`,0);try{const e=await fetch("http://127.0.0.1:5000/harvest",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({repo_url:o,identifier:i,metadata_prefix:a})});if(!e.ok){const t=await e.json();throw{message:t.error,data:t.data}}const r=await e.json(),s=this.convertJson(r);await Curate.api.files.updateMetadata(t,s),this.updateProcessStatus(n,"success",`Harvested ${i}`,`Successfully processed data from ${o}${i}`,100)}catch(e){this.updateProcessStatus(n,"error",`Failed to harvest ${i}`,`Error: ${e.message}: ${e.data?e.data:""}`,100)}finally{this.runningProcesses.delete(n)}}else this.updateProcessStatus(n,"error",`Failed to harvest ${i}`,"Repository, identifier, or metadata prefix not found",100)}updateProcessStatus(e,t,n,o,i){const a=this.runningProcesses.get(e)||this.processQueue.find((t=>t.id===e));a&&(Object.assign(a,{status:t,title:n,details:o,progress:i}),this.updateStatusCard(a))}updateStatusCard(e){const t=this.shadowRoot.querySelector(".status-container");let n=t.querySelector(`[data-id="${e.id}"]`);n||(n=document.createElement("div"),n.classList.add("status-item"),n.setAttribute("data-id",e.id),t.appendChild(n));const{status:o,title:i,details:a,progress:r,nodeTitle:s}=e;n.innerHTML=`\n
\n ${i}\n \n
\n
${a}
\n
Node: ${s}
\n ${"loading"===o?`\n
\n
\n
\n `:""}\n `}generateUniqueId(e){return`${e._metadata.get("uuid")}-${e._metadata.get("usermeta-import-oai-link-id")}`}convertJson(e){const t=e.schema,n=e.data;let o=[];for(const e in n)if(Array.isArray(n[e])){let t=n[e].join(", ");o.push({field:e,value:t})}let i={};return i[t]=o,i}processAllNodes(e){e.forEach((e=>this.addToQueue(e)))}}customElements.define("oai-harvest-status",e)}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var a=t[o]={exports:{}};return e[o](a,a.exports,n),a.exports}(()=>{"use strict";const e={fetchCurate:async function(e,t="POST",n){if(!e)throw new Error("No endpoint provided");try{const o=await PydioApi._PydioRestClient.getOrUpdateJwt(),i={method:t,headers:{accept:"application/json","accept-language":navigator.language+",en-GB,en-US;q=0.9,en;q=0.8",authorization:"Bearer "+o,"content-type":"application/json","sec-fetch-dest":"empty","sec-fetch-mode":"cors","sec-fetch-site":"same-origin","x-pydio-language":pydio.user.getPreference("lang")},referrer:window.location.href,referrerPolicy:"strict-origin-when-cross-origin",mode:"cors",credentials:"include"};["GET","HEAD"].includes(t)||(i.body=JSON.stringify(n));const a=await fetch(window.location.origin+e,i);if(!a.ok)throw new Error("Network response was not ok");return await a.json()}catch(e){throw console.error("Curate fetch error:",e),e}},files:{createFiles:async function(e){if(!e)throw new Error("No nodes provided");async function t(e,t){const n={MetaDatas:[],Operation:"PUT"};for(const o in e)"path"!==o&&e[o].forEach((e=>{const i=`usermeta-${o}-${e.field}`,a={NodeUuid:t,Namespace:i,JsonValue:JSON.stringify(e.value),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]};n.MetaDatas.push(a)}));return n}const n=e.nodes.map((async e=>{const t=e.path.split("/").pop(),n=(await Curate.api.fetchCurate("/a/tree/create","POST",{Nodes:[{Path:e.path,Type:"LEAF"}],TemplateUUID:""})).Children[0].Path;return{filename:t,uuid:(await Curate.api.fetchCurate("/a/meta/bulk/get","POST",{Limit:200,NodePaths:[n]})).Nodes[0].Uuid,node:e}})),o=await Promise.all(n);for(const{filename:e,uuid:n,node:i}of o){const e=await t(i,n);await Curate.api.fetchCurate("/a/user-meta/update","PUT",e)}},getFileData:async function(e,t="text"){if(!e)throw new Error("No node provided");try{await PydioApi._PydioRestClient.getOrUpdateJwt();const n=await pydio.ApiClient.buildPresignedGetUrl(e),o=await fetch(n);if(!o.ok)throw new Error("Network response was not ok");if("text"===t)data=await o.text();return data}catch(e){throw console.error("Error fetching object:",e),e}},updateMetadata:async function(e,t){if(!t)throw new Error("No metadata provided");if(!e)throw new Error("No node provided");const n=((e,t)=>{const n={MetaDatas:[],Operation:"PUT"};for(const o in t)t[o].forEach((t=>{const i=`usermeta-${o}-${t.field}`,a={NodeUuid:e._metadata.get("uuid"),Namespace:i,JsonValue:JSON.stringify(t.value),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]};n.MetaDatas.push(a)}));return n})(e,t);return await Curate.api.fetchCurate("/a/user-meta/update","PUT",n)}}},t={getOpenWorkspace:function(){return pydio._dataModel._rootNode._label.toLowerCase()==pydio.user.id.toLowerCase()?"personal-files":pydio._dataModel._rootNode._label.toLowerCase().replace(/^\d+\.\s*/,"")}},o={modals:{curatePopup:function(e,t){const n=e.title,o=e.message,i=e.type,a=e.content,r=e.buttonType||"close",s=t?.afterLoaded||function(){},l=t?.afterClosed||function(){},d=t?.onOk||function(){},c=t?.onCancel||function(){},p={warning:{color:"#FFA500",icon:"mdi-alert"},error:{color:"#FF0000",icon:"mdi-alert-circle"},success:{color:"#008000",icon:"mdi-check-circle"},info:{color:"#0000FF",icon:"mdi-information"}};return{fire:function(){const e=document.createElement("div");e.classList.add("config-modal-container"),e.style.display="flex",e.addEventListener("click",(function(t){y(t,e)}),{once:!0});const t=document.createElement("div");t.classList.add("config-modal-content"),i&&(t.style.borderTop=`4px solid ${p[i].color}`);const u=document.createElement("div");if(u.classList.add("config-popup-title"),i){const e=document.createElement("i");e.classList.add("mdi",p[i].icon),e.style.color=p[i].color,e.style.fontSize="24px",e.style.marginRight="10px",u.appendChild(e)}const m=document.createTextNode(n);u.appendChild(m);const h=document.createElement("div");if(h.classList.add("config-main-options-container"),h.style.width="100%",o){const e=document.createElement("div");e.classList.add("config-popup-message"),e.textContent=o,h.appendChild(e)}if(a){const e=document.createElement("div");e.innerHTML=a,h.appendChild(e)}const g=document.createElement("div");if(g.classList.add("action-buttons"),"okCancel"===r){const t=document.createElement("button");t.classList.add("config-modal-ok-button"),t.textContent="OK",t.addEventListener("click",(()=>{d(),f(e)}));const n=document.createElement("button");n.classList.add("config-modal-cancel-button"),n.textContent="Cancel",n.addEventListener("click",(()=>{c(),f(e)})),g.appendChild(t),g.appendChild(n)}else{const t=document.createElement("button");t.classList.add("config-modal-close-button"),t.textContent="Close",t.addEventListener("click",(()=>{f(e)})),g.appendChild(t)}function f(e){e.remove(),l()}function y(e,t){e.target===t?f(t):t.addEventListener("click",(function(e){y(e,t)}),{once:!0})}t.appendChild(u),t.appendChild(h),t.appendChild(g),e.appendChild(t),document.body.appendChild(e),e.addEventListener("keyup",(function(e){e.stopPropagation()})),s(e)}}}}},i=e=>{const t={"ISAD(G)":({},{sections:[{title:"Identity Statement",fields:["reference code(s)","title","date(s)","level of description","extent and medium of the unit of description"]},{title:"Context",fields:["name of creator(s)","administrative/biographical history","archival history","immediate source of acquisition or transfer"]},{title:"Content And Structure",fields:["scope and content","appraisal, destruction and scheduling information","accruals","system of arrangement"]},{title:"Conditions Of Access And Use",fields:["conditions governing access","conditions governing reproduction","language/scripts of material","physical characteristics and technical requirements","finding aids"]},{title:"Allied Materials",fields:["existence and location of originals","existence and location of copies","related units of description","publication note"]},{title:"Notes",fields:["note"]},{title:"Description Control",fields:["archivists note","rules or conventions","date(s) of descriptions"]}]}),DC:({},{fields:["contributor","coverage","creator","date","description","format","identifier","language","publisher","relation","rights","source","subject","title","type"]})};return e&&e in t?t[e]:e?void console.error("invalid schema"):t},a={schemas:{getSchemas:function(e){return i(e)}}};const r={context:{page:window.location.pathname,lastRightClickedElement:null,selection:null}};function s(e){2===e.button&&(r.context.lastRightClickedElement=e.target,r.context.page=window.location.pathname,r.context.selection=pydio?._dataModel._selectedNodes||null)}window.addEventListener("load",(()=>document.addEventListener("mousedown",s)));const l={api:e,workspaces:t,ui:o,metadata:a,contextualHelp:r};window.Curate=l;n(125),n(678),n(887),n(578);const d=class{constructor(){this.taskQueue=[],this.isProcessing=!1,this.worker=null}initWorker(){this.worker&&this.worker.terminate();this.worker=new Worker("/workers/hashWorker.js"),console.log("Worker initialized: ",this.worker),this.setupWorkerHandlers()}setupWorkerHandlers(){this.worker.onmessage=e=>{console.log("goober: ",e.data),"complete"===e.data.status&&this.currentResolve&&this.currentResolve({file:this.currentFile,hash:e.data.hash,name:this.currentFile.name}),this.processNextTask()},this.worker.onerror=e=>{this.currentReject&&this.currentReject("Worker error: "+e.message),this.processNextTask()}}generateChecksum(e){return new Promise(((t,n)=>{this.taskQueue.push({file:e,resolve:t,reject:n}),this.isProcessing||this.processNextTask()}))}processNextTask(){if(this.taskQueue.length>0){this.worker||this.initWorker();const e=this.taskQueue.shift();this.currentResolve=e.resolve,this.currentReject=e.reject,this.currentFile=e.file,this.isProcessing=!0,this.worker.postMessage({file:e.file,msg:"begin hash"})}else this.isProcessing=!1,this.worker&&(this.worker.terminate(),this.worker=null)}};window.addEventListener("load",(()=>{(async()=>{for(;"undefined"==typeof UploaderModel;)await new Promise((e=>setTimeout(e,100)));const e=new d;console.log("WorkerManager initialized");const t=UploaderModel.UploadItem.prototype.uploadPresigned;function n(e,t,i){Curate.api.fetchCurate("/a/tree/stats","POST",{NodePaths:[e]}).then((a=>{const r=a.Nodes.find((t=>t.Path===e));r?function(e,t,i,a){const r=3;"temporary"===e.Etag&&a{n(i,t,a+1)}),2e3)):e.Etag===t?(console.log("Checksum validation passed."),o(e.Uuid,"usermeta-file-integrity","✓ Integrity verified")):(console.error("Checksum validation failed.","Expected:",t,"Received:",e.Etag),o(e.Uuid,"usermeta-file-integrity","X Integrity compromised"))}(r,t,e,i):console.error("Node not found in response:",e)})).catch((e=>{console.error("Error fetching node stats:",e)}))}function o(e,t,n){const o={MetaDatas:[{NodeUuid:e,Namespace:t,JsonValue:JSON.stringify(n),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]}],Operation:"PUT"};Curate.api.fetchCurate("/a/user-meta/update","PUT",o)}UploaderModel.UploadItem.prototype.uploadPresigned=function(){const o=t.apply(this,arguments),i=t=>{console.log(t),"loaded"===t&&(this._observers.status.forEach(((e,t)=>{e===i&&this._observers.status.splice(t,1)})),console.log("Attempting to generate checksum for: ",this._file),e.generateChecksum(this._file).then((e=>{console.log("Generated checksum data:",e);const t=Math.min(5e3,Math.max(500,.01*this._file.size));setTimeout((()=>{const t=this._targetNode._path,o=t.endsWith("/")?"":"/",i=this._parent._label?`${this._parent._label}/`:"";n(`${Curate.workspaces.getOpenWorkspace()}${t}${o}${i}${this._label}`,e.hash,0)}),t)})).catch((e=>{console.error("Checksum generation failed:",e)})))};return this._observers.status.push(i),o}})()}));n(627),n(937),n(711),n(663),n(543),n(380);class c extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.nodes=[],this.render()}setNodes(e){this.nodes=e,this.render()}render(){this.shadowRoot.innerHTML=`\n \n
\n
\n The selected preservation configuration has DIP generation enabled. The following items do not have a linked AtoM description, which will cause DIP generation to fail.\n
\n
\n ${this.nodes.map((e=>`\n
\n ${e._path}\n \n
\n `)).join("")}\n
\n
\n `,this.shadowRoot.querySelectorAll(".link-button").forEach((e=>{e.addEventListener("click",(()=>{console.log(`Add description for ${e.getAttribute("data-path")}`),Curate.ui.modals.curatePopup({title:"Connect Selected Node to an AtoM Description"},{afterLoaded:t=>{const n=document.createElement("atom-search-interface");n.setNode(this.nodes.find((t=>t._path==e.getAttribute("data-path")))),t.querySelector(".config-main-options-container").appendChild(n),n.addEventListener("description-linked",(n=>{console.log("description linked"),t.remove();const o=document.createElement("div");o.innerHTML="
🔗
",e.parentElement.querySelector(".file-name").after(o),e.remove()}))},afterClosed:()=>{}}).fire()}))}))}}customElements.define("dip-slug-resolver",c);n(738),n(523),n(93),n(92)})()})(); \ No newline at end of file +(()=>{var e={125:()=>{async function e(){const e=`${window.location.origin}/api/preservation`,t=await PydioApi._PydioRestClient.getOrUpdateJwt();return fetch(e,{headers:{Authorization:`Bearer ${t}`},method:"GET"}).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return e.json()})).then((e=>{sessionStorage.setItem("preservationConfigs",JSON.stringify(e))})).catch((e=>{console.error("Fetch error:",e)}))}function t(t,n,o){const s=document.createElement("div");s.id="preservationConfigsSubMenu",s.style.maxHeight="8em",s.style.overflowY="scroll",s.innerHTML=n,o.forEach((e=>{let t=document.createElement("div");const n=JSON.parse(localStorage.getItem(e.id));if(t.style.transition="0.3s ease all",t.addEventListener("mouseenter",(e=>{e.target.style.background="var(--md-sys-color-outline-variant-50)"})),t.addEventListener("mouseleave",(e=>{e.target.style.background="none"})),t.addEventListener("click",(t=>{t.target.classList.contains("mdi-star-outline")?(console.info("bookmarked!"),localStorage.setItem(e.id,JSON.stringify({name:e.name,bookmarked:!0})),t.target.classList.remove("mdi-star-outline"),t.target.classList.add("mdi-star"),s.remove()):t.target.classList.contains("mdi-star")?(console.info("un-bookmarked!"),localStorage.setItem(e.id,JSON.stringify({name:e.name,bookmarked:!1})),t.target.classList.remove("mdi-star"),t.target.classList.add("mdi-star-outline"),s.remove()):(!async function(e){const t=await PydioApi._PydioRestClient.getOrUpdateJwt(),n=`${window.location.origin}/a/scheduler/hooks/a3m-transfer`,o=pydio._dataModel._selectedNodes.map((e=>({path:Curate.workspaces.getOpenWorkspace()+e._path,slug:e._metadata.get("usermeta-atom-linked-description")||""}))),i=JSON.stringify({Paths:o,JobParameters:{ConfigId:e.toString()}});fetch(n,{method:"POST",mode:"cors",headers:{accept:"application/json","accept-language":"en-GB,en-US;q=0.9,en;q=0.8",authorization:`Bearer ${t}`,"cache-control":"no-cache","content-type":"application/json",pragma:"no-cache","sec-fetch-mode":"cors","sec-fetch-site":"same-origin","x-pydio-language":"en-us"},body:i}).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return e.json()})).then((e=>{console.info("Preservation config initiated successfully")})).catch((e=>{console.error("Fetch error:",e)}))}(e.id),s.remove())})),t.innerHTML='
Source Editor
',t.querySelector('[role="menuLabel"]').innerText=e.name,s.querySelector('[role="menu"]').appendChild(t),n&&n.bookmarked){let e=t.querySelector(".mdi-star-outline");e.classList.remove("mdi-star-outline"),e.classList.add("mdi-star")}}));const l=document.createElement("div");l.innerHTML='
Source Editor
',l.querySelector('[role="menuLabel"]').innerText="Create New",l.style.transition="0.3s ease all",l.addEventListener("mouseenter",(e=>{e.target.style.background="var(--md-sys-color-outline-variant-50)"})),l.addEventListener("mouseleave",(e=>{e.target.style.background="none"})),l.addEventListener("click",(t=>{document.querySelector("#preservationConfigsSubMenu").remove(),function(t,n){const o=document.createElement("div");o.classList.add("config-modal-container");const r=document.createElement("div");r.classList.add("config-modal-scroll-container");const s=document.createElement("div");s.classList.add("config-modal-content");const l=document.createElement("div");l.textContent=t,l.classList.add("config-popup-title"),s.appendChild(l);const d=document.createElement("div");d.classList.add("config-main-options-container"),s.appendChild(d),n.forEach((e=>{const t=document.createElement("div");t.classList.add("config-input-category"),t.id=e.category.replaceAll(" ","_");const n=document.createElement("div");n.classList.add("config-text-label"),n.textContent=e.category,t.appendChild(n),e.inputs.forEach((e=>{a(e,t)})),r.appendChild(t)}));const c=document.createElement("button");c.classList.add("config-clear-form"),c.textContent="Clear Form",c.addEventListener("click",(e=>{r.querySelectorAll("input").forEach((e=>{"text"==e.type?e.value="":"checkbox"==e.type?e.checked=!1:e.value=0,e.dispatchEvent(new CustomEvent("change",{bubbles:!0})),e.dispatchEvent(new CustomEvent("input",{bubbles:!0}))}))})),r.appendChild(c);const p=document.createElement("div");p.classList.add("config-options-container"),p.style="display: flex;align-items: center;flex-wrap: nowrap;flex-direction: column;";const u=document.createElement("div");u.classList.add("config-text-label"),u.textContent="Create or Edit Configs",u.style="padding-bottom: 1em !important",p.appendChild(u),p.appendChild(r);const m=document.createElement("div");m.classList.add("config-modal-scroll-container");const h=document.createElement("button");h.classList.add("config-save-button"),h.textContent="Save Config",h.addEventListener("click",(t=>{const o=JSON.parse(sessionStorage.getItem("preservationConfigs")),a=p.querySelector("#name").value,r=n.flatMap((e=>e.inputs.map((e=>e.name)).concat(e.inputs.flatMap((e=>e.suboptions?e.suboptions.map((e=>e.name)):[]))))),s={},l=o?.find((e=>e.name==a));l?s.id=l.id:s.user=pydio.user.id,r.forEach((e=>{const t=document.querySelector("#"+e);t&&"submit"!=t.type&&(t.disabled&&(s[e.toLowerCase()]=!1),"checkbox"==t.type?s[e.toLowerCase()]=+t.checked:t.querySelector("input[type='range']")?s[e.toLowerCase()]=t.querySelector("input[type='range']").value:"name"==e?s.name=t.value:"image_normalization_tiff"==e?s[e.toLowerCase()]="TIFF"===t.value?1:0:"string"==typeof t.value?s[e.toLowerCase()]=t.value.toLowerCase():s[e.toLowerCase()]=t.value)})),l?async function(e){const t=`${window.location.origin}/api/preservation/${e.id}`,n=await PydioApi._PydioRestClient.getOrUpdateJwt();fetch(t,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify(e)}).then((e=>{if(!e.ok)throw new Error(`HTTP error while updating config, Status: ${e.status}`);if(200==e.status)return console.info("config saved successfully"),e.json()})).catch((e=>{console.error("Fetch error:",e),Curate.ui.modals.curatePopup({title:"Error",type:"error",content:"There was an error saving your modified configuration. Please try again, or contact support if the problem persists."}).fire()}))}(s):async function(e){const t=`${window.location.origin}/preservation`,n=await PydioApi._PydioRestClient.getOrUpdateJwt();return fetch(t,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify(e)}).then((e=>{if(e.ok)return console.info("config saved successfully"),e.json();throw new Error(`HTTP error! Status: ${e.status}`)})).catch((e=>{console.error("Fetch error:",e),Curate.ui.modals.curatePopup({title:"Error",type:"error",content:"There was an error saving your configuration. Please try again, or contact support if the problem persists."}).fire()}))}(s).then((t=>{if(t){const t=JSON.parse(sessionStorage.getItem("preservationConfigs"));e().then((e=>{const n=JSON.parse(sessionStorage.getItem("preservationConfigs"));if(s.id)document.querySelector("#config-"+s.id).remove(),i(m,[n.find((e=>e.id===s.id))]);else{const e=n.find((e=>!t.some((t=>t.id===e.id))));i(m,[e])}}))}}))})),p.appendChild(h),d.appendChild(p),p.addEventListener("input",(e=>{let t=p.querySelector("#name").value;0==t.length?h.style.display="none":t.trim().length<3?(h.textContent="Add a name 3 characters or longer",h.style.display="block"):(h.textContent="Save Config",h.style.display="block")}));const g=document.createElement("div");g.classList.add("config-options-container"),g.id="savedConfigsContainer",g.style="display:flex;align-items:center;justify-content:flex-start;flex-direction:column;";const f=document.createElement("div");f.classList.add("config-text-label"),f.style="padding-bottom: 1em; !important",f.textContent="Saved Configs",g.appendChild(f);const y=JSON.parse(sessionStorage.getItem("preservationConfigs"));i(m,g,y),g.appendChild(m),d.appendChild(g),o.appendChild(s);const b=document.createElement("div");b.classList.add("action-buttons");const v=document.createElement("button");v.classList.add("config-modal-close-button"),v.textContent="Close",v.addEventListener("click",(()=>{document.body.removeChild(o)})),b.appendChild(v),s.appendChild(b),document.body.appendChild(o),o.style.display="flex"}("Preservation Configs",r)})),s.querySelector('[role="menu"]').appendChild(l),document.body.appendChild(s);const d=s.firstChild.getBoundingClientRect(),c=t.getBoundingClientRect(),p=c.left,u=window.innerWidth-c.right;var m;return pu?(m=c.top,newRight=window.innerWidth-c.left+d.width,s.style.position="absolute",s.style.top=`${m}px`,s.style.right=`${newRight}px`):(m=c.top,newRight=window.innerWidth-c.right,s.style.position="absolute",s.style.top=`${m}px`,s.style.right=`${newRight}px`),s}function n(e,t,n="16px",o="5px"){const i=document.createElement("div");return i.style.transition="0.3s ease all",i.style.maxWidth="20em",i.addEventListener("mouseenter",(e=>{e.target.style.background="var(--md-sys-color-outline-variant-50)"})),i.addEventListener("mouseleave",(e=>{e.target.style.background="none"})),i.id="preservationConfigDropdown",i.innerHTML='
'+e+"
",i}function o(e){const o=JSON.parse(sessionStorage.getItem("preservationConfigs"));setTimeout((()=>{for(const i of e.querySelectorAll("div")){if("Preserve"==i.innerText){const a=n("Preservation Configs","mdi-menu-right","24px","0px");e.insertBefore(a,i.nextSibling);const r=document.querySelector("#preservationConfigDropdown"),s=[1,3];return document.addEventListener("mousedown",(e=>{}),{once:!0}),r.addEventListener("click",(e=>{const n=t(r,'
',o);setTimeout((()=>{document.addEventListener("mousedown",(e=>{s.includes(e.which)&&(n.contains(e.target)||n.remove())}),{once:!0})}),100)})),void o.forEach((t=>{const o=JSON.parse(localStorage.getItem(t.id.toString()));if(o&&o.bookmarked){const o=n(t.name,"mdi-console");e.insertBefore(o,i.nextSibling)}}))}document.querySelector("#preservationConfigDropdown")&&document.querySelector("#preservationConfigDropdown").remove()}}),10)}function i(t,n,o){console.log(o),o?.forEach((n=>{const o=document.createElement("div");o.id="config-"+n.id,o.classList.add("saved-config-item"),o.style.opacity="0",o.addEventListener("mouseenter",(e=>{o.style.backgroundColor="var(--md-sys-color-outline-variant)"})),o.addEventListener("mouseleave",(e=>{o.style.backgroundColor="var(--md-sys-color-on-secondary)"})),o.addEventListener("click",(e=>{if(!["saved-config-delete","config-bookmark-container","mdi-star","mdi-star-outline"].includes(e.target.className))for(var t in n)if(n.hasOwnProperty(t)){var o="#"+t,i=document.querySelector(o);i&&("checkbox"==i.type?i.checked=!!n[t]:"select-one"==i.type?"image_normalization_tiff"==i.id&&(i.value=1===n[t]?"TIFF":"JPEG2000"):"range"==i.type?(i.value=n[t],i.dispatchEvent(new CustomEvent("input",{bubbles:!0}))):i.value=n[t],i.dispatchEvent(new CustomEvent("change",{bubbles:!0})))}}));const i=document.createElement("div");i.classList.add("saved-config-information");const a=document.createElement("label");a.textContent=n.name,a.style.fontWeight="500",a.style.marginBottom="0";const r=document.createElement("label");r.classList.add("config-text-label");const s=document.createElement("div"),l=document.createElement("label");l.for="config-description-"+n.id,l.textContent="Description: ";const d=document.createElement("span");d.textContent=n.description,d.id="config-description-"+n.id,s.appendChild(l),s.appendChild(d);const c=document.createElement("div"),p=document.createElement("label");p.id="config-user-"+n.id,p.textContent="User: ";const u=document.createElement("span");u.id="config-user-"+n.id,u.textContent=n.user,c.appendChild(p),c.appendChild(u),r.appendChild(s),r.appendChild(c),i.appendChild(a),i.appendChild(r);const m=document.createElement("button");m.classList.add("saved-config-delete"),m.addEventListener("mouseenter",(e=>{o.style.backgroundColor="var(--md-sys-color-on-secondary)",m.style.backgroundColor="#ff2c2c"})),m.addEventListener("mouseleave",(e=>{m.style.backgroundColor="var(--md-sys-color-error-container)",e.toElement==o||e.toElement==o.querySelector(".saved-config-information")?o.style.backgroundColor="var(--md-sys-color-outline-variant)":o.style.backgroundColor="var(--md-sys-color-on-secondary)"})),m.addEventListener("click",(t=>{confirm("Deleting a config is permanent and cannot be reverted, do you wish to continue?")&&(o.style.opacity="1",async function(t){const n=`${window.location.origin}/preservation/${t}`,o=await PydioApi._PydioRestClient.getOrUpdateJwt();return fetch(n,{method:"DELETE",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${o}`}}).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return e.json()})).then((t=>{if(t)return e(),t;throw new Error("Delete operation failed.")})).catch((e=>{console.error("Fetch error:",e),Curate.ui.modals.curatePopup({title:"Error",type:"error",content:"There was an error deleting your configuration. Please try again, or contact support if the problem persists."}).fire()}))}(n.id).then((e=>{console.info("Delete successful:",e),o.style.animation="none",o.offsetWidth,o.style.animation="config-slide-and-fade-in 0.4s forwards reverse",setTimeout((e=>{o.remove()}),400)})).catch((e=>{o.style.animation="delete-failed-shake-animation 0.5s 0s infinite";const t=o.style.backgroundColor;o.style.backgroundColor="red",console.error("Delete failed:",e),setTimeout((()=>{o.style.animation="none",o.style.backgroundColor=t}),500)})))})),m.textContent="Delete Config";const h=document.createElement("div");h.classList.add("config-bookmark-container"),h.addEventListener("click",(e=>{e.target.classList.contains("mdi-star-outline")?(console.info("bookmarked!"),localStorage.setItem(n.id,JSON.stringify({name:n.name,bookmarked:!0})),e.target.classList.remove("mdi-star-outline"),e.target.classList.add("mdi-star")):e.target.classList.contains("mdi-star")&&(console.info("un-bookmarked!"),localStorage.setItem(n.id,JSON.stringify({name:n.name,bookmarked:!1})),e.target.classList.remove("mdi-star"),e.target.classList.add("mdi-star-outline"))}));const g=document.createElement("span"),f=JSON.parse(localStorage.getItem(n.id.toString()));f&&f.bookmarked?g.classList.add("mdi-star"):g.classList.add("mdi-star-outline"),h.appendChild(g),o.appendChild(h),o.appendChild(i),o.appendChild(m),t.appendChild(o)}));const i=t.querySelectorAll(".saved-config-item");if(i?.forEach(((e,t)=>e.style.animationDelay=.55*t/i.length+"s")),i?.forEach(((e,t,n)=>{const o=.05*(t+1),i=1-o;e.style.animationDelay=`${o}s`,e.style.animationDuration=`${i}s`})),!o||0==o?.length){const e=document.createElement("div");e.textContent="No Saved Preservation Configs Found",e.style.margin="3em",e.style.width="80%",e.style.height="10%",e.style.textAlign="center",e.style.display="flex",e.style.color="white",e.style.background="var(--md-sys-color-outline-variant-50)",e.style.justifyContent="center",e.style.alignItems="center",e.style.borderRadius="1.5em",n.appendChild(e)}}function a(e,t){const n=document.createElement("div");if(n.classList.add("input-container"),"info"===e.type){const t=document.createElement("div");t.classList.add("config-info"),t.textContent=e.text,n.appendChild(t)}if("text"===e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const o=document.createElement("input");o.id=e.name,o.setAttribute("type","text"),o.classList.add("config-text-input"),n.appendChild(t),n.appendChild(o)}else if("toggle"===e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const o=document.createElement("input");o.setAttribute("type","checkbox"),o.classList.add("tgl"),o.classList.add("tgl-light"),o.id=e.name;const i=document.createElement("label");i.classList.add("tgl-btn"),i.htmlFor=e.name,n.appendChild(t),n.appendChild(o),n.appendChild(i)}else if("dropdown"===e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const o=document.createElement("select");o.id=e.name,o.classList.add("config-dropdown-select"),e.options.forEach((e=>{const t=document.createElement("option");t.value=e,t.textContent=e,o.appendChild(t)})),n.appendChild(t),n.appendChild(o)}else if("slider"==e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const i=document.createElement("div");i.classList.add("config-slider-container");const a=document.createElement("div");a.classList.add("config-slider-value"),a.textContent=e.min;const r=document.createElement("input");r.id=e.name,r.setAttribute("type","range"),r.classList.add("config-slider"),r.setAttribute("min",e.min),r.setAttribute("max",e.range),r.setAttribute("step",e.step),r.setAttribute("value",e.min);const s=document.createElement("div");s.classList.add("config-slider-minmax-container");const l=document.createElement("span");l.classList.add("config-slider-minmax"),l.textContent=e.min;const d=document.createElement("span");d.classList.add("config-slider-minmax"),d.textContent=e.range,r.addEventListener("input",(()=>{const e=r.value;a.textContent=e})),s.appendChild(l);for(var o=0;o{const n=e.name;t.target.id==n&&(t.target.checked?e.suboptions.forEach((e=>{if("info"==e.type)return;const t="#"+e.name;document.querySelector(t).disabled=!1,document.querySelector(t).parentElement.style.opacity="1"})):e.suboptions.forEach((e=>{if("info"==e.type)return;const t="#"+e.name;document.querySelector(t).disabled=!0,document.querySelector(t).checked=!1,document.querySelector(t).parentElement.style.opacity="0.3"})))})),t.appendChild(n),e.suboptions&&e.suboptions.forEach((e=>{a(e,n),setTimeout((t=>{if("info"==e.type)return;const n="#"+e.name;document.querySelector(n).disabled=!0,document.querySelector(n).parentElement.style.opacity="0.3"}),50)}))}const r=[{category:"Details",inputs:[{label:"Config Name",name:"name",type:"text"},{label:"Config Description",name:"description",type:"text"}]},{category:"Normalisation",inputs:[{label:"Normalise Objects",name:"normalize",type:"toggle",suboptions:[{label:"Image Normalisation Format",name:"image_normalization_tiff",type:"dropdown",options:["TIFF","JPEG2000"]}]}]},{category:"Dissemination",inputs:[{label:"Create Dissemination Package",name:"dip_enabled",type:"toggle",suboptions:[{label:"Dissemination Information",name:"dip_info",type:"info",text:"Create dissemination packages from AIPs generated by this config. Created DIPs will automatically be connected to the linked description of the source data. For this option to work, you must configure a connected AtoM instance."},{label:"Go to AtoM Configuration",name:"atom_config",type:"button",text:"Go to AtoM Configuration",onclick:e=>{Curate.ui.modals.curatePopup({title:"Connect to Your AtoM Instance"},{afterLoaded:e=>{const t=document.createElement("connect-to-atom");e.querySelector(".config-main-options-container").appendChild(t)}}).fire()}}]}]},{category:"Packaging and Compression",inputs:[{label:"AIP Packaging Type",name:"process_type",type:"dropdown",options:["standard","eark"]},{label:"Compress AIPs",name:"compress_aip",type:"toggle",suboptions:[{label:"Warning",name:"compression_warning",type:"info",text:"Compressing AIPs will make their contents unsearchable and prevent descriptive metadata from being reassociated with output objects. You can compress your AIPs for distribution or deep-storage while conserving the uncompressed AIP by right-clicking an AIP in a workspace."},{label:"Compression Algorithm",name:"compression_algorithm",type:"dropdown",options:["tar","tar_bzip2","tar_gzip","s7_copy ","s7_bzip2","s7_lzma"]},{label:"Compression Level",name:"compression_level",type:"slider",min:1,range:9,step:1}]}]},{category:"Transfer Options",inputs:[{label:"Generate Transfer Structure Report",name:"gen_transfer_struct_report",type:"toggle"},{label:"Document Empty Directories",name:"document_empty_directories",type:"toggle"},{label:"Extract Packages",name:"extract_packages",type:"toggle",suboptions:[{label:"Delete Packages After Extraction",name:"delete_packages_after_extraction",type:"toggle"}]}]}];window.addEventListener("load",(t=>{!async function(){try{await((e,t=50)=>new Promise((n=>{const o=setInterval((()=>{void 0!==window[e]&&(clearInterval(o),n(window[e]))}),t)})))("PydioApi");e()}catch(e){console.error("An error occurred:",e)}}(),setTimeout((()=>{document.addEventListener("mousedown",(e=>{document.querySelector('.context-menu [role="menu"]')&&document.querySelector('.context-menu [role="menu"]').contains(e.target)||document.querySelector(".main-files-list")&&(3==e.which&&document.querySelector(".main-files-list").contains(e.target)?document.querySelector('.context-menu [role="menu"]')&&!document.querySelector("#preservationConfigDropdown")?setTimeout((()=>{o(document.querySelector('.context-menu [role="menu"]'))}),100):function(e){if(document.querySelector("#\\/recycle_bin")&&document.querySelector("#\\/recycle_bin").contains(e.target))return void(document.querySelector("#preservationConfigDropdown")&&document.querySelector("#preservationConfigDropdown").remove());const t=new MutationObserver((e=>{e.forEach((e=>{e.addedNodes.forEach((e=>{if(e.nodeType===Node.ELEMENT_NODE){const n=e.querySelector('.context-menu [role="menu"]');n&&(o(n),t.disconnect())}}))}))}));t.observe(document.body,{childList:!0,subtree:!0,once:!0})}(e):document.querySelector("#preservationConfigDropdown")&&setTimeout((()=>{document.querySelector("#preservationConfigDropdown")&&document.querySelector("#preservationConfigDropdown").remove()}),150))}),150)}))}))},627:()=>{document.addEventListener("change",(function(e){if(1===pydio._dataModel._selectedNodes.length&&e.target.nextElementSibling?.textContent.includes("Enable OAI Harvesting")&&"checkbox"===e.target.type){const t=e.target.nextElementSibling?.textContent.includes("Enable OAI-PMH Harvesting"),n=pydio._dataModel._selectedNodes[0],o=!n._isLeaf;t&&o&&Curate.ui.modals.curatePopup({title:"Send Update to Children",buttonType:"okCancel"},{afterLoaded:e=>{e.querySelector(".config-main-options-container").appendChild(function(){const e=document.createElement("div");e.style="margin: 12px 0px 6px;";const t=document.createElement("div");t.style="cursor: pointer; position: relative; overflow: visible; display: table; height: 52px; width: 100%; background-color: var(--md-sys-color-surface-variant); border-radius: 4px; margin-top: 8px; font-size: 15px; padding: 15px 10px 4px;";const n=document.createElement("input");n.type="checkbox",n.id="inheritValues",n.checked=!1,n.style="position: absolute; cursor: inherit; pointer-events: all; opacity: 0; width: 100%; height: 100%; z-index: 2; left: 0px; box-sizing: border-box; padding: 0px; margin: 0px;";const o=document.createElement("div");o.style="display: flex; width: 100%; height: 100%;";const i=document.createElement("div");i.style="transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; float: left; position: relative; display: block; flex-shrink: 0; width: 36px; margin-right: 8px; margin-left: 0px; padding: 4px 0px 6px 2px;";const a=document.createElement("div");a.style="transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; width: 100%; height: 14px; border-radius: 30px; background-color: var(--md-sys-color-outline-variant);";const r=document.createElement("div");r.style="color: rgb(25, 28, 30); background-color: var(--md-sys-color-primary); transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; box-sizing: border-box; font-family: Roboto, sans-serif; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 6px, rgba(0, 0, 0, 0.12) 0px 1px 4px; border-radius: 50%; position: absolute; top: 1px; left: 100%; width: 20px; height: 20px; line-height: 24px; margin-left: -20px;";const s=document.createElement("label");return s.style="float: left; position: relative; display: block; width: calc(100% - 46px); line-height: 24px; color: rgb(25, 28, 30); font-family: Roboto, sans-serif;",s.textContent="Update Children With New Value ",i.appendChild(a),i.appendChild(r),o.appendChild(i),o.appendChild(s),t.appendChild(n),t.appendChild(o),e.appendChild(t),n.addEventListener("change",(function(){n.checked?(a.style.backgroundColor="rgba(0, 102, 137, 0.5)",r.style.left="100%",s.textContent="Update Children With New Value (yes)"):(r.style.left="55%",a.style.backgroundColor="var(--md-sys-color-outline-variant)",s.textContent="Update Direct Descendant Files With New Value (no)")})),n.dispatchEvent(new Event("change")),e}())},onOk:()=>{const t=this.querySelector("#inheritValues[type='checkbox']");if(t&&t.checked){(async function(e,t=100){const n=async(e,n=0)=>{const o={NodePaths:[e+"/*"],Limit:t.toString(),Offset:n.toString()};return await Curate.api.fetchCurate("/a/tree/stats","POST",o)};let o=[],i=0,a=!0;for(;a;){const r=(await n(e,i)).Nodes||[];o=o.concat(r),a=r.length===t,i+=r.length}return o})(Curate.workspaces.getOpenWorkspace()+"/"+n._path).then((t=>{const n=[];t.forEach((e=>"LEAF"===e.Type?n.push(e.Uuid):null));var o,i;(o=n,i=50,Array.from({length:Math.ceil(o.length/i)},((e,t)=>o.slice(t*i,t*i+i)))).forEach((t=>{const n=((e,t)=>({MetaDatas:e.map((e=>({NodeUuid:e,Namespace:"usermeta-export-oai-harvest-enabled",JsonValue:t.toString(),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]}))),Operation:"PUT"}))(t,e.target.checked);Curate.api.fetchCurate("/a/user-meta/update","PUT",n)}))})).catch((e=>{console.error("Error retrieving nodes:",e)}))}}}).fire()}}))},93:()=>{const e={upload:{enforceWorkspaceUpload:{event:"drop",target:document,description:"enforce workspace upload permissions for standard users",handler:e=>{pydio.user.getIdmUser().then((t=>{if(!["quarantine","personal-files","common files"].includes(Curate.workspaces.getOpenWorkspace())&&!t.Roles.find((e=>e.Label="Admin"))&&e.dataTransfer?.files.length>0){e.stopImmediatePropagation();const t="
\n

Please upload your content to the Quarantine workspace instead. This will ensure your content is correctly scanned for malware before being released into the system.

\n

You can also upload your content to the Personal and Common Files workspaces, which is scanned for malware once but will not be quarantined and cannot be released into the system.

\n
";Curate.ui.modals.curatePopup({title:"You do not have permission to upload to this workspace",type:"warning",content:t}).fire()}}))}}},sharedSite:{enforceNoCustomActions:{event:"readystatechange",target:document,description:"enforce no custom actions for shared sites",handler:e=>{if(console.log("shared site enforce no custom actions"),window.location.pathname.includes("/public/"),window.location.pathname.includes("/public/")){const e=document.querySelector(".toolbars-button-menu.action-group_more_action"),t=Array.from(document.querySelector("#main-toolbar").children).find((e=>"button"===e.type&&e.querySelector(".action-local_toggle_theme"))),n=Array.from(document.querySelectorAll(".toolbars-button-menu")).find((e=>1==e.classList.length));e&&e.remove(),t&&t.remove(),n&&n.remove()}}}},move:{}};document.addEventListener("DOMContentLoaded",(t=>{var n;n=e,Object.entries(n).forEach((([e,t])=>{Object.entries(t).forEach((([t,{event:o,target:i,handler:a}])=>{console.log("attaching event handler",n[e][t]);try{i.addEventListener(o,a)}catch(o){console.error("could not attach: ",n[e][t])}}))}))}))},937:()=>{const e=[e=>e.querySelector(".icomoon-cells")?.closest("button"),e=>e.querySelector(".layout-fill")];window.addEventListener("load",(function t(){if(window.location.pathname.includes("/login")){const e=new MutationObserver((()=>{window.location.pathname.includes("/login")||(e.disconnect(),t())}));e.observe(document.documentElement,{childList:!0,subtree:!0})}else pydio?.user?(pydio.user.isAdmin||pydio.observe("context_changed",(t=>{if("Settings"===t._label){const t=new MutationObserver((()=>{let n=!1;e.forEach((e=>{const t=e(document);t&&(t.remove(),n=!0)})),n&&t.disconnect()}));t.observe(document.body,{childList:!0,subtree:!0})}})),window.removeEventListener("load",t)):setTimeout(t,100)}))},678:()=>{const e=e=>{try{return pydio._dataModel._selectedNodes[0]._metadata.get(e)||null}catch(e){return null}},t=(e,t,n,o)=>{const i=Curate.workspaces.getOpenWorkspace();return n&&"File has not been scanned"!=e||"quarantine"!=i||"Scan Limit Exceeded"===n?n&&"File has not been scanned"!=e||"quarantine"===i||"Scan Limit Exceeded"===n?"Quarantined"==n?`File in quarantine, current period: ${(e=>Math.floor((new Date-new Date(e))/864e5))(o)} days.`:"Scan Limit Exceeded"==n?"File is too large to be scanned.":"Passed"!=n||"personal-files"!=i&&"common files"!=i?"Passed"==n?"File has passed an initial scan but will not be scanned again, please move it into the Quarantine workspace.":"Released"==n?"File has been released from quarantine.":"Risk"==n?"File has not completed its quarantine period and is at risk.":void 0:`File has passed the ${i.replace("-"," ")} scan.`:"This file has not been scanned and is at risk. Please move it into the Quarantine workspace to be scanned.":"This file has not been scanned and is at risk."},n=(e,t)=>{const n=(e,t,n={})=>{const o=document.createElement("div");return o.className=e,o.textContent=t,Object.assign(o.style,n),o},o=n("infoPanelRow",null,{padding:"0px 16px 6px"}),i=n("infoPanelLabel",e,{fontWeight:"415"}),a=n("infoPanelValue",t);return o.appendChild(i),o.appendChild(a),o};function o(o){var i=e("files")?.[0]?.matches?.[0]?.id??"File has not been characterised",a=["usermeta-virus-scan-first","usermeta-virus-scan-second"].map((t=>e(t)||"File has not been scanned")),r=pydio._dataModel._selectedNodes[0]._metadata.get("etag");r.endsWith("-1")&&(r="Local hash");var s=e("mime");const l=e("usermeta-virus-scan"),d=e("usermeta-virus-scan-passed-date");var c=t(...a,l,d);setTimeout((function(){let e=document.createElement("div");e.style.marginTop="-11px",e.id="curateAdditionalInfo";let t=n("Pronom ID",i);"File has not been characterised"!==i&&(t.style.cursor="pointer",t.style.transition="all 0.2s ease-in-out",t.addEventListener("mouseenter",(e=>{t.style.textDecoration="underline",t.style.backgroundColor="rgba(153, 153, 153, 0.2)"})),t.addEventListener("mouseleave",(e=>{t.style.textDecoration="none",t.style.backgroundColor="transparent"})),t.addEventListener("click",(e=>{window.open(`https://www.nationalarchives.gov.uk/pronom/${i}`)})));let l=n("First virus scan result",a[0]),d=n("Second virus scan result",a[1]),p=(n("Mimetype",s),n("Status",c));o.querySelector(".panelContent").childNodes.forEach((e=>{e.innerText.includes("ETag")&&(e.firstChild.innerText="Checksum",e.querySelector(".infoPanelValue").innerText=r)}));let u=document.createElement("HR"),m=document.createElement("div"),h=document.createElement("div");h.style.marginBottom="5px",m.textContent="Quarantine Info",m.id="quarantineInfoLabel",m.style.color="rgb(77, 122, 143)",m.style.fontSize="14px",m.style.fontWeight="500",m.style.marginLeft="15px",m.style.marginBottom="10px",e.appendChild(t),e.appendChild(u),e.appendChild(m),e.appendChild(p),e.appendChild(l),e.appendChild(d),e.appendChild(h),o.querySelector("#curateAdditionalInfo")?(Array.from(document.querySelectorAll(".panelCard")).find((e=>e.textContent.includes("File Info")))?.querySelector("#curateAdditionalInfo")?.remove(),o.appendChild(e)):o.appendChild(e)}),5)}const i=(e,t)=>{t=Array.from(document.querySelectorAll(".panelCard")).find((e=>e.textContent.includes("File Info")));e.memo._selectedNodes&&0!=e.memo._selectedNodes.length&&e.memo._selectedNodes[0]!=a&&t&&t.querySelector(".panelContent")&&(o(t),a=e.memo._selectedNodes[0])};var a;const r=e=>{if(e)return pydio._dataModel._observers.selection_changed.includes(i)||pydio._dataModel.observe("selection_changed",(e=>{i(e)})),e.firstElementChild.addEventListener("click",(t=>{e.querySelector('[class*="mdi-chevron-"]').classList.contains("mdi-chevron-up")||e.querySelector('[class*="mdi-chevron-"]').classList.contains("mdi-chevron-down")})),function(e,t){if(!e||!e.parentElement)return void console.error("The element or its parent is not defined.");const n=new MutationObserver((o=>{for(let i of o)if(i.removedNodes.length)for(let o of i.removedNodes)if(o===e||o.contains(e))return t(),void n.disconnect()}));n.observe(e.parentElement,{childList:!0,subtree:!0})}(e.querySelector(".panelContent"),(()=>{e.querySelector("#curateAdditionalInfo").remove()})),void(e.querySelector(".panelContent")&&o(e))};new MutationObserver(((e,t)=>{for(const t of e)if("childList"===t.type)for(const e of t.addedNodes)e instanceof HTMLElement&&e.classList.contains("panelCard")&&e.innerText.includes("File Info")?r(e):e instanceof HTMLElement&&e.classList.contains("panelContent")&&e.parentElement.classList.contains("panelCard")&&e.parentElement.innerText.includes("File Info")&&r(e.parentElement)})).observe(document.documentElement,{childList:!0,subtree:!0})},663:()=>{window.addEventListener("load",(function(){new Promise(((e,t)=>{!function t(){"undefined"!=typeof pydio?e():setTimeout(t,100)}()})).then((()=>{pydio._dataModel.observe("selection_changed",(function(e){setTimeout((()=>{const e=document.querySelector("#info_panel > div");e&&e.scrollTo({top:0,left:0})}),50)}))}))}))},711:()=>{const e=window.curateDistrobution||"Soteria+",t=()=>{console.log("message modifier");const n=pydioBootstrap.parameters.get("i18nMessages");Object.keys(n).forEach((t=>{"string"==typeof n[t]&&(n[t]=n[t].replace(/Pydio\s*Cells/gi,e).replace(/(?{function e(e){let t=document.createElement("div"),n=document.createElement("button"),o=document.createElement("span"),i=document.createElement("text"),a=document.createElement("hr");i.textContent=e,i.style.marginTop="1em",o.style.ariaHidden="true",o.innerHTML="×",n.style.ariaLabel="Close alert",n.style.type="button",n.style.backgroundColor="white",n.style.border="0",n.style.position="absolute",n.style.top="0",n.style.right="0",n.onclick=function(){this.parentNode.className="slideOut",setTimeout((function(){t.remove()}),1e3)},n.appendChild(o),t.style.backgroundColor="white",t.style.borderRadius="0.5em",t.style.width="16em",t.style.height="auto",t.style.padding="1.8em",t.style.paddingBottom="0em",t.style.margin="2em",t.style.position="absolute",t.style.bottom="5em",t.style.right="0",t.style.boxShadow="0 10px 16px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19)",t.className="slideIn",a.style.borderTop="1px solid black",a.style.marginTop="1em",a.className="lineLoad",n.appendChild(o),t.appendChild(n),t.appendChild(i),t.appendChild(a),document.querySelector("body").appendChild(t),setTimeout((function(){t.classList.remove("slideIn")}),1e3),setTimeout((function(){t.className="slideOut",setTimeout((function(){t.remove()}),1e3)}),6e3)}let t=e=>new Promise((t=>setTimeout(t,e)));function n(){setTimeout((function(){let e=["Generate mimetype report","Export Archivematica JSON"];for(let t=0;t{window.addEventListener("load",(function(){var t=Object.fromEntries(pydioBootstrap.parameters).i18nMessages;Object.entries(e).forEach((function(e){t[e[0]]=e[1]}))}));var e={"ajax_gui.tour.welcomemodal.title":"Welcome to Curate","ajax_gui.tour.welcomemodal.subtitle":"Drag'n'drop a photo of you for your profile! This quick tour will guide you through the web interface.","ajax_gui.tour.welcomemodal.start":"Start the tour","ajax_gui.tour.workspaces.1":"Workspaces are top-level folders that help you manage your archiving workflow and organise your data. The Personal Files workspace can only be accessed by you and the Quarantine, Appraisal and Archive workspaces are shared with your workgroup. The Package Templates workspace is common to all accounts and is read only.","ajax_gui.tour.workspaces.2":"You can upload into the Personal Files and Quarantine workspaces, move files to Appraisal to work on them and deposit packages in the Archive when you are finished.","ajax_gui.tour.globsearch.title":"Global Search","ajax_gui.tour.globsearch.1":"Use this search form to find files or folders in any workspace. Only the first 5 results are shown, enter a workspace to get more results, and more search options. Tip: you can use an asterisk as a wild card.","ajax_gui.tour.globsearch.2":"When no search is entered, the history of your recently accessed files and folder is displayed instead.","ajax_gui.tour.openworkspace.title":"Open a workspace","ajax_gui.tour.openworkspace":"At the first connection, your history is probably empty. Enter the Personal or Quarantine workspaces to start adding files. Tip: files are virus checked when they are uploaded and should be kept in Quarantine for 30 days, after which they are scanned again.","ajax_gui.tour.create-menu.title":"Add files","ajax_gui.tour.create-menu":"Start adding new files or folders to the current workspace.","ajax_gui.tour.display-bar.title":"Display Options","ajax_gui.tour.display-bar":"This toolbar allows you to change the display: switch to thumbnails or detail mode depending on your usage, and sort files by name, date, etc...","ajax_gui.tour.infopanel.title":"Info Panel","ajax_gui.tour.infopanel.1":"Here, you will find a preview and comprehensive information about your current selection: file information, virus scan status, metadata, etc.","ajax_gui.tour.infopanel.2":"You can close this panel by using the info button in the display toolbar","ajax_gui.tour.uwidget.title":"User Settings","ajax_gui.tour.uwidget.addressbook":"Directory of all the users accessing to the platform. Create your own users, and constitute teams that can be used to share resources","ajax_gui.tour.uwidget.alerts":"Alerts panel will inform you when a user with whom you shared some resources did access it. They can be sent to you directly by email.","ajax_gui.tour.uwidget.menu":"Access to other options : manage your profile and password, view all of the public links you have created, send a support message, configure the Archivematica Connector and sign out of the platform.","ajax_gui.tour.uwidget.home":"Go back to the welcome panel with this button"}},92:()=>{[{name:"he",url:"https://cdn.jsdelivr.net/npm/he@1.2.0/he.min.js"},{name:"swal",url:"https://cdn.jsdelivr.net/npm/sweetalert2@11"},{name:"papaparse",url:"https://cdn.jsdelivr.net/npm/papaparse@5.4.1/papaparse.min.js"},{name:"chart.js",url:"https://cdn.jsdelivr.net/npm/chart.js"},{name:"spark-md5",url:"https://cdnjs.cloudflare.com/ajax/libs/spark-md5/3.0.2/spark-md5.min.js"}].forEach((e=>{let t=document.createElement("script");t.src=e.url,t.onerror=function(){console.error("Failed to load external library: ",e.name,"please reload the page or contact your admin if the issue persists.")},document.head.appendChild(t)}))},380:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.apiKey="",this.atomUrl="",this.username="",this.password="",this.retrieveDetails(),this.render()}async retrieveDetails(){try{const e=await Curate.api.fetchCurate("/api/atom","GET");this.apiKey=e.atom_api_key,this.atomUrl=e.atom_url,this.username=e.atom_username,this.password=e.atom_password,this.render()}catch(e){console.error("Error retrieving details from Atom:",e)}}saveDetails(e){e.preventDefault(),Curate.api.fetchCurate("/api/atom","POST",{atom_api_key:this.apiKey,atom_url:this.atomUrl,atom_username:this.username,atom_password:this.password}).then((e=>{console.log("Saved Atom details:",e)})).catch((e=>{console.error("Error saving Atom details:",e)})),""!==this.apiKey&&(localStorage.setItem("atom_api_key",this.apiKey),console.log("Saving API Key:",this.apiKey)),""!==this.atomUrl&&(localStorage.setItem("atom_url",this.atomUrl),console.log("Saving Atom URL:",this.atomUrl)),""!==this.username&&(localStorage.setItem("atom_username",this.username),console.log("Saving Atom Username:",this.username)),""!==this.password&&(localStorage.setItem("atom_password",this.password),console.log("Saving Atom Password:",this.password)),this.render()}handleApiKeyChange(e){this.apiKey=e.target.value}handleUrlChange(e){this.atomUrl=e.target.value}handleUsernameChange(e){this.username=e.target.value}handlePasswordChange(e){this.password=e.target.value}togglePasswordVisibility(){const e=this.shadowRoot.querySelector("#password"),t=this.shadowRoot.querySelector("#toggle-password");"password"===e.type?(e.type="text",t.textContent="Hide"):(e.type="password",t.textContent="Show")}render(){this.shadowRoot.innerHTML=`\n \n
\n
\n
\n Current API Key:\n ${"*".repeat(this.apiKey?.length)||"Not Set"}\n
\n
\n Current Atom URL:\n ${this.atomUrl||"Not Set"}\n
\n
\n Current Username:\n ${this.username||"Not Set"}\n
\n
\n Current Password:\n ${"*".repeat(this.password?.length)||"Not Set"}\n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n \n
\n \n
\n
\n `,this.shadowRoot.querySelector("#details-form").addEventListener("submit",(e=>this.saveDetails(e))),this.shadowRoot.querySelector("#api-key").addEventListener("input",(e=>this.handleApiKeyChange(e))),this.shadowRoot.querySelector("#atom-url").addEventListener("input",(e=>this.handleUrlChange(e))),this.shadowRoot.querySelector("#username").addEventListener("input",(e=>this.handleUsernameChange(e))),this.shadowRoot.querySelector("#password").addEventListener("input",(e=>this.handlePasswordChange(e))),this.shadowRoot.querySelector("#toggle-password").addEventListener("click",(()=>this.togglePasswordVisibility()))}}customElements.define("connect-to-atom",e)},543:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.atomUrl=null,this.criteria=[{id:0,query:"",field:"",operator:""}],this.results=[],this.criterionIndex=1,this.node=null,this.error=null,this.isLoading=!1,this.currentPage=1,this.totalResults=0,this.resultsPerPage=10,this.initialise(),this.render()}async initialise(){this.atomUrl=await this.getAtomUrl()}setNode(e){this.node=e,this.render()}addCriterion(){this.criteria.push({id:this.criterionIndex,query:"",field:"",operator:"and"}),this.criterionIndex++,this.render()}removeCriterion(e){this.criteria=this.criteria.filter((t=>t.id!==e)),this.render()}handleInputChange(e,t,n){this.criteria=this.criteria.map((o=>o.id===e?{...o,[t]:n}:o));const o=this.shadowRoot.querySelector(`[data-id="${e}"][data-field="${t}"]`);o&&(o.value=n)}async performSearch(e=1){this.isLoading=!0,this.error=null,this.currentPage=e,this.render();const t=new URLSearchParams;this.criteria.forEach(((e,n)=>{n>0&&t.append(`so${n}`,e.operator),t.append(`sq${n}`,e.query),t.append(`sf${n}`,e.field)})),t.append("topLod",0),t.append("skip",(e-1)*this.resultsPerPage);try{const e=`${window.location.protocol}//${window.location.hostname}/api/atom/search`,n=await PydioApi._PydioRestClient.getOrUpdateJwt(),o=await fetch(`${e}?${t.toString()}`,{headers:{Authorization:`Bearer ${n}`}});if(!o.ok)throw new Error(`HTTP error! status: ${o.status}`);const i=await o.json();console.log("Retrieved results:",i),this.results=i.results,this.totalResults=i.total}catch(e){console.error("Error performing search:",e),this.error=`An error occurred while searching: ${e.message}`}finally{this.isLoading=!1,this.render()}}handleResultClick(e){console.log("Result clicked:",e);var t=[];if(!this.node)throw new Error("No node set");console.log("node to link to:",this.node),t.push({NodeUuid:this.node._metadata.get("uuid"),JsonValue:JSON.stringify(e),Namespace:"usermeta-atom-linked-description",Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]}),Curate.api.fetchCurate("/a/user-meta/update","PUT",{MetaDatas:t,Operation:"PUT"}),this.dispatchEvent(new CustomEvent("description-linked",{detail:e})),this.remove()}toggleAccordion(e){e.classList.toggle("collapsed");const t=e.nextElementSibling,n=e.querySelector(".chevron");t.classList.contains("show")?(t.classList.remove("show"),n.classList.remove("down"),localStorage.setItem("accordionState","true")):(t.classList.add("show"),n.classList.add("down"),localStorage.setItem("accordionState","false"))}renderPagination(){const e=Math.ceil(this.totalResults/this.resultsPerPage);let t="";if(e>1){t+='
',t+='
Showing results '+((this.currentPage-1)*this.resultsPerPage+1)+" - "+Math.min(this.currentPage*this.resultsPerPage,this.totalResults)+" of "+this.totalResults+"
",t+='",t+="
"}return t}getPageRange(e,t){let n=[];const o=e-2,i=e+2+1;for(let e=1;e<=t;e++)(1===e||e===t||e>=o&&e1===e||e===t||(!i[o-1]||i[o-1]+1===e||(n.splice(o,0,null),!0)))),n}async getAtomUrl(){return Curate.api.fetchCurate(":6900/atom","GET").then((e=>e.atom_url))}render(){this.shadowRoot.innerHTML=`\n \n
\n \n
\n
\n

This interface allows you to search for descriptions in your AtoM instance using a set of search criteria.

\n

You can add as many search criteria as you like, and then perform a search to find descriptions that match your criteria.

\n

Once you have found a description, you can link it to your selected node in Curate.

\n

Please note: only the top-level linked description will be considered when associating your dissemination package with AtoM.

\n

For example, if you create an AIP from a folder containing multiple files, only the folder itself will be checked for a linked description.

\n

AtoM automatically links the sub-files or folders as child level descendants of the top-level linked description.

\n
\n
\n
\n
\n
\n ${this.criteria.map(((e,t)=>`\n
\n ${t>0?`\n \n `:""}\n \n \n \n
\n `)).join("")}\n
\n \n \n\n ${this.isLoading?'
':""}\n \n ${this.error?`
${this.error}
`:""}\n\n
\n ${0!==this.results.length||this.isLoading||this.error?this.results.map((e=>`\n
\n
\n

${e.title}

\n

Reference code: ${e.reference_code}

\n

Level of description: ${e.level_of_description}

\n

URL: ${this.atomUrl}/${e.slug}

\n \n
\n ${e.thumbnail_url?`\n \n `:""}\n
\n `)).join(""):"

No results found. Please try a different search.

"}\n
\n ${this.renderPagination()}\n
\n \n `}}customElements.define("atom-search-interface",e)},738:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this.render(),console.log("connected help"),this.updateContent()}render(){this.shadowRoot.innerHTML='\n \n
\n '}updateContent(){const e=Curate.contextualHelp.context;this.shadowRoot.querySelector(".help-content").textContent=this.getHelpContent(e)}getHelpContent(e){const{page:t,lastRightClickedElement:n,selection:o}=e,i=o&&o.length>0;n&&n.tagName.toLowerCase();return!0===i?`You've selected ${o.length} item(s). This area allows you to perform actions on your selection.`:`You're on the ${t} page. Right-click on elements to see context-specific help.`}}customElements.define("contextual-help",e)},523:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.processQueue=[],this.runningProcesses=new Map,this.maxConcurrent=5}connectedCallback(){this.render(),this.processQueueInterval=setInterval((()=>this.processQueuedItems()),1e3)}disconnectedCallback(){clearInterval(this.processQueueInterval)}render(){this.shadowRoot.innerHTML='\n \n
\n '}addToQueue(e){const t={id:this.generateUniqueId(e),node:e,status:"queued",title:`Queued: ${e._metadata.get("usermeta-import-oai-link-id")}`,details:`Repository: ${e._metadata.get("usermeta-import-oai-repo-url")}`,nodeTitle:e._label};this.processQueue.push(t),this.updateStatusCard(t)}async processQueuedItems(){for(;this.runningProcesses.size0;){const e=this.processQueue.shift();this.runningProcesses.set(e.id,e),this.initiateHarvest(e)}}async initiateHarvest(e){const{node:t,id:n}=e,o=t._metadata.get("usermeta-import-oai-repo-url"),i=t._metadata.get("usermeta-import-oai-link-id"),a=t._metadata.get("usermeta-import-oai-metadata-prefix");if(o&&i&&a){this.updateProcessStatus(n,"loading",`Harvesting ${i}`,`Repository: ${o}`,0);try{const e=await fetch("http://127.0.0.1:5000/harvest",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({repo_url:o,identifier:i,metadata_prefix:a})});if(!e.ok){const t=await e.json();throw{message:t.error,data:t.data}}const r=await e.json(),s=this.convertJson(r);await Curate.api.files.updateMetadata(t,s),this.updateProcessStatus(n,"success",`Harvested ${i}`,`Successfully processed data from ${o}${i}`,100)}catch(e){this.updateProcessStatus(n,"error",`Failed to harvest ${i}`,`Error: ${e.message}: ${e.data?e.data:""}`,100)}finally{this.runningProcesses.delete(n)}}else this.updateProcessStatus(n,"error",`Failed to harvest ${i}`,"Repository, identifier, or metadata prefix not found",100)}updateProcessStatus(e,t,n,o,i){const a=this.runningProcesses.get(e)||this.processQueue.find((t=>t.id===e));a&&(Object.assign(a,{status:t,title:n,details:o,progress:i}),this.updateStatusCard(a))}updateStatusCard(e){const t=this.shadowRoot.querySelector(".status-container");let n=t.querySelector(`[data-id="${e.id}"]`);n||(n=document.createElement("div"),n.classList.add("status-item"),n.setAttribute("data-id",e.id),t.appendChild(n));const{status:o,title:i,details:a,progress:r,nodeTitle:s}=e;n.innerHTML=`\n
\n ${i}\n \n
\n
${a}
\n
Node: ${s}
\n ${"loading"===o?`\n
\n
\n
\n `:""}\n `}generateUniqueId(e){return`${e._metadata.get("uuid")}-${e._metadata.get("usermeta-import-oai-link-id")}`}convertJson(e){const t=e.schema,n=e.data;let o=[];for(const e in n)if(Array.isArray(n[e])){let t=n[e].join(", ");o.push({field:e,value:t})}let i={};return i[t]=o,i}processAllNodes(e){e.forEach((e=>this.addToQueue(e)))}}customElements.define("oai-harvest-status",e)}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var a=t[o]={exports:{}};return e[o](a,a.exports,n),a.exports}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var o=t.getElementsByTagName("script");if(o.length)for(var i=o.length-1;i>-1&&(!e||!/^http(s?):/.test(e));)e=o[i--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),(()=>{"use strict";const e={fetchCurate:async function(e,t="POST",n){if(!e)throw new Error("No endpoint provided");try{const o=await PydioApi._PydioRestClient.getOrUpdateJwt(),i={method:t,headers:{accept:"application/json","accept-language":navigator.language+",en-GB,en-US;q=0.9,en;q=0.8",authorization:"Bearer "+o,"content-type":"application/json","sec-fetch-dest":"empty","sec-fetch-mode":"cors","sec-fetch-site":"same-origin","x-pydio-language":pydio.user.getPreference("lang")},referrer:window.location.href,referrerPolicy:"strict-origin-when-cross-origin",mode:"cors",credentials:"include"};["GET","HEAD"].includes(t)||(i.body=JSON.stringify(n));const a=await fetch(window.location.origin+e,i);if(!a.ok)throw new Error("Network response was not ok");return await a.json()}catch(e){throw console.error("Curate fetch error:",e),e}},files:{createFiles:async function(e){if(!e)throw new Error("No nodes provided");async function t(e,t){const n={MetaDatas:[],Operation:"PUT"};for(const o in e)"path"!==o&&e[o].forEach((e=>{const i=`usermeta-${o}-${e.field}`,a={NodeUuid:t,Namespace:i,JsonValue:JSON.stringify(e.value),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]};n.MetaDatas.push(a)}));return n}const n=e.nodes.map((async e=>{const t=e.path.split("/").pop(),n=(await Curate.api.fetchCurate("/a/tree/create","POST",{Nodes:[{Path:e.path,Type:"LEAF"}],TemplateUUID:""})).Children[0].Path;return{filename:t,uuid:(await Curate.api.fetchCurate("/a/meta/bulk/get","POST",{Limit:200,NodePaths:[n]})).Nodes[0].Uuid,node:e}})),o=await Promise.all(n);for(const{filename:e,uuid:n,node:i}of o){const e=await t(i,n);await Curate.api.fetchCurate("/a/user-meta/update","PUT",e)}},getFileData:async function(e,t="text"){if(!e)throw new Error("No node provided");try{await PydioApi._PydioRestClient.getOrUpdateJwt();const n=await pydio.ApiClient.buildPresignedGetUrl(e),o=await fetch(n);if(!o.ok)throw new Error("Network response was not ok");if("text"===t)data=await o.text();return data}catch(e){throw console.error("Error fetching object:",e),e}},updateMetadata:async function(e,t){if(!t)throw new Error("No metadata provided");if(!e)throw new Error("No node provided");const n=((e,t)=>{const n={MetaDatas:[],Operation:"PUT"};for(const o in t)t[o].forEach((t=>{const i=`usermeta-${o}-${t.field}`,a={NodeUuid:e._metadata.get("uuid"),Namespace:i,JsonValue:JSON.stringify(t.value),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]};n.MetaDatas.push(a)}));return n})(e,t);return await Curate.api.fetchCurate("/a/user-meta/update","PUT",n)}}},t={getOpenWorkspace:function(){return pydio._dataModel._rootNode._label.toLowerCase()==pydio.user.id.toLowerCase()?"personal-files":pydio._dataModel._rootNode._label.toLowerCase().replace(/^\d+\.\s*/,"")}},o={modals:{curatePopup:function(e,t){const n=e.title,o=e.message,i=e.type,a=e.content,r=e.buttonType||"close",s=t?.afterLoaded||function(){},l=t?.afterClosed||function(){},d=t?.onOk||function(){},c=t?.onCancel||function(){},p={warning:{color:"#FFA500",icon:"mdi-alert"},error:{color:"#FF0000",icon:"mdi-alert-circle"},success:{color:"#008000",icon:"mdi-check-circle"},info:{color:"#0000FF",icon:"mdi-information"}};return{fire:function(){const e=document.createElement("div");e.classList.add("config-modal-container"),e.style.display="flex",e.addEventListener("click",(function(t){y(t,e)}),{once:!0});const t=document.createElement("div");t.classList.add("config-modal-content"),i&&(t.style.borderTop=`4px solid ${p[i].color}`);const u=document.createElement("div");if(u.classList.add("config-popup-title"),i){const e=document.createElement("i");e.classList.add("mdi",p[i].icon),e.style.color=p[i].color,e.style.fontSize="24px",e.style.marginRight="10px",u.appendChild(e)}const m=document.createTextNode(n);u.appendChild(m);const h=document.createElement("div");if(h.classList.add("config-main-options-container"),h.style.width="100%",o){const e=document.createElement("div");e.classList.add("config-popup-message"),e.textContent=o,h.appendChild(e)}if(a){const e=document.createElement("div");e.innerHTML=a,h.appendChild(e)}const g=document.createElement("div");if(g.classList.add("action-buttons"),"okCancel"===r){const t=document.createElement("button");t.classList.add("config-modal-ok-button"),t.textContent="OK",t.addEventListener("click",(()=>{d(),f(e)}));const n=document.createElement("button");n.classList.add("config-modal-cancel-button"),n.textContent="Cancel",n.addEventListener("click",(()=>{c(),f(e)})),g.appendChild(t),g.appendChild(n)}else{const t=document.createElement("button");t.classList.add("config-modal-close-button"),t.textContent="Close",t.addEventListener("click",(()=>{f(e)})),g.appendChild(t)}function f(e){e.remove(),l()}function y(e,t){e.target===t?f(t):t.addEventListener("click",(function(e){y(e,t)}),{once:!0})}t.appendChild(u),t.appendChild(h),t.appendChild(g),e.appendChild(t),document.body.appendChild(e),e.addEventListener("keyup",(function(e){e.stopPropagation()})),s(e)}}}}},i=e=>{const t={"ISAD(G)":({},{sections:[{title:"Identity Statement",fields:["reference code(s)","title","date(s)","level of description","extent and medium of the unit of description"]},{title:"Context",fields:["name of creator(s)","administrative/biographical history","archival history","immediate source of acquisition or transfer"]},{title:"Content And Structure",fields:["scope and content","appraisal, destruction and scheduling information","accruals","system of arrangement"]},{title:"Conditions Of Access And Use",fields:["conditions governing access","conditions governing reproduction","language/scripts of material","physical characteristics and technical requirements","finding aids"]},{title:"Allied Materials",fields:["existence and location of originals","existence and location of copies","related units of description","publication note"]},{title:"Notes",fields:["note"]},{title:"Description Control",fields:["archivists note","rules or conventions","date(s) of descriptions"]}]}),DC:({},{fields:["contributor","coverage","creator","date","description","format","identifier","language","publisher","relation","rights","source","subject","title","type"]})};return e&&e in t?t[e]:e?void console.error("invalid schema"):t},a={schemas:{getSchemas:function(e){return i(e)}}};const r={context:{page:window.location.pathname,lastRightClickedElement:null,selection:null}};function s(e){2===e.button&&(r.context.lastRightClickedElement=e.target,r.context.page=window.location.pathname,r.context.selection=pydio?._dataModel._selectedNodes||null)}window.addEventListener("load",(()=>document.addEventListener("mousedown",s)));const l={api:e,workspaces:t,ui:o,metadata:a,contextualHelp:r};window.Curate=l;n(125),n(678),n(887),n(578);function d(){return new Worker(n.p+"hashWorker.worker.52fb74a7a206414c3233.worker.js")}const c=class{constructor(){this.taskQueue=[],this.isProcessing=!1,this.worker=null}initWorker(){this.worker&&this.worker.terminate(),this.worker=new d,console.log("Worker initialized: ",this.worker),this.setupWorkerHandlers()}setupWorkerHandlers(){this.worker.onmessage=e=>{console.log("goober: ",e.data),"complete"===e.data.status&&this.currentResolve&&this.currentResolve({file:this.currentFile,hash:e.data.hash,name:this.currentFile.name}),this.processNextTask()},this.worker.onerror=e=>{this.currentReject&&this.currentReject("Worker error: "+e.message),this.processNextTask()}}generateChecksum(e){return new Promise(((t,n)=>{this.taskQueue.push({file:e,resolve:t,reject:n}),this.isProcessing||this.processNextTask()}))}processNextTask(){if(this.taskQueue.length>0){this.worker||this.initWorker();const e=this.taskQueue.shift();this.currentResolve=e.resolve,this.currentReject=e.reject,this.currentFile=e.file,this.isProcessing=!0,this.worker.postMessage({file:e.file,msg:"begin hash"})}else this.isProcessing=!1,this.worker&&(this.worker.terminate(),this.worker=null)}};window.addEventListener("load",(()=>{(async()=>{for(;"undefined"==typeof UploaderModel;)await new Promise((e=>setTimeout(e,100)));const e=new c;console.log("WorkerManager initialized");const t=UploaderModel.UploadItem.prototype.uploadPresigned;function n(e,t,i){Curate.api.fetchCurate("/a/tree/stats","POST",{NodePaths:[e]}).then((a=>{const r=a.Nodes.find((t=>t.Path===e));r?function(e,t,i,a){const r=3;"temporary"===e.Etag&&a{n(i,t,a+1)}),2e3)):e.Etag===t?(console.log("Checksum validation passed."),o(e.Uuid,"usermeta-file-integrity","✓ Integrity verified")):(console.error("Checksum validation failed.","Expected:",t,"Received:",e.Etag),o(e.Uuid,"usermeta-file-integrity","X Integrity compromised"))}(r,t,e,i):console.error("Node not found in response:",e)})).catch((e=>{console.error("Error fetching node stats:",e)}))}function o(e,t,n){const o={MetaDatas:[{NodeUuid:e,Namespace:t,JsonValue:JSON.stringify(n),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]}],Operation:"PUT"};Curate.api.fetchCurate("/a/user-meta/update","PUT",o)}UploaderModel.UploadItem.prototype.uploadPresigned=function(){const o=t.apply(this,arguments),i=t=>{console.log(t),"loaded"===t&&(this._observers.status.forEach(((e,t)=>{e===i&&this._observers.status.splice(t,1)})),console.log("Attempting to generate checksum for: ",this._file),e.generateChecksum(this._file).then((e=>{console.log("Generated checksum data:",e);const t=Math.min(5e3,Math.max(500,.01*this._file.size));setTimeout((()=>{const t=this._targetNode._path,o=t.endsWith("/")?"":"/",i=this._parent._label?`${this._parent._label}/`:"";n(`${Curate.workspaces.getOpenWorkspace()}${t}${o}${i}${this._label}`,e.hash,0)}),t)})).catch((e=>{console.error("Checksum generation failed:",e)})))};return this._observers.status.push(i),o}})()}));n(627),n(937),n(711),n(663),n(543),n(380);class p extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.nodes=[],this.render()}setNodes(e){this.nodes=e,this.render()}render(){this.shadowRoot.innerHTML=`\n \n
\n
\n The selected preservation configuration has DIP generation enabled. The following items do not have a linked AtoM description, which will cause DIP generation to fail.\n
\n
\n ${this.nodes.map((e=>`\n
\n ${e._path}\n \n
\n `)).join("")}\n
\n
\n `,this.shadowRoot.querySelectorAll(".link-button").forEach((e=>{e.addEventListener("click",(()=>{console.log(`Add description for ${e.getAttribute("data-path")}`),Curate.ui.modals.curatePopup({title:"Connect Selected Node to an AtoM Description"},{afterLoaded:t=>{const n=document.createElement("atom-search-interface");n.setNode(this.nodes.find((t=>t._path==e.getAttribute("data-path")))),t.querySelector(".config-main-options-container").appendChild(n),n.addEventListener("description-linked",(n=>{console.log("description linked"),t.remove();const o=document.createElement("div");o.innerHTML="
🔗
",e.parentElement.querySelector(".file-name").after(o),e.remove()}))},afterClosed:()=>{}}).fire()}))}))}}customElements.define("dip-slug-resolver",p);n(738),n(523),n(93),n(92)})()})(); \ No newline at end of file diff --git a/@latest/hashWorker.worker.52fb74a7a206414c3233.worker.js b/@latest/hashWorker.worker.52fb74a7a206414c3233.worker.js new file mode 100644 index 0000000..ccbf941 --- /dev/null +++ b/@latest/hashWorker.worker.52fb74a7a206414c3233.worker.js @@ -0,0 +1 @@ +(()=>{var t={735:t=>{t.exports=function(t){"use strict";var r=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function e(t,r){var e=t[0],n=t[1],s=t[2],o=t[3];n=((n+=((s=((s+=((o=((o+=((e=((e+=(n&s|~n&o)+r[0]-680876936|0)<<7|e>>>25)+n|0)&n|~e&s)+r[1]-389564586|0)<<12|o>>>20)+e|0)&e|~o&n)+r[2]+606105819|0)<<17|s>>>15)+o|0)&o|~s&e)+r[3]-1044525330|0)<<22|n>>>10)+s|0,n=((n+=((s=((s+=((o=((o+=((e=((e+=(n&s|~n&o)+r[4]-176418897|0)<<7|e>>>25)+n|0)&n|~e&s)+r[5]+1200080426|0)<<12|o>>>20)+e|0)&e|~o&n)+r[6]-1473231341|0)<<17|s>>>15)+o|0)&o|~s&e)+r[7]-45705983|0)<<22|n>>>10)+s|0,n=((n+=((s=((s+=((o=((o+=((e=((e+=(n&s|~n&o)+r[8]+1770035416|0)<<7|e>>>25)+n|0)&n|~e&s)+r[9]-1958414417|0)<<12|o>>>20)+e|0)&e|~o&n)+r[10]-42063|0)<<17|s>>>15)+o|0)&o|~s&e)+r[11]-1990404162|0)<<22|n>>>10)+s|0,n=((n+=((s=((s+=((o=((o+=((e=((e+=(n&s|~n&o)+r[12]+1804603682|0)<<7|e>>>25)+n|0)&n|~e&s)+r[13]-40341101|0)<<12|o>>>20)+e|0)&e|~o&n)+r[14]-1502002290|0)<<17|s>>>15)+o|0)&o|~s&e)+r[15]+1236535329|0)<<22|n>>>10)+s|0,n=((n+=((s=((s+=((o=((o+=((e=((e+=(n&o|s&~o)+r[1]-165796510|0)<<5|e>>>27)+n|0)&s|n&~s)+r[6]-1069501632|0)<<9|o>>>23)+e|0)&n|e&~n)+r[11]+643717713|0)<<14|s>>>18)+o|0)&e|o&~e)+r[0]-373897302|0)<<20|n>>>12)+s|0,n=((n+=((s=((s+=((o=((o+=((e=((e+=(n&o|s&~o)+r[5]-701558691|0)<<5|e>>>27)+n|0)&s|n&~s)+r[10]+38016083|0)<<9|o>>>23)+e|0)&n|e&~n)+r[15]-660478335|0)<<14|s>>>18)+o|0)&e|o&~e)+r[4]-405537848|0)<<20|n>>>12)+s|0,n=((n+=((s=((s+=((o=((o+=((e=((e+=(n&o|s&~o)+r[9]+568446438|0)<<5|e>>>27)+n|0)&s|n&~s)+r[14]-1019803690|0)<<9|o>>>23)+e|0)&n|e&~n)+r[3]-187363961|0)<<14|s>>>18)+o|0)&e|o&~e)+r[8]+1163531501|0)<<20|n>>>12)+s|0,n=((n+=((s=((s+=((o=((o+=((e=((e+=(n&o|s&~o)+r[13]-1444681467|0)<<5|e>>>27)+n|0)&s|n&~s)+r[2]-51403784|0)<<9|o>>>23)+e|0)&n|e&~n)+r[7]+1735328473|0)<<14|s>>>18)+o|0)&e|o&~e)+r[12]-1926607734|0)<<20|n>>>12)+s|0,n=((n+=((s=((s+=((o=((o+=((e=((e+=(n^s^o)+r[5]-378558|0)<<4|e>>>28)+n|0)^n^s)+r[8]-2022574463|0)<<11|o>>>21)+e|0)^e^n)+r[11]+1839030562|0)<<16|s>>>16)+o|0)^o^e)+r[14]-35309556|0)<<23|n>>>9)+s|0,n=((n+=((s=((s+=((o=((o+=((e=((e+=(n^s^o)+r[1]-1530992060|0)<<4|e>>>28)+n|0)^n^s)+r[4]+1272893353|0)<<11|o>>>21)+e|0)^e^n)+r[7]-155497632|0)<<16|s>>>16)+o|0)^o^e)+r[10]-1094730640|0)<<23|n>>>9)+s|0,n=((n+=((s=((s+=((o=((o+=((e=((e+=(n^s^o)+r[13]+681279174|0)<<4|e>>>28)+n|0)^n^s)+r[0]-358537222|0)<<11|o>>>21)+e|0)^e^n)+r[3]-722521979|0)<<16|s>>>16)+o|0)^o^e)+r[6]+76029189|0)<<23|n>>>9)+s|0,n=((n+=((s=((s+=((o=((o+=((e=((e+=(n^s^o)+r[9]-640364487|0)<<4|e>>>28)+n|0)^n^s)+r[12]-421815835|0)<<11|o>>>21)+e|0)^e^n)+r[15]+530742520|0)<<16|s>>>16)+o|0)^o^e)+r[2]-995338651|0)<<23|n>>>9)+s|0,n=((n+=((o=((o+=(n^((e=((e+=(s^(n|~o))+r[0]-198630844|0)<<6|e>>>26)+n|0)|~s))+r[7]+1126891415|0)<<10|o>>>22)+e|0)^((s=((s+=(e^(o|~n))+r[14]-1416354905|0)<<15|s>>>17)+o|0)|~e))+r[5]-57434055|0)<<21|n>>>11)+s|0,n=((n+=((o=((o+=(n^((e=((e+=(s^(n|~o))+r[12]+1700485571|0)<<6|e>>>26)+n|0)|~s))+r[3]-1894986606|0)<<10|o>>>22)+e|0)^((s=((s+=(e^(o|~n))+r[10]-1051523|0)<<15|s>>>17)+o|0)|~e))+r[1]-2054922799|0)<<21|n>>>11)+s|0,n=((n+=((o=((o+=(n^((e=((e+=(s^(n|~o))+r[8]+1873313359|0)<<6|e>>>26)+n|0)|~s))+r[15]-30611744|0)<<10|o>>>22)+e|0)^((s=((s+=(e^(o|~n))+r[6]-1560198380|0)<<15|s>>>17)+o|0)|~e))+r[13]+1309151649|0)<<21|n>>>11)+s|0,n=((n+=((o=((o+=(n^((e=((e+=(s^(n|~o))+r[4]-145523070|0)<<6|e>>>26)+n|0)|~s))+r[11]-1120210379|0)<<10|o>>>22)+e|0)^((s=((s+=(e^(o|~n))+r[2]+718787259|0)<<15|s>>>17)+o|0)|~e))+r[9]-343485551|0)<<21|n>>>11)+s|0,t[0]=e+t[0]|0,t[1]=n+t[1]|0,t[2]=s+t[2]|0,t[3]=o+t[3]|0}function n(t){var r,e=[];for(r=0;r<64;r+=4)e[r>>2]=t.charCodeAt(r)+(t.charCodeAt(r+1)<<8)+(t.charCodeAt(r+2)<<16)+(t.charCodeAt(r+3)<<24);return e}function s(t){var r,e=[];for(r=0;r<64;r+=4)e[r>>2]=t[r]+(t[r+1]<<8)+(t[r+2]<<16)+(t[r+3]<<24);return e}function o(t){var r,s,o,a,i,f,h=t.length,u=[1732584193,-271733879,-1732584194,271733878];for(r=64;r<=h;r+=64)e(u,n(t.substring(r-64,r)));for(s=(t=t.substring(r-64)).length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],r=0;r>2]|=t.charCodeAt(r)<<(r%4<<3);if(o[r>>2]|=128<<(r%4<<3),r>55)for(e(u,o),r=0;r<16;r+=1)o[r]=0;return a=(a=8*h).toString(16).match(/(.*?)(.{0,8})$/),i=parseInt(a[2],16),f=parseInt(a[1],16)||0,o[14]=i,o[15]=f,e(u,o),u}function a(t){var r,n,o,a,i,f,h=t.length,u=[1732584193,-271733879,-1732584194,271733878];for(r=64;r<=h;r+=64)e(u,s(t.subarray(r-64,r)));for(n=(t=r-64>2]|=t[r]<<(r%4<<3);if(o[r>>2]|=128<<(r%4<<3),r>55)for(e(u,o),r=0;r<16;r+=1)o[r]=0;return a=(a=8*h).toString(16).match(/(.*?)(.{0,8})$/),i=parseInt(a[2],16),f=parseInt(a[1],16)||0,o[14]=i,o[15]=f,e(u,o),u}function i(t){var e,n="";for(e=0;e<4;e+=1)n+=r[t>>8*e+4&15]+r[t>>8*e&15];return n}function f(t){var r;for(r=0;ru?new ArrayBuffer(0):(s=u-h,o=new ArrayBuffer(s),a=new Uint8Array(o),i=new Uint8Array(this,h,s),a.set(i),o)}}(),l.prototype.append=function(t){return this.appendBinary(h(t)),this},l.prototype.appendBinary=function(t){this._buff+=t,this._length+=t.length;var r,s=this._buff.length;for(r=64;r<=s;r+=64)e(this._hash,n(this._buff.substring(r-64,r)));return this._buff=this._buff.substring(r-64),this},l.prototype.end=function(t){var r,e,n=this._buff,s=n.length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(r=0;r>2]|=n.charCodeAt(r)<<(r%4<<3);return this._finish(o,s),e=f(this._hash),t&&(e=y(e)),this.reset(),e},l.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},l.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},l.prototype.setState=function(t){return this._buff=t.buff,this._length=t.length,this._hash=t.hash,this},l.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},l.prototype._finish=function(t,r){var n,s,o,a=r;if(t[a>>2]|=128<<(a%4<<3),a>55)for(e(this._hash,t),a=0;a<16;a+=1)t[a]=0;n=(n=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),s=parseInt(n[2],16),o=parseInt(n[1],16)||0,t[14]=s,t[15]=o,e(this._hash,t)},l.hash=function(t,r){return l.hashBinary(h(t),r)},l.hashBinary=function(t,r){var e=f(o(t));return r?y(e):e},l.ArrayBuffer=function(){this.reset()},l.ArrayBuffer.prototype.append=function(t){var r,n=c(this._buff.buffer,t,!0),o=n.length;for(this._length+=t.byteLength,r=64;r<=o;r+=64)e(this._hash,s(n.subarray(r-64,r)));return this._buff=r-64>2]|=n[r]<<(r%4<<3);return this._finish(o,s),e=f(this._hash),t&&(e=y(e)),this.reset(),e},l.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},l.ArrayBuffer.prototype.getState=function(){var t=l.prototype.getState.call(this);return t.buff=p(t.buff),t},l.ArrayBuffer.prototype.setState=function(t){return t.buff=u(t.buff,!0),l.prototype.setState.call(this,t)},l.ArrayBuffer.prototype.destroy=l.prototype.destroy,l.ArrayBuffer.prototype._finish=l.prototype._finish,l.ArrayBuffer.hash=function(t,r){var e=f(a(new Uint8Array(t)));return r?y(e):e},l}()}},r={};function e(n){var s=r[n];if(void 0!==s)return s.exports;var o=r[n]={exports:{}};return t[n](o,o.exports,e),o.exports}e.n=t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},e.d=(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},e.o=(t,r)=>Object.prototype.hasOwnProperty.call(t,r),(()=>{"use strict";var t=e(735),r=e.n(t);self.onmessage=async function(t){if(t.data.file&&"begin hash"==t.data.msg){console.log("ello chum!");const e=t.data.file,n=PydioApi.getMultipartPartSize();if(e.size>n)try{const t=await((t,e)=>new Promise(((n,s)=>{const o=e,a=Math.ceil(t.size/o),i=[];let f=0;const h=new FileReader,u=new(r().ArrayBuffer),p=()=>{const r=f*o,e=r+o>=t.size?t.size:r+o;h.readAsArrayBuffer(t.slice(r,e))};h.onload=t=>{u.append(t.target.result);const e=u.end();if(i.push(e),u.reset(),f++,fs(h.error),p()})))(e,n);postMessage({status:"complete",hash:t})}catch(t){postMessage({status:"error",message:t.message})}else{const t=await incrementalMD5(e);postMessage({status:"complete",hash:t})}self.close()}}})()})(); \ No newline at end of file diff --git a/@latest/main.js b/@latest/main.js index 38ac74d..e5d12b3 100644 --- a/@latest/main.js +++ b/@latest/main.js @@ -1 +1 @@ -(()=>{var e={125:()=>{async function e(){const e=`${window.location.origin}/api/preservation`,t=await PydioApi._PydioRestClient.getOrUpdateJwt();return fetch(e,{headers:{Authorization:`Bearer ${t}`},method:"GET"}).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return e.json()})).then((e=>{sessionStorage.setItem("preservationConfigs",JSON.stringify(e))})).catch((e=>{console.error("Fetch error:",e)}))}function t(t,n,o){const s=document.createElement("div");s.id="preservationConfigsSubMenu",s.style.maxHeight="8em",s.style.overflowY="scroll",s.innerHTML=n,o.forEach((e=>{let t=document.createElement("div");const n=JSON.parse(localStorage.getItem(e.id));if(t.style.transition="0.3s ease all",t.addEventListener("mouseenter",(e=>{e.target.style.background="var(--md-sys-color-outline-variant-50)"})),t.addEventListener("mouseleave",(e=>{e.target.style.background="none"})),t.addEventListener("click",(t=>{t.target.classList.contains("mdi-star-outline")?(console.info("bookmarked!"),localStorage.setItem(e.id,JSON.stringify({name:e.name,bookmarked:!0})),t.target.classList.remove("mdi-star-outline"),t.target.classList.add("mdi-star"),s.remove()):t.target.classList.contains("mdi-star")?(console.info("un-bookmarked!"),localStorage.setItem(e.id,JSON.stringify({name:e.name,bookmarked:!1})),t.target.classList.remove("mdi-star"),t.target.classList.add("mdi-star-outline"),s.remove()):(!async function(e){const t=await PydioApi._PydioRestClient.getOrUpdateJwt(),n=`${window.location.origin}/a/scheduler/hooks/a3m-transfer`,o=pydio._dataModel._selectedNodes.map((e=>({path:Curate.workspaces.getOpenWorkspace()+e._path,slug:e._metadata.get("usermeta-atom-linked-description")||""}))),i=JSON.stringify({Paths:o,JobParameters:{ConfigId:e.toString()}});fetch(n,{method:"POST",mode:"cors",headers:{accept:"application/json","accept-language":"en-GB,en-US;q=0.9,en;q=0.8",authorization:`Bearer ${t}`,"cache-control":"no-cache","content-type":"application/json",pragma:"no-cache","sec-fetch-mode":"cors","sec-fetch-site":"same-origin","x-pydio-language":"en-us"},body:i}).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return e.json()})).then((e=>{console.info("Preservation config initiated successfully")})).catch((e=>{console.error("Fetch error:",e)}))}(e.id),s.remove())})),t.innerHTML='
Source Editor
',t.querySelector('[role="menuLabel"]').innerText=e.name,s.querySelector('[role="menu"]').appendChild(t),n&&n.bookmarked){let e=t.querySelector(".mdi-star-outline");e.classList.remove("mdi-star-outline"),e.classList.add("mdi-star")}}));const l=document.createElement("div");l.innerHTML='
Source Editor
',l.querySelector('[role="menuLabel"]').innerText="Create New",l.style.transition="0.3s ease all",l.addEventListener("mouseenter",(e=>{e.target.style.background="var(--md-sys-color-outline-variant-50)"})),l.addEventListener("mouseleave",(e=>{e.target.style.background="none"})),l.addEventListener("click",(t=>{document.querySelector("#preservationConfigsSubMenu").remove(),function(t,n){const o=document.createElement("div");o.classList.add("config-modal-container");const r=document.createElement("div");r.classList.add("config-modal-scroll-container");const s=document.createElement("div");s.classList.add("config-modal-content");const l=document.createElement("div");l.textContent=t,l.classList.add("config-popup-title"),s.appendChild(l);const d=document.createElement("div");d.classList.add("config-main-options-container"),s.appendChild(d),n.forEach((e=>{const t=document.createElement("div");t.classList.add("config-input-category"),t.id=e.category.replaceAll(" ","_");const n=document.createElement("div");n.classList.add("config-text-label"),n.textContent=e.category,t.appendChild(n),e.inputs.forEach((e=>{a(e,t)})),r.appendChild(t)}));const c=document.createElement("button");c.classList.add("config-clear-form"),c.textContent="Clear Form",c.addEventListener("click",(e=>{r.querySelectorAll("input").forEach((e=>{"text"==e.type?e.value="":"checkbox"==e.type?e.checked=!1:e.value=0,e.dispatchEvent(new CustomEvent("change",{bubbles:!0})),e.dispatchEvent(new CustomEvent("input",{bubbles:!0}))}))})),r.appendChild(c);const p=document.createElement("div");p.classList.add("config-options-container"),p.style="display: flex;align-items: center;flex-wrap: nowrap;flex-direction: column;";const u=document.createElement("div");u.classList.add("config-text-label"),u.textContent="Create or Edit Configs",u.style="padding-bottom: 1em !important",p.appendChild(u),p.appendChild(r);const m=document.createElement("div");m.classList.add("config-modal-scroll-container");const h=document.createElement("button");h.classList.add("config-save-button"),h.textContent="Save Config",h.addEventListener("click",(t=>{const o=JSON.parse(sessionStorage.getItem("preservationConfigs")),a=p.querySelector("#name").value,r=n.flatMap((e=>e.inputs.map((e=>e.name)).concat(e.inputs.flatMap((e=>e.suboptions?e.suboptions.map((e=>e.name)):[]))))),s={},l=o?.find((e=>e.name==a));l?s.id=l.id:s.user=pydio.user.id,r.forEach((e=>{const t=document.querySelector("#"+e);t&&"submit"!=t.type&&(t.disabled&&(s[e.toLowerCase()]=!1),"checkbox"==t.type?s[e.toLowerCase()]=+t.checked:t.querySelector("input[type='range']")?s[e.toLowerCase()]=t.querySelector("input[type='range']").value:"name"==e?s.name=t.value:"image_normalization_tiff"==e?s[e.toLowerCase()]="TIFF"===t.value?1:0:"string"==typeof t.value?s[e.toLowerCase()]=t.value.toLowerCase():s[e.toLowerCase()]=t.value)})),l?async function(e){const t=`${window.location.origin}/api/preservation/${e.id}`,n=await PydioApi._PydioRestClient.getOrUpdateJwt();fetch(t,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify(e)}).then((e=>{if(!e.ok)throw new Error(`HTTP error while updating config, Status: ${e.status}`);if(200==e.status)return console.info("config saved successfully"),e.json()})).catch((e=>{console.error("Fetch error:",e),Curate.ui.modals.curatePopup({title:"Error",type:"error",content:"There was an error saving your modified configuration. Please try again, or contact support if the problem persists."}).fire()}))}(s):async function(e){const t=`${window.location.origin}/preservation`,n=await PydioApi._PydioRestClient.getOrUpdateJwt();return fetch(t,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify(e)}).then((e=>{if(e.ok)return console.info("config saved successfully"),e.json();throw new Error(`HTTP error! Status: ${e.status}`)})).catch((e=>{console.error("Fetch error:",e),Curate.ui.modals.curatePopup({title:"Error",type:"error",content:"There was an error saving your configuration. Please try again, or contact support if the problem persists."}).fire()}))}(s).then((t=>{if(t){const t=JSON.parse(sessionStorage.getItem("preservationConfigs"));e().then((e=>{const n=JSON.parse(sessionStorage.getItem("preservationConfigs"));if(s.id)document.querySelector("#config-"+s.id).remove(),i(m,[n.find((e=>e.id===s.id))]);else{const e=n.find((e=>!t.some((t=>t.id===e.id))));i(m,[e])}}))}}))})),p.appendChild(h),d.appendChild(p),p.addEventListener("input",(e=>{let t=p.querySelector("#name").value;0==t.length?h.style.display="none":t.trim().length<3?(h.textContent="Add a name 3 characters or longer",h.style.display="block"):(h.textContent="Save Config",h.style.display="block")}));const g=document.createElement("div");g.classList.add("config-options-container"),g.id="savedConfigsContainer",g.style="display:flex;align-items:center;justify-content:flex-start;flex-direction:column;";const f=document.createElement("div");f.classList.add("config-text-label"),f.style="padding-bottom: 1em; !important",f.textContent="Saved Configs",g.appendChild(f);const y=JSON.parse(sessionStorage.getItem("preservationConfigs"));i(m,g,y),g.appendChild(m),d.appendChild(g),o.appendChild(s);const b=document.createElement("div");b.classList.add("action-buttons");const v=document.createElement("button");v.classList.add("config-modal-close-button"),v.textContent="Close",v.addEventListener("click",(()=>{document.body.removeChild(o)})),b.appendChild(v),s.appendChild(b),document.body.appendChild(o),o.style.display="flex"}("Preservation Configs",r)})),s.querySelector('[role="menu"]').appendChild(l),document.body.appendChild(s);const d=s.firstChild.getBoundingClientRect(),c=t.getBoundingClientRect(),p=c.left,u=window.innerWidth-c.right;var m;return pu?(m=c.top,newRight=window.innerWidth-c.left+d.width,s.style.position="absolute",s.style.top=`${m}px`,s.style.right=`${newRight}px`):(m=c.top,newRight=window.innerWidth-c.right,s.style.position="absolute",s.style.top=`${m}px`,s.style.right=`${newRight}px`),s}function n(e,t,n="16px",o="5px"){const i=document.createElement("div");return i.style.transition="0.3s ease all",i.style.maxWidth="20em",i.addEventListener("mouseenter",(e=>{e.target.style.background="var(--md-sys-color-outline-variant-50)"})),i.addEventListener("mouseleave",(e=>{e.target.style.background="none"})),i.id="preservationConfigDropdown",i.innerHTML='
'+e+"
",i}function o(e){const o=JSON.parse(sessionStorage.getItem("preservationConfigs"));setTimeout((()=>{for(const i of e.querySelectorAll("div")){if("Preserve"==i.innerText){const a=n("Preservation Configs","mdi-menu-right","24px","0px");e.insertBefore(a,i.nextSibling);const r=document.querySelector("#preservationConfigDropdown"),s=[1,3];return document.addEventListener("mousedown",(e=>{}),{once:!0}),r.addEventListener("click",(e=>{const n=t(r,'
',o);setTimeout((()=>{document.addEventListener("mousedown",(e=>{s.includes(e.which)&&(n.contains(e.target)||n.remove())}),{once:!0})}),100)})),void o.forEach((t=>{const o=JSON.parse(localStorage.getItem(t.id.toString()));if(o&&o.bookmarked){const o=n(t.name,"mdi-console");e.insertBefore(o,i.nextSibling)}}))}document.querySelector("#preservationConfigDropdown")&&document.querySelector("#preservationConfigDropdown").remove()}}),10)}function i(t,n,o){console.log(o),o?.forEach((n=>{const o=document.createElement("div");o.id="config-"+n.id,o.classList.add("saved-config-item"),o.style.opacity="0",o.addEventListener("mouseenter",(e=>{o.style.backgroundColor="var(--md-sys-color-outline-variant)"})),o.addEventListener("mouseleave",(e=>{o.style.backgroundColor="var(--md-sys-color-on-secondary)"})),o.addEventListener("click",(e=>{if(!["saved-config-delete","config-bookmark-container","mdi-star","mdi-star-outline"].includes(e.target.className))for(var t in n)if(n.hasOwnProperty(t)){var o="#"+t,i=document.querySelector(o);i&&("checkbox"==i.type?i.checked=!!n[t]:"select-one"==i.type?"image_normalization_tiff"==i.id&&(i.value=1===n[t]?"TIFF":"JPEG2000"):"range"==i.type?(i.value=n[t],i.dispatchEvent(new CustomEvent("input",{bubbles:!0}))):i.value=n[t],i.dispatchEvent(new CustomEvent("change",{bubbles:!0})))}}));const i=document.createElement("div");i.classList.add("saved-config-information");const a=document.createElement("label");a.textContent=n.name,a.style.fontWeight="500",a.style.marginBottom="0";const r=document.createElement("label");r.classList.add("config-text-label");const s=document.createElement("div"),l=document.createElement("label");l.for="config-description-"+n.id,l.textContent="Description: ";const d=document.createElement("span");d.textContent=n.description,d.id="config-description-"+n.id,s.appendChild(l),s.appendChild(d);const c=document.createElement("div"),p=document.createElement("label");p.id="config-user-"+n.id,p.textContent="User: ";const u=document.createElement("span");u.id="config-user-"+n.id,u.textContent=n.user,c.appendChild(p),c.appendChild(u),r.appendChild(s),r.appendChild(c),i.appendChild(a),i.appendChild(r);const m=document.createElement("button");m.classList.add("saved-config-delete"),m.addEventListener("mouseenter",(e=>{o.style.backgroundColor="var(--md-sys-color-on-secondary)",m.style.backgroundColor="#ff2c2c"})),m.addEventListener("mouseleave",(e=>{m.style.backgroundColor="var(--md-sys-color-error-container)",e.toElement==o||e.toElement==o.querySelector(".saved-config-information")?o.style.backgroundColor="var(--md-sys-color-outline-variant)":o.style.backgroundColor="var(--md-sys-color-on-secondary)"})),m.addEventListener("click",(t=>{confirm("Deleting a config is permanent and cannot be reverted, do you wish to continue?")&&(o.style.opacity="1",async function(t){const n=`${window.location.origin}/preservation/${t}`,o=await PydioApi._PydioRestClient.getOrUpdateJwt();return fetch(n,{method:"DELETE",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${o}`}}).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return e.json()})).then((t=>{if(t)return e(),t;throw new Error("Delete operation failed.")})).catch((e=>{console.error("Fetch error:",e),Curate.ui.modals.curatePopup({title:"Error",type:"error",content:"There was an error deleting your configuration. Please try again, or contact support if the problem persists."}).fire()}))}(n.id).then((e=>{console.info("Delete successful:",e),o.style.animation="none",o.offsetWidth,o.style.animation="config-slide-and-fade-in 0.4s forwards reverse",setTimeout((e=>{o.remove()}),400)})).catch((e=>{o.style.animation="delete-failed-shake-animation 0.5s 0s infinite";const t=o.style.backgroundColor;o.style.backgroundColor="red",console.error("Delete failed:",e),setTimeout((()=>{o.style.animation="none",o.style.backgroundColor=t}),500)})))})),m.textContent="Delete Config";const h=document.createElement("div");h.classList.add("config-bookmark-container"),h.addEventListener("click",(e=>{e.target.classList.contains("mdi-star-outline")?(console.info("bookmarked!"),localStorage.setItem(n.id,JSON.stringify({name:n.name,bookmarked:!0})),e.target.classList.remove("mdi-star-outline"),e.target.classList.add("mdi-star")):e.target.classList.contains("mdi-star")&&(console.info("un-bookmarked!"),localStorage.setItem(n.id,JSON.stringify({name:n.name,bookmarked:!1})),e.target.classList.remove("mdi-star"),e.target.classList.add("mdi-star-outline"))}));const g=document.createElement("span"),f=JSON.parse(localStorage.getItem(n.id.toString()));f&&f.bookmarked?g.classList.add("mdi-star"):g.classList.add("mdi-star-outline"),h.appendChild(g),o.appendChild(h),o.appendChild(i),o.appendChild(m),t.appendChild(o)}));const i=t.querySelectorAll(".saved-config-item");if(i?.forEach(((e,t)=>e.style.animationDelay=.55*t/i.length+"s")),i?.forEach(((e,t,n)=>{const o=.05*(t+1),i=1-o;e.style.animationDelay=`${o}s`,e.style.animationDuration=`${i}s`})),!o||0==o?.length){const e=document.createElement("div");e.textContent="No Saved Preservation Configs Found",e.style.margin="3em",e.style.width="80%",e.style.height="10%",e.style.textAlign="center",e.style.display="flex",e.style.color="white",e.style.background="var(--md-sys-color-outline-variant-50)",e.style.justifyContent="center",e.style.alignItems="center",e.style.borderRadius="1.5em",n.appendChild(e)}}function a(e,t){const n=document.createElement("div");if(n.classList.add("input-container"),"info"===e.type){const t=document.createElement("div");t.classList.add("config-info"),t.textContent=e.text,n.appendChild(t)}if("text"===e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const o=document.createElement("input");o.id=e.name,o.setAttribute("type","text"),o.classList.add("config-text-input"),n.appendChild(t),n.appendChild(o)}else if("toggle"===e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const o=document.createElement("input");o.setAttribute("type","checkbox"),o.classList.add("tgl"),o.classList.add("tgl-light"),o.id=e.name;const i=document.createElement("label");i.classList.add("tgl-btn"),i.htmlFor=e.name,n.appendChild(t),n.appendChild(o),n.appendChild(i)}else if("dropdown"===e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const o=document.createElement("select");o.id=e.name,o.classList.add("config-dropdown-select"),e.options.forEach((e=>{const t=document.createElement("option");t.value=e,t.textContent=e,o.appendChild(t)})),n.appendChild(t),n.appendChild(o)}else if("slider"==e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const i=document.createElement("div");i.classList.add("config-slider-container");const a=document.createElement("div");a.classList.add("config-slider-value"),a.textContent=e.min;const r=document.createElement("input");r.id=e.name,r.setAttribute("type","range"),r.classList.add("config-slider"),r.setAttribute("min",e.min),r.setAttribute("max",e.range),r.setAttribute("step",e.step),r.setAttribute("value",e.min);const s=document.createElement("div");s.classList.add("config-slider-minmax-container");const l=document.createElement("span");l.classList.add("config-slider-minmax"),l.textContent=e.min;const d=document.createElement("span");d.classList.add("config-slider-minmax"),d.textContent=e.range,r.addEventListener("input",(()=>{const e=r.value;a.textContent=e})),s.appendChild(l);for(var o=0;o{const n=e.name;t.target.id==n&&(t.target.checked?e.suboptions.forEach((e=>{if("info"==e.type)return;const t="#"+e.name;document.querySelector(t).disabled=!1,document.querySelector(t).parentElement.style.opacity="1"})):e.suboptions.forEach((e=>{if("info"==e.type)return;const t="#"+e.name;document.querySelector(t).disabled=!0,document.querySelector(t).checked=!1,document.querySelector(t).parentElement.style.opacity="0.3"})))})),t.appendChild(n),e.suboptions&&e.suboptions.forEach((e=>{a(e,n),setTimeout((t=>{if("info"==e.type)return;const n="#"+e.name;document.querySelector(n).disabled=!0,document.querySelector(n).parentElement.style.opacity="0.3"}),50)}))}const r=[{category:"Details",inputs:[{label:"Config Name",name:"name",type:"text"},{label:"Config Description",name:"description",type:"text"}]},{category:"Normalisation",inputs:[{label:"Normalise Objects",name:"normalize",type:"toggle",suboptions:[{label:"Image Normalisation Format",name:"image_normalization_tiff",type:"dropdown",options:["TIFF","JPEG2000"]}]}]},{category:"Dissemination",inputs:[{label:"Create Dissemination Package",name:"dip_enabled",type:"toggle",suboptions:[{label:"Dissemination Information",name:"dip_info",type:"info",text:"Create dissemination packages from AIPs generated by this config. Created DIPs will automatically be connected to the linked description of the source data. For this option to work, you must configure a connected AtoM instance."},{label:"Go to AtoM Configuration",name:"atom_config",type:"button",text:"Go to AtoM Configuration",onclick:e=>{Curate.ui.modals.curatePopup({title:"Connect to Your AtoM Instance"},{afterLoaded:e=>{const t=document.createElement("connect-to-atom");e.querySelector(".config-main-options-container").appendChild(t)}}).fire()}}]}]},{category:"Packaging and Compression",inputs:[{label:"AIP Packaging Type",name:"process_type",type:"dropdown",options:["standard","eark"]},{label:"Compress AIPs",name:"compress_aip",type:"toggle",suboptions:[{label:"Warning",name:"compression_warning",type:"info",text:"Compressing AIPs will make their contents unsearchable and prevent descriptive metadata from being reassociated with output objects. You can compress your AIPs for distribution or deep-storage while conserving the uncompressed AIP by right-clicking an AIP in a workspace."},{label:"Compression Algorithm",name:"compression_algorithm",type:"dropdown",options:["tar","tar_bzip2","tar_gzip","s7_copy ","s7_bzip2","s7_lzma"]},{label:"Compression Level",name:"compression_level",type:"slider",min:1,range:9,step:1}]}]},{category:"Transfer Options",inputs:[{label:"Generate Transfer Structure Report",name:"gen_transfer_struct_report",type:"toggle"},{label:"Document Empty Directories",name:"document_empty_directories",type:"toggle"},{label:"Extract Packages",name:"extract_packages",type:"toggle",suboptions:[{label:"Delete Packages After Extraction",name:"delete_packages_after_extraction",type:"toggle"}]}]}];window.addEventListener("load",(t=>{!async function(){try{await((e,t=50)=>new Promise((n=>{const o=setInterval((()=>{void 0!==window[e]&&(clearInterval(o),n(window[e]))}),t)})))("PydioApi");e()}catch(e){console.error("An error occurred:",e)}}(),setTimeout((()=>{document.addEventListener("mousedown",(e=>{document.querySelector('.context-menu [role="menu"]')&&document.querySelector('.context-menu [role="menu"]').contains(e.target)||document.querySelector(".main-files-list")&&(3==e.which&&document.querySelector(".main-files-list").contains(e.target)?document.querySelector('.context-menu [role="menu"]')&&!document.querySelector("#preservationConfigDropdown")?setTimeout((()=>{o(document.querySelector('.context-menu [role="menu"]'))}),100):function(e){if(document.querySelector("#\\/recycle_bin")&&document.querySelector("#\\/recycle_bin").contains(e.target))return void(document.querySelector("#preservationConfigDropdown")&&document.querySelector("#preservationConfigDropdown").remove());const t=new MutationObserver((e=>{e.forEach((e=>{e.addedNodes.forEach((e=>{if(e.nodeType===Node.ELEMENT_NODE){const n=e.querySelector('.context-menu [role="menu"]');n&&(o(n),t.disconnect())}}))}))}));t.observe(document.body,{childList:!0,subtree:!0,once:!0})}(e):document.querySelector("#preservationConfigDropdown")&&setTimeout((()=>{document.querySelector("#preservationConfigDropdown")&&document.querySelector("#preservationConfigDropdown").remove()}),150))}),150)}))}))},627:()=>{document.addEventListener("change",(function(e){if(1===pydio._dataModel._selectedNodes.length&&e.target.nextElementSibling?.textContent.includes("Enable OAI Harvesting")&&"checkbox"===e.target.type){const t=e.target.nextElementSibling?.textContent.includes("Enable OAI-PMH Harvesting"),n=pydio._dataModel._selectedNodes[0],o=!n._isLeaf;t&&o&&Curate.ui.modals.curatePopup({title:"Send Update to Children",buttonType:"okCancel"},{afterLoaded:e=>{e.querySelector(".config-main-options-container").appendChild(function(){const e=document.createElement("div");e.style="margin: 12px 0px 6px;";const t=document.createElement("div");t.style="cursor: pointer; position: relative; overflow: visible; display: table; height: 52px; width: 100%; background-color: var(--md-sys-color-surface-variant); border-radius: 4px; margin-top: 8px; font-size: 15px; padding: 15px 10px 4px;";const n=document.createElement("input");n.type="checkbox",n.id="inheritValues",n.checked=!1,n.style="position: absolute; cursor: inherit; pointer-events: all; opacity: 0; width: 100%; height: 100%; z-index: 2; left: 0px; box-sizing: border-box; padding: 0px; margin: 0px;";const o=document.createElement("div");o.style="display: flex; width: 100%; height: 100%;";const i=document.createElement("div");i.style="transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; float: left; position: relative; display: block; flex-shrink: 0; width: 36px; margin-right: 8px; margin-left: 0px; padding: 4px 0px 6px 2px;";const a=document.createElement("div");a.style="transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; width: 100%; height: 14px; border-radius: 30px; background-color: var(--md-sys-color-outline-variant);";const r=document.createElement("div");r.style="color: rgb(25, 28, 30); background-color: var(--md-sys-color-primary); transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; box-sizing: border-box; font-family: Roboto, sans-serif; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 6px, rgba(0, 0, 0, 0.12) 0px 1px 4px; border-radius: 50%; position: absolute; top: 1px; left: 100%; width: 20px; height: 20px; line-height: 24px; margin-left: -20px;";const s=document.createElement("label");return s.style="float: left; position: relative; display: block; width: calc(100% - 46px); line-height: 24px; color: rgb(25, 28, 30); font-family: Roboto, sans-serif;",s.textContent="Update Children With New Value ",i.appendChild(a),i.appendChild(r),o.appendChild(i),o.appendChild(s),t.appendChild(n),t.appendChild(o),e.appendChild(t),n.addEventListener("change",(function(){n.checked?(a.style.backgroundColor="rgba(0, 102, 137, 0.5)",r.style.left="100%",s.textContent="Update Children With New Value (yes)"):(r.style.left="55%",a.style.backgroundColor="var(--md-sys-color-outline-variant)",s.textContent="Update Direct Descendant Files With New Value (no)")})),n.dispatchEvent(new Event("change")),e}())},onOk:()=>{const t=this.querySelector("#inheritValues[type='checkbox']");if(t&&t.checked){(async function(e,t=100){const n=async(e,n=0)=>{const o={NodePaths:[e+"/*"],Limit:t.toString(),Offset:n.toString()};return await Curate.api.fetchCurate("/a/tree/stats","POST",o)};let o=[],i=0,a=!0;for(;a;){const r=(await n(e,i)).Nodes||[];o=o.concat(r),a=r.length===t,i+=r.length}return o})(Curate.workspaces.getOpenWorkspace()+"/"+n._path).then((t=>{const n=[];t.forEach((e=>"LEAF"===e.Type?n.push(e.Uuid):null));var o,i;(o=n,i=50,Array.from({length:Math.ceil(o.length/i)},((e,t)=>o.slice(t*i,t*i+i)))).forEach((t=>{const n=((e,t)=>({MetaDatas:e.map((e=>({NodeUuid:e,Namespace:"usermeta-export-oai-harvest-enabled",JsonValue:t.toString(),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]}))),Operation:"PUT"}))(t,e.target.checked);Curate.api.fetchCurate("/a/user-meta/update","PUT",n)}))})).catch((e=>{console.error("Error retrieving nodes:",e)}))}}}).fire()}}))},93:()=>{const e={upload:{enforceWorkspaceUpload:{event:"drop",target:document,description:"enforce workspace upload permissions for standard users",handler:e=>{pydio.user.getIdmUser().then((t=>{if(!["quarantine","personal-files","common files"].includes(Curate.workspaces.getOpenWorkspace())&&!t.Roles.find((e=>e.Label="Admin"))&&e.dataTransfer?.files.length>0){e.stopImmediatePropagation();const t="
\n

Please upload your content to the Quarantine workspace instead. This will ensure your content is correctly scanned for malware before being released into the system.

\n

You can also upload your content to the Personal and Common Files workspaces, which is scanned for malware once but will not be quarantined and cannot be released into the system.

\n
";Curate.ui.modals.curatePopup({title:"You do not have permission to upload to this workspace",type:"warning",content:t}).fire()}}))}}},sharedSite:{enforceNoCustomActions:{event:"readystatechange",target:document,description:"enforce no custom actions for shared sites",handler:e=>{if(console.log("shared site enforce no custom actions"),window.location.pathname.includes("/public/"),window.location.pathname.includes("/public/")){const e=document.querySelector(".toolbars-button-menu.action-group_more_action"),t=Array.from(document.querySelector("#main-toolbar").children).find((e=>"button"===e.type&&e.querySelector(".action-local_toggle_theme"))),n=Array.from(document.querySelectorAll(".toolbars-button-menu")).find((e=>1==e.classList.length));e&&e.remove(),t&&t.remove(),n&&n.remove()}}}},move:{}};document.addEventListener("DOMContentLoaded",(t=>{var n;n=e,Object.entries(n).forEach((([e,t])=>{Object.entries(t).forEach((([t,{event:o,target:i,handler:a}])=>{console.log("attaching event handler",n[e][t]);try{i.addEventListener(o,a)}catch(o){console.error("could not attach: ",n[e][t])}}))}))}))},937:()=>{const e=[e=>e.querySelector(".icomoon-cells")?.closest("button"),e=>e.querySelector(".layout-fill")];window.addEventListener("load",(function t(){if(window.location.pathname.includes("/login")){const e=new MutationObserver((()=>{window.location.pathname.includes("/login")||(e.disconnect(),t())}));e.observe(document.documentElement,{childList:!0,subtree:!0})}else pydio?.user?(pydio.user.isAdmin||pydio.observe("context_changed",(t=>{if("Settings"===t._label){const t=new MutationObserver((()=>{let n=!1;e.forEach((e=>{const t=e(document);t&&(t.remove(),n=!0)})),n&&t.disconnect()}));t.observe(document.body,{childList:!0,subtree:!0})}})),window.removeEventListener("load",t)):setTimeout(t,100)}))},678:()=>{const e=e=>{try{return pydio._dataModel._selectedNodes[0]._metadata.get(e)||null}catch(e){return null}},t=(e,t,n,o)=>{const i=Curate.workspaces.getOpenWorkspace();return n&&"File has not been scanned"!=e||"quarantine"!=i||"Scan Limit Exceeded"===n?n&&"File has not been scanned"!=e||"quarantine"===i||"Scan Limit Exceeded"===n?"Quarantined"==n?`File in quarantine, current period: ${(e=>Math.floor((new Date-new Date(e))/864e5))(o)} days.`:"Scan Limit Exceeded"==n?"File is too large to be scanned.":"Passed"!=n||"personal-files"!=i&&"common files"!=i?"Passed"==n?"File has passed an initial scan but will not be scanned again, please move it into the Quarantine workspace.":"Released"==n?"File has been released from quarantine.":"Risk"==n?"File has not completed its quarantine period and is at risk.":void 0:`File has passed the ${i.replace("-"," ")} scan.`:"This file has not been scanned and is at risk. Please move it into the Quarantine workspace to be scanned.":"This file has not been scanned and is at risk."},n=(e,t)=>{const n=(e,t,n={})=>{const o=document.createElement("div");return o.className=e,o.textContent=t,Object.assign(o.style,n),o},o=n("infoPanelRow",null,{padding:"0px 16px 6px"}),i=n("infoPanelLabel",e,{fontWeight:"415"}),a=n("infoPanelValue",t);return o.appendChild(i),o.appendChild(a),o};function o(o){var i=e("files")?.[0]?.matches?.[0]?.id??"File has not been characterised",a=["usermeta-virus-scan-first","usermeta-virus-scan-second"].map((t=>e(t)||"File has not been scanned")),r=pydio._dataModel._selectedNodes[0]._metadata.get("etag");r.endsWith("-1")&&(r="Local hash");var s=e("mime");const l=e("usermeta-virus-scan"),d=e("usermeta-virus-scan-passed-date");var c=t(...a,l,d);setTimeout((function(){let e=document.createElement("div");e.style.marginTop="-11px",e.id="curateAdditionalInfo";let t=n("Pronom ID",i);"File has not been characterised"!==i&&(t.style.cursor="pointer",t.style.transition="all 0.2s ease-in-out",t.addEventListener("mouseenter",(e=>{t.style.textDecoration="underline",t.style.backgroundColor="rgba(153, 153, 153, 0.2)"})),t.addEventListener("mouseleave",(e=>{t.style.textDecoration="none",t.style.backgroundColor="transparent"})),t.addEventListener("click",(e=>{window.open(`https://www.nationalarchives.gov.uk/pronom/${i}`)})));let l=n("First virus scan result",a[0]),d=n("Second virus scan result",a[1]),p=(n("Mimetype",s),n("Status",c));o.querySelector(".panelContent").childNodes.forEach((e=>{e.innerText.includes("ETag")&&(e.firstChild.innerText="Checksum",e.querySelector(".infoPanelValue").innerText=r)}));let u=document.createElement("HR"),m=document.createElement("div"),h=document.createElement("div");h.style.marginBottom="5px",m.textContent="Quarantine Info",m.id="quarantineInfoLabel",m.style.color="rgb(77, 122, 143)",m.style.fontSize="14px",m.style.fontWeight="500",m.style.marginLeft="15px",m.style.marginBottom="10px",e.appendChild(t),e.appendChild(u),e.appendChild(m),e.appendChild(p),e.appendChild(l),e.appendChild(d),e.appendChild(h),o.querySelector("#curateAdditionalInfo")?(Array.from(document.querySelectorAll(".panelCard")).find((e=>e.textContent.includes("File Info")))?.querySelector("#curateAdditionalInfo")?.remove(),o.appendChild(e)):o.appendChild(e)}),5)}const i=(e,t)=>{t=Array.from(document.querySelectorAll(".panelCard")).find((e=>e.textContent.includes("File Info")));e.memo._selectedNodes&&0!=e.memo._selectedNodes.length&&e.memo._selectedNodes[0]!=a&&t&&t.querySelector(".panelContent")&&(o(t),a=e.memo._selectedNodes[0])};var a;const r=e=>{if(e)return pydio._dataModel._observers.selection_changed.includes(i)||pydio._dataModel.observe("selection_changed",(e=>{i(e)})),e.firstElementChild.addEventListener("click",(t=>{e.querySelector('[class*="mdi-chevron-"]').classList.contains("mdi-chevron-up")||e.querySelector('[class*="mdi-chevron-"]').classList.contains("mdi-chevron-down")})),function(e,t){if(!e||!e.parentElement)return void console.error("The element or its parent is not defined.");const n=new MutationObserver((o=>{for(let i of o)if(i.removedNodes.length)for(let o of i.removedNodes)if(o===e||o.contains(e))return t(),void n.disconnect()}));n.observe(e.parentElement,{childList:!0,subtree:!0})}(e.querySelector(".panelContent"),(()=>{e.querySelector("#curateAdditionalInfo").remove()})),void(e.querySelector(".panelContent")&&o(e))};new MutationObserver(((e,t)=>{for(const t of e)if("childList"===t.type)for(const e of t.addedNodes)e instanceof HTMLElement&&e.classList.contains("panelCard")&&e.innerText.includes("File Info")?r(e):e instanceof HTMLElement&&e.classList.contains("panelContent")&&e.parentElement.classList.contains("panelCard")&&e.parentElement.innerText.includes("File Info")&&r(e.parentElement)})).observe(document.documentElement,{childList:!0,subtree:!0})},663:()=>{window.addEventListener("load",(function(){new Promise(((e,t)=>{!function t(){"undefined"!=typeof pydio?e():setTimeout(t,100)}()})).then((()=>{pydio._dataModel.observe("selection_changed",(function(e){setTimeout((()=>{const e=document.querySelector("#info_panel > div");e&&e.scrollTo({top:0,left:0})}),50)}))}))}))},711:()=>{const e=window.curateDistrobution||"Soteria+",t=()=>{console.log("message modifier");const n=pydioBootstrap.parameters.get("i18nMessages");Object.keys(n).forEach((t=>{"string"==typeof n[t]&&(n[t]=n[t].replace(/Pydio\s*Cells/gi,e).replace(/(?{function e(e){let t=document.createElement("div"),n=document.createElement("button"),o=document.createElement("span"),i=document.createElement("text"),a=document.createElement("hr");i.textContent=e,i.style.marginTop="1em",o.style.ariaHidden="true",o.innerHTML="×",n.style.ariaLabel="Close alert",n.style.type="button",n.style.backgroundColor="white",n.style.border="0",n.style.position="absolute",n.style.top="0",n.style.right="0",n.onclick=function(){this.parentNode.className="slideOut",setTimeout((function(){t.remove()}),1e3)},n.appendChild(o),t.style.backgroundColor="white",t.style.borderRadius="0.5em",t.style.width="16em",t.style.height="auto",t.style.padding="1.8em",t.style.paddingBottom="0em",t.style.margin="2em",t.style.position="absolute",t.style.bottom="5em",t.style.right="0",t.style.boxShadow="0 10px 16px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19)",t.className="slideIn",a.style.borderTop="1px solid black",a.style.marginTop="1em",a.className="lineLoad",n.appendChild(o),t.appendChild(n),t.appendChild(i),t.appendChild(a),document.querySelector("body").appendChild(t),setTimeout((function(){t.classList.remove("slideIn")}),1e3),setTimeout((function(){t.className="slideOut",setTimeout((function(){t.remove()}),1e3)}),6e3)}let t=e=>new Promise((t=>setTimeout(t,e)));function n(){setTimeout((function(){let e=["Generate mimetype report","Export Archivematica JSON"];for(let t=0;t{window.addEventListener("load",(function(){var t=Object.fromEntries(pydioBootstrap.parameters).i18nMessages;Object.entries(e).forEach((function(e){t[e[0]]=e[1]}))}));var e={"ajax_gui.tour.welcomemodal.title":"Welcome to Curate","ajax_gui.tour.welcomemodal.subtitle":"Drag'n'drop a photo of you for your profile! This quick tour will guide you through the web interface.","ajax_gui.tour.welcomemodal.start":"Start the tour","ajax_gui.tour.workspaces.1":"Workspaces are top-level folders that help you manage your archiving workflow and organise your data. The Personal Files workspace can only be accessed by you and the Quarantine, Appraisal and Archive workspaces are shared with your workgroup. The Package Templates workspace is common to all accounts and is read only.","ajax_gui.tour.workspaces.2":"You can upload into the Personal Files and Quarantine workspaces, move files to Appraisal to work on them and deposit packages in the Archive when you are finished.","ajax_gui.tour.globsearch.title":"Global Search","ajax_gui.tour.globsearch.1":"Use this search form to find files or folders in any workspace. Only the first 5 results are shown, enter a workspace to get more results, and more search options. Tip: you can use an asterisk as a wild card.","ajax_gui.tour.globsearch.2":"When no search is entered, the history of your recently accessed files and folder is displayed instead.","ajax_gui.tour.openworkspace.title":"Open a workspace","ajax_gui.tour.openworkspace":"At the first connection, your history is probably empty. Enter the Personal or Quarantine workspaces to start adding files. Tip: files are virus checked when they are uploaded and should be kept in Quarantine for 30 days, after which they are scanned again.","ajax_gui.tour.create-menu.title":"Add files","ajax_gui.tour.create-menu":"Start adding new files or folders to the current workspace.","ajax_gui.tour.display-bar.title":"Display Options","ajax_gui.tour.display-bar":"This toolbar allows you to change the display: switch to thumbnails or detail mode depending on your usage, and sort files by name, date, etc...","ajax_gui.tour.infopanel.title":"Info Panel","ajax_gui.tour.infopanel.1":"Here, you will find a preview and comprehensive information about your current selection: file information, virus scan status, metadata, etc.","ajax_gui.tour.infopanel.2":"You can close this panel by using the info button in the display toolbar","ajax_gui.tour.uwidget.title":"User Settings","ajax_gui.tour.uwidget.addressbook":"Directory of all the users accessing to the platform. Create your own users, and constitute teams that can be used to share resources","ajax_gui.tour.uwidget.alerts":"Alerts panel will inform you when a user with whom you shared some resources did access it. They can be sent to you directly by email.","ajax_gui.tour.uwidget.menu":"Access to other options : manage your profile and password, view all of the public links you have created, send a support message, configure the Archivematica Connector and sign out of the platform.","ajax_gui.tour.uwidget.home":"Go back to the welcome panel with this button"}},92:()=>{[{name:"he",url:"https://cdn.jsdelivr.net/npm/he@1.2.0/he.min.js"},{name:"swal",url:"https://cdn.jsdelivr.net/npm/sweetalert2@11"},{name:"papaparse",url:"https://cdn.jsdelivr.net/npm/papaparse@5.4.1/papaparse.min.js"},{name:"chart.js",url:"https://cdn.jsdelivr.net/npm/chart.js"},{name:"spark-md5",url:"https://cdnjs.cloudflare.com/ajax/libs/spark-md5/3.0.2/spark-md5.min.js"}].forEach((e=>{let t=document.createElement("script");t.src=e.url,t.onerror=function(){console.error("Failed to load external library: ",e.name,"please reload the page or contact your admin if the issue persists.")},document.head.appendChild(t)}))},380:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.apiKey="",this.atomUrl="",this.username="",this.password="",this.retrieveDetails(),this.render()}async retrieveDetails(){try{const e=await Curate.api.fetchCurate("/api/atom","GET");this.apiKey=e.atom_api_key,this.atomUrl=e.atom_url,this.username=e.atom_username,this.password=e.atom_password,this.render()}catch(e){console.error("Error retrieving details from Atom:",e)}}saveDetails(e){e.preventDefault(),Curate.api.fetchCurate("/api/atom","POST",{atom_api_key:this.apiKey,atom_url:this.atomUrl,atom_username:this.username,atom_password:this.password}).then((e=>{console.log("Saved Atom details:",e)})).catch((e=>{console.error("Error saving Atom details:",e)})),""!==this.apiKey&&(localStorage.setItem("atom_api_key",this.apiKey),console.log("Saving API Key:",this.apiKey)),""!==this.atomUrl&&(localStorage.setItem("atom_url",this.atomUrl),console.log("Saving Atom URL:",this.atomUrl)),""!==this.username&&(localStorage.setItem("atom_username",this.username),console.log("Saving Atom Username:",this.username)),""!==this.password&&(localStorage.setItem("atom_password",this.password),console.log("Saving Atom Password:",this.password)),this.render()}handleApiKeyChange(e){this.apiKey=e.target.value}handleUrlChange(e){this.atomUrl=e.target.value}handleUsernameChange(e){this.username=e.target.value}handlePasswordChange(e){this.password=e.target.value}togglePasswordVisibility(){const e=this.shadowRoot.querySelector("#password"),t=this.shadowRoot.querySelector("#toggle-password");"password"===e.type?(e.type="text",t.textContent="Hide"):(e.type="password",t.textContent="Show")}render(){this.shadowRoot.innerHTML=`\n \n
\n
\n
\n Current API Key:\n ${"*".repeat(this.apiKey?.length)||"Not Set"}\n
\n
\n Current Atom URL:\n ${this.atomUrl||"Not Set"}\n
\n
\n Current Username:\n ${this.username||"Not Set"}\n
\n
\n Current Password:\n ${"*".repeat(this.password?.length)||"Not Set"}\n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n \n
\n \n
\n
\n `,this.shadowRoot.querySelector("#details-form").addEventListener("submit",(e=>this.saveDetails(e))),this.shadowRoot.querySelector("#api-key").addEventListener("input",(e=>this.handleApiKeyChange(e))),this.shadowRoot.querySelector("#atom-url").addEventListener("input",(e=>this.handleUrlChange(e))),this.shadowRoot.querySelector("#username").addEventListener("input",(e=>this.handleUsernameChange(e))),this.shadowRoot.querySelector("#password").addEventListener("input",(e=>this.handlePasswordChange(e))),this.shadowRoot.querySelector("#toggle-password").addEventListener("click",(()=>this.togglePasswordVisibility()))}}customElements.define("connect-to-atom",e)},543:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.atomUrl=null,this.criteria=[{id:0,query:"",field:"",operator:""}],this.results=[],this.criterionIndex=1,this.node=null,this.error=null,this.isLoading=!1,this.currentPage=1,this.totalResults=0,this.resultsPerPage=10,this.initialise(),this.render()}async initialise(){this.atomUrl=await this.getAtomUrl()}setNode(e){this.node=e,this.render()}addCriterion(){this.criteria.push({id:this.criterionIndex,query:"",field:"",operator:"and"}),this.criterionIndex++,this.render()}removeCriterion(e){this.criteria=this.criteria.filter((t=>t.id!==e)),this.render()}handleInputChange(e,t,n){this.criteria=this.criteria.map((o=>o.id===e?{...o,[t]:n}:o));const o=this.shadowRoot.querySelector(`[data-id="${e}"][data-field="${t}"]`);o&&(o.value=n)}async performSearch(e=1){this.isLoading=!0,this.error=null,this.currentPage=e,this.render();const t=new URLSearchParams;this.criteria.forEach(((e,n)=>{n>0&&t.append(`so${n}`,e.operator),t.append(`sq${n}`,e.query),t.append(`sf${n}`,e.field)})),t.append("topLod",0),t.append("skip",(e-1)*this.resultsPerPage);try{const e=`${window.location.protocol}//${window.location.hostname}/api/atom/search`,n=await PydioApi._PydioRestClient.getOrUpdateJwt(),o=await fetch(`${e}?${t.toString()}`,{headers:{Authorization:`Bearer ${n}`}});if(!o.ok)throw new Error(`HTTP error! status: ${o.status}`);const i=await o.json();console.log("Retrieved results:",i),this.results=i.results,this.totalResults=i.total}catch(e){console.error("Error performing search:",e),this.error=`An error occurred while searching: ${e.message}`}finally{this.isLoading=!1,this.render()}}handleResultClick(e){console.log("Result clicked:",e);var t=[];if(!this.node)throw new Error("No node set");console.log("node to link to:",this.node),t.push({NodeUuid:this.node._metadata.get("uuid"),JsonValue:JSON.stringify(e),Namespace:"usermeta-atom-linked-description",Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]}),Curate.api.fetchCurate("/a/user-meta/update","PUT",{MetaDatas:t,Operation:"PUT"}),this.dispatchEvent(new CustomEvent("description-linked",{detail:e})),this.remove()}toggleAccordion(e){e.classList.toggle("collapsed");const t=e.nextElementSibling,n=e.querySelector(".chevron");t.classList.contains("show")?(t.classList.remove("show"),n.classList.remove("down"),localStorage.setItem("accordionState","true")):(t.classList.add("show"),n.classList.add("down"),localStorage.setItem("accordionState","false"))}renderPagination(){const e=Math.ceil(this.totalResults/this.resultsPerPage);let t="";if(e>1){t+='
',t+='
Showing results '+((this.currentPage-1)*this.resultsPerPage+1)+" - "+Math.min(this.currentPage*this.resultsPerPage,this.totalResults)+" of "+this.totalResults+"
",t+='",t+="
"}return t}getPageRange(e,t){let n=[];const o=e-2,i=e+2+1;for(let e=1;e<=t;e++)(1===e||e===t||e>=o&&e1===e||e===t||(!i[o-1]||i[o-1]+1===e||(n.splice(o,0,null),!0)))),n}async getAtomUrl(){return Curate.api.fetchCurate(":6900/atom","GET").then((e=>e.atom_url))}render(){this.shadowRoot.innerHTML=`\n \n
\n \n
\n
\n

This interface allows you to search for descriptions in your AtoM instance using a set of search criteria.

\n

You can add as many search criteria as you like, and then perform a search to find descriptions that match your criteria.

\n

Once you have found a description, you can link it to your selected node in Curate.

\n

Please note: only the top-level linked description will be considered when associating your dissemination package with AtoM.

\n

For example, if you create an AIP from a folder containing multiple files, only the folder itself will be checked for a linked description.

\n

AtoM automatically links the sub-files or folders as child level descendants of the top-level linked description.

\n
\n
\n
\n
\n
\n ${this.criteria.map(((e,t)=>`\n
\n ${t>0?`\n \n `:""}\n \n \n \n
\n `)).join("")}\n
\n \n \n\n ${this.isLoading?'
':""}\n \n ${this.error?`
${this.error}
`:""}\n\n
\n ${0!==this.results.length||this.isLoading||this.error?this.results.map((e=>`\n
\n
\n

${e.title}

\n

Reference code: ${e.reference_code}

\n

Level of description: ${e.level_of_description}

\n

URL: ${this.atomUrl}/${e.slug}

\n \n
\n ${e.thumbnail_url?`\n \n `:""}\n
\n `)).join(""):"

No results found. Please try a different search.

"}\n
\n ${this.renderPagination()}\n
\n \n `}}customElements.define("atom-search-interface",e)},738:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this.render(),console.log("connected help"),this.updateContent()}render(){this.shadowRoot.innerHTML='\n \n
\n '}updateContent(){const e=Curate.contextualHelp.context;this.shadowRoot.querySelector(".help-content").textContent=this.getHelpContent(e)}getHelpContent(e){const{page:t,lastRightClickedElement:n,selection:o}=e,i=o&&o.length>0;n&&n.tagName.toLowerCase();return!0===i?`You've selected ${o.length} item(s). This area allows you to perform actions on your selection.`:`You're on the ${t} page. Right-click on elements to see context-specific help.`}}customElements.define("contextual-help",e)},523:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.processQueue=[],this.runningProcesses=new Map,this.maxConcurrent=5}connectedCallback(){this.render(),this.processQueueInterval=setInterval((()=>this.processQueuedItems()),1e3)}disconnectedCallback(){clearInterval(this.processQueueInterval)}render(){this.shadowRoot.innerHTML='\n \n
\n '}addToQueue(e){const t={id:this.generateUniqueId(e),node:e,status:"queued",title:`Queued: ${e._metadata.get("usermeta-import-oai-link-id")}`,details:`Repository: ${e._metadata.get("usermeta-import-oai-repo-url")}`,nodeTitle:e._label};this.processQueue.push(t),this.updateStatusCard(t)}async processQueuedItems(){for(;this.runningProcesses.size0;){const e=this.processQueue.shift();this.runningProcesses.set(e.id,e),this.initiateHarvest(e)}}async initiateHarvest(e){const{node:t,id:n}=e,o=t._metadata.get("usermeta-import-oai-repo-url"),i=t._metadata.get("usermeta-import-oai-link-id"),a=t._metadata.get("usermeta-import-oai-metadata-prefix");if(o&&i&&a){this.updateProcessStatus(n,"loading",`Harvesting ${i}`,`Repository: ${o}`,0);try{const e=await fetch("http://127.0.0.1:5000/harvest",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({repo_url:o,identifier:i,metadata_prefix:a})});if(!e.ok){const t=await e.json();throw{message:t.error,data:t.data}}const r=await e.json(),s=this.convertJson(r);await Curate.api.files.updateMetadata(t,s),this.updateProcessStatus(n,"success",`Harvested ${i}`,`Successfully processed data from ${o}${i}`,100)}catch(e){this.updateProcessStatus(n,"error",`Failed to harvest ${i}`,`Error: ${e.message}: ${e.data?e.data:""}`,100)}finally{this.runningProcesses.delete(n)}}else this.updateProcessStatus(n,"error",`Failed to harvest ${i}`,"Repository, identifier, or metadata prefix not found",100)}updateProcessStatus(e,t,n,o,i){const a=this.runningProcesses.get(e)||this.processQueue.find((t=>t.id===e));a&&(Object.assign(a,{status:t,title:n,details:o,progress:i}),this.updateStatusCard(a))}updateStatusCard(e){const t=this.shadowRoot.querySelector(".status-container");let n=t.querySelector(`[data-id="${e.id}"]`);n||(n=document.createElement("div"),n.classList.add("status-item"),n.setAttribute("data-id",e.id),t.appendChild(n));const{status:o,title:i,details:a,progress:r,nodeTitle:s}=e;n.innerHTML=`\n
\n ${i}\n \n
\n
${a}
\n
Node: ${s}
\n ${"loading"===o?`\n
\n
\n
\n `:""}\n `}generateUniqueId(e){return`${e._metadata.get("uuid")}-${e._metadata.get("usermeta-import-oai-link-id")}`}convertJson(e){const t=e.schema,n=e.data;let o=[];for(const e in n)if(Array.isArray(n[e])){let t=n[e].join(", ");o.push({field:e,value:t})}let i={};return i[t]=o,i}processAllNodes(e){e.forEach((e=>this.addToQueue(e)))}}customElements.define("oai-harvest-status",e)}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var a=t[o]={exports:{}};return e[o](a,a.exports,n),a.exports}(()=>{"use strict";const e={fetchCurate:async function(e,t="POST",n){if(!e)throw new Error("No endpoint provided");try{const o=await PydioApi._PydioRestClient.getOrUpdateJwt(),i={method:t,headers:{accept:"application/json","accept-language":navigator.language+",en-GB,en-US;q=0.9,en;q=0.8",authorization:"Bearer "+o,"content-type":"application/json","sec-fetch-dest":"empty","sec-fetch-mode":"cors","sec-fetch-site":"same-origin","x-pydio-language":pydio.user.getPreference("lang")},referrer:window.location.href,referrerPolicy:"strict-origin-when-cross-origin",mode:"cors",credentials:"include"};["GET","HEAD"].includes(t)||(i.body=JSON.stringify(n));const a=await fetch(window.location.origin+e,i);if(!a.ok)throw new Error("Network response was not ok");return await a.json()}catch(e){throw console.error("Curate fetch error:",e),e}},files:{createFiles:async function(e){if(!e)throw new Error("No nodes provided");async function t(e,t){const n={MetaDatas:[],Operation:"PUT"};for(const o in e)"path"!==o&&e[o].forEach((e=>{const i=`usermeta-${o}-${e.field}`,a={NodeUuid:t,Namespace:i,JsonValue:JSON.stringify(e.value),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]};n.MetaDatas.push(a)}));return n}const n=e.nodes.map((async e=>{const t=e.path.split("/").pop(),n=(await Curate.api.fetchCurate("/a/tree/create","POST",{Nodes:[{Path:e.path,Type:"LEAF"}],TemplateUUID:""})).Children[0].Path;return{filename:t,uuid:(await Curate.api.fetchCurate("/a/meta/bulk/get","POST",{Limit:200,NodePaths:[n]})).Nodes[0].Uuid,node:e}})),o=await Promise.all(n);for(const{filename:e,uuid:n,node:i}of o){const e=await t(i,n);await Curate.api.fetchCurate("/a/user-meta/update","PUT",e)}},getFileData:async function(e,t="text"){if(!e)throw new Error("No node provided");try{await PydioApi._PydioRestClient.getOrUpdateJwt();const n=await pydio.ApiClient.buildPresignedGetUrl(e),o=await fetch(n);if(!o.ok)throw new Error("Network response was not ok");if("text"===t)data=await o.text();return data}catch(e){throw console.error("Error fetching object:",e),e}},updateMetadata:async function(e,t){if(!t)throw new Error("No metadata provided");if(!e)throw new Error("No node provided");const n=((e,t)=>{const n={MetaDatas:[],Operation:"PUT"};for(const o in t)t[o].forEach((t=>{const i=`usermeta-${o}-${t.field}`,a={NodeUuid:e._metadata.get("uuid"),Namespace:i,JsonValue:JSON.stringify(t.value),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]};n.MetaDatas.push(a)}));return n})(e,t);return await Curate.api.fetchCurate("/a/user-meta/update","PUT",n)}}},t={getOpenWorkspace:function(){return pydio._dataModel._rootNode._label.toLowerCase()==pydio.user.id.toLowerCase()?"personal-files":pydio._dataModel._rootNode._label.toLowerCase().replace(/^\d+\.\s*/,"")}},o={modals:{curatePopup:function(e,t){const n=e.title,o=e.message,i=e.type,a=e.content,r=e.buttonType||"close",s=t?.afterLoaded||function(){},l=t?.afterClosed||function(){},d=t?.onOk||function(){},c=t?.onCancel||function(){},p={warning:{color:"#FFA500",icon:"mdi-alert"},error:{color:"#FF0000",icon:"mdi-alert-circle"},success:{color:"#008000",icon:"mdi-check-circle"},info:{color:"#0000FF",icon:"mdi-information"}};return{fire:function(){const e=document.createElement("div");e.classList.add("config-modal-container"),e.style.display="flex",e.addEventListener("click",(function(t){y(t,e)}),{once:!0});const t=document.createElement("div");t.classList.add("config-modal-content"),i&&(t.style.borderTop=`4px solid ${p[i].color}`);const u=document.createElement("div");if(u.classList.add("config-popup-title"),i){const e=document.createElement("i");e.classList.add("mdi",p[i].icon),e.style.color=p[i].color,e.style.fontSize="24px",e.style.marginRight="10px",u.appendChild(e)}const m=document.createTextNode(n);u.appendChild(m);const h=document.createElement("div");if(h.classList.add("config-main-options-container"),h.style.width="100%",o){const e=document.createElement("div");e.classList.add("config-popup-message"),e.textContent=o,h.appendChild(e)}if(a){const e=document.createElement("div");e.innerHTML=a,h.appendChild(e)}const g=document.createElement("div");if(g.classList.add("action-buttons"),"okCancel"===r){const t=document.createElement("button");t.classList.add("config-modal-ok-button"),t.textContent="OK",t.addEventListener("click",(()=>{d(),f(e)}));const n=document.createElement("button");n.classList.add("config-modal-cancel-button"),n.textContent="Cancel",n.addEventListener("click",(()=>{c(),f(e)})),g.appendChild(t),g.appendChild(n)}else{const t=document.createElement("button");t.classList.add("config-modal-close-button"),t.textContent="Close",t.addEventListener("click",(()=>{f(e)})),g.appendChild(t)}function f(e){e.remove(),l()}function y(e,t){e.target===t?f(t):t.addEventListener("click",(function(e){y(e,t)}),{once:!0})}t.appendChild(u),t.appendChild(h),t.appendChild(g),e.appendChild(t),document.body.appendChild(e),e.addEventListener("keyup",(function(e){e.stopPropagation()})),s(e)}}}}},i=e=>{const t={"ISAD(G)":({},{sections:[{title:"Identity Statement",fields:["reference code(s)","title","date(s)","level of description","extent and medium of the unit of description"]},{title:"Context",fields:["name of creator(s)","administrative/biographical history","archival history","immediate source of acquisition or transfer"]},{title:"Content And Structure",fields:["scope and content","appraisal, destruction and scheduling information","accruals","system of arrangement"]},{title:"Conditions Of Access And Use",fields:["conditions governing access","conditions governing reproduction","language/scripts of material","physical characteristics and technical requirements","finding aids"]},{title:"Allied Materials",fields:["existence and location of originals","existence and location of copies","related units of description","publication note"]},{title:"Notes",fields:["note"]},{title:"Description Control",fields:["archivists note","rules or conventions","date(s) of descriptions"]}]}),DC:({},{fields:["contributor","coverage","creator","date","description","format","identifier","language","publisher","relation","rights","source","subject","title","type"]})};return e&&e in t?t[e]:e?void console.error("invalid schema"):t},a={schemas:{getSchemas:function(e){return i(e)}}};const r={context:{page:window.location.pathname,lastRightClickedElement:null,selection:null}};function s(e){2===e.button&&(r.context.lastRightClickedElement=e.target,r.context.page=window.location.pathname,r.context.selection=pydio?._dataModel._selectedNodes||null)}window.addEventListener("load",(()=>document.addEventListener("mousedown",s)));const l={api:e,workspaces:t,ui:o,metadata:a,contextualHelp:r};window.Curate=l;n(125),n(678),n(887),n(578);const d=class{constructor(){this.taskQueue=[],this.isProcessing=!1,this.worker=null}initWorker(){this.worker&&this.worker.terminate();this.worker=new Worker("/workers/hashWorker.js"),console.log("Worker initialized: ",this.worker),this.setupWorkerHandlers()}setupWorkerHandlers(){this.worker.onmessage=e=>{console.log("goober: ",e.data),"complete"===e.data.status&&this.currentResolve&&this.currentResolve({file:this.currentFile,hash:e.data.hash,name:this.currentFile.name}),this.processNextTask()},this.worker.onerror=e=>{this.currentReject&&this.currentReject("Worker error: "+e.message),this.processNextTask()}}generateChecksum(e){return new Promise(((t,n)=>{this.taskQueue.push({file:e,resolve:t,reject:n}),this.isProcessing||this.processNextTask()}))}processNextTask(){if(this.taskQueue.length>0){this.worker||this.initWorker();const e=this.taskQueue.shift();this.currentResolve=e.resolve,this.currentReject=e.reject,this.currentFile=e.file,this.isProcessing=!0,this.worker.postMessage({file:e.file,msg:"begin hash"})}else this.isProcessing=!1,this.worker&&(this.worker.terminate(),this.worker=null)}};window.addEventListener("load",(()=>{(async()=>{for(;"undefined"==typeof UploaderModel;)await new Promise((e=>setTimeout(e,100)));const e=new d;console.log("WorkerManager initialized");const t=UploaderModel.UploadItem.prototype.uploadPresigned;function n(e,t,i){Curate.api.fetchCurate("/a/tree/stats","POST",{NodePaths:[e]}).then((a=>{const r=a.Nodes.find((t=>t.Path===e));r?function(e,t,i,a){const r=3;"temporary"===e.Etag&&a{n(i,t,a+1)}),2e3)):e.Etag===t?(console.log("Checksum validation passed."),o(e.Uuid,"usermeta-file-integrity","✓ Integrity verified")):(console.error("Checksum validation failed.","Expected:",t,"Received:",e.Etag),o(e.Uuid,"usermeta-file-integrity","X Integrity compromised"))}(r,t,e,i):console.error("Node not found in response:",e)})).catch((e=>{console.error("Error fetching node stats:",e)}))}function o(e,t,n){const o={MetaDatas:[{NodeUuid:e,Namespace:t,JsonValue:JSON.stringify(n),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]}],Operation:"PUT"};Curate.api.fetchCurate("/a/user-meta/update","PUT",o)}UploaderModel.UploadItem.prototype.uploadPresigned=function(){const o=t.apply(this,arguments),i=t=>{console.log(t),"loaded"===t&&(this._observers.status.forEach(((e,t)=>{e===i&&this._observers.status.splice(t,1)})),console.log("Attempting to generate checksum for: ",this._file),e.generateChecksum(this._file).then((e=>{console.log("Generated checksum data:",e);const t=Math.min(5e3,Math.max(500,.01*this._file.size));setTimeout((()=>{const t=this._targetNode._path,o=t.endsWith("/")?"":"/",i=this._parent._label?`${this._parent._label}/`:"";n(`${Curate.workspaces.getOpenWorkspace()}${t}${o}${i}${this._label}`,e.hash,0)}),t)})).catch((e=>{console.error("Checksum generation failed:",e)})))};return this._observers.status.push(i),o}})()}));n(627),n(937),n(711),n(663),n(543),n(380);class c extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.nodes=[],this.render()}setNodes(e){this.nodes=e,this.render()}render(){this.shadowRoot.innerHTML=`\n \n
\n
\n The selected preservation configuration has DIP generation enabled. The following items do not have a linked AtoM description, which will cause DIP generation to fail.\n
\n
\n ${this.nodes.map((e=>`\n
\n ${e._path}\n \n
\n `)).join("")}\n
\n
\n `,this.shadowRoot.querySelectorAll(".link-button").forEach((e=>{e.addEventListener("click",(()=>{console.log(`Add description for ${e.getAttribute("data-path")}`),Curate.ui.modals.curatePopup({title:"Connect Selected Node to an AtoM Description"},{afterLoaded:t=>{const n=document.createElement("atom-search-interface");n.setNode(this.nodes.find((t=>t._path==e.getAttribute("data-path")))),t.querySelector(".config-main-options-container").appendChild(n),n.addEventListener("description-linked",(n=>{console.log("description linked"),t.remove();const o=document.createElement("div");o.innerHTML="
🔗
",e.parentElement.querySelector(".file-name").after(o),e.remove()}))},afterClosed:()=>{}}).fire()}))}))}}customElements.define("dip-slug-resolver",c);n(738),n(523),n(93),n(92)})()})(); \ No newline at end of file +(()=>{var e={125:()=>{async function e(){const e=`${window.location.origin}/api/preservation`,t=await PydioApi._PydioRestClient.getOrUpdateJwt();return fetch(e,{headers:{Authorization:`Bearer ${t}`},method:"GET"}).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return e.json()})).then((e=>{sessionStorage.setItem("preservationConfigs",JSON.stringify(e))})).catch((e=>{console.error("Fetch error:",e)}))}function t(t,n,o){const s=document.createElement("div");s.id="preservationConfigsSubMenu",s.style.maxHeight="8em",s.style.overflowY="scroll",s.innerHTML=n,o.forEach((e=>{let t=document.createElement("div");const n=JSON.parse(localStorage.getItem(e.id));if(t.style.transition="0.3s ease all",t.addEventListener("mouseenter",(e=>{e.target.style.background="var(--md-sys-color-outline-variant-50)"})),t.addEventListener("mouseleave",(e=>{e.target.style.background="none"})),t.addEventListener("click",(t=>{t.target.classList.contains("mdi-star-outline")?(console.info("bookmarked!"),localStorage.setItem(e.id,JSON.stringify({name:e.name,bookmarked:!0})),t.target.classList.remove("mdi-star-outline"),t.target.classList.add("mdi-star"),s.remove()):t.target.classList.contains("mdi-star")?(console.info("un-bookmarked!"),localStorage.setItem(e.id,JSON.stringify({name:e.name,bookmarked:!1})),t.target.classList.remove("mdi-star"),t.target.classList.add("mdi-star-outline"),s.remove()):(!async function(e){const t=await PydioApi._PydioRestClient.getOrUpdateJwt(),n=`${window.location.origin}/a/scheduler/hooks/a3m-transfer`,o=pydio._dataModel._selectedNodes.map((e=>({path:Curate.workspaces.getOpenWorkspace()+e._path,slug:e._metadata.get("usermeta-atom-linked-description")||""}))),i=JSON.stringify({Paths:o,JobParameters:{ConfigId:e.toString()}});fetch(n,{method:"POST",mode:"cors",headers:{accept:"application/json","accept-language":"en-GB,en-US;q=0.9,en;q=0.8",authorization:`Bearer ${t}`,"cache-control":"no-cache","content-type":"application/json",pragma:"no-cache","sec-fetch-mode":"cors","sec-fetch-site":"same-origin","x-pydio-language":"en-us"},body:i}).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return e.json()})).then((e=>{console.info("Preservation config initiated successfully")})).catch((e=>{console.error("Fetch error:",e)}))}(e.id),s.remove())})),t.innerHTML='
Source Editor
',t.querySelector('[role="menuLabel"]').innerText=e.name,s.querySelector('[role="menu"]').appendChild(t),n&&n.bookmarked){let e=t.querySelector(".mdi-star-outline");e.classList.remove("mdi-star-outline"),e.classList.add("mdi-star")}}));const l=document.createElement("div");l.innerHTML='
Source Editor
',l.querySelector('[role="menuLabel"]').innerText="Create New",l.style.transition="0.3s ease all",l.addEventListener("mouseenter",(e=>{e.target.style.background="var(--md-sys-color-outline-variant-50)"})),l.addEventListener("mouseleave",(e=>{e.target.style.background="none"})),l.addEventListener("click",(t=>{document.querySelector("#preservationConfigsSubMenu").remove(),function(t,n){const o=document.createElement("div");o.classList.add("config-modal-container");const r=document.createElement("div");r.classList.add("config-modal-scroll-container");const s=document.createElement("div");s.classList.add("config-modal-content");const l=document.createElement("div");l.textContent=t,l.classList.add("config-popup-title"),s.appendChild(l);const d=document.createElement("div");d.classList.add("config-main-options-container"),s.appendChild(d),n.forEach((e=>{const t=document.createElement("div");t.classList.add("config-input-category"),t.id=e.category.replaceAll(" ","_");const n=document.createElement("div");n.classList.add("config-text-label"),n.textContent=e.category,t.appendChild(n),e.inputs.forEach((e=>{a(e,t)})),r.appendChild(t)}));const c=document.createElement("button");c.classList.add("config-clear-form"),c.textContent="Clear Form",c.addEventListener("click",(e=>{r.querySelectorAll("input").forEach((e=>{"text"==e.type?e.value="":"checkbox"==e.type?e.checked=!1:e.value=0,e.dispatchEvent(new CustomEvent("change",{bubbles:!0})),e.dispatchEvent(new CustomEvent("input",{bubbles:!0}))}))})),r.appendChild(c);const p=document.createElement("div");p.classList.add("config-options-container"),p.style="display: flex;align-items: center;flex-wrap: nowrap;flex-direction: column;";const u=document.createElement("div");u.classList.add("config-text-label"),u.textContent="Create or Edit Configs",u.style="padding-bottom: 1em !important",p.appendChild(u),p.appendChild(r);const m=document.createElement("div");m.classList.add("config-modal-scroll-container");const h=document.createElement("button");h.classList.add("config-save-button"),h.textContent="Save Config",h.addEventListener("click",(t=>{const o=JSON.parse(sessionStorage.getItem("preservationConfigs")),a=p.querySelector("#name").value,r=n.flatMap((e=>e.inputs.map((e=>e.name)).concat(e.inputs.flatMap((e=>e.suboptions?e.suboptions.map((e=>e.name)):[]))))),s={},l=o?.find((e=>e.name==a));l?s.id=l.id:s.user=pydio.user.id,r.forEach((e=>{const t=document.querySelector("#"+e);t&&"submit"!=t.type&&(t.disabled&&(s[e.toLowerCase()]=!1),"checkbox"==t.type?s[e.toLowerCase()]=+t.checked:t.querySelector("input[type='range']")?s[e.toLowerCase()]=t.querySelector("input[type='range']").value:"name"==e?s.name=t.value:"image_normalization_tiff"==e?s[e.toLowerCase()]="TIFF"===t.value?1:0:"string"==typeof t.value?s[e.toLowerCase()]=t.value.toLowerCase():s[e.toLowerCase()]=t.value)})),l?async function(e){const t=`${window.location.origin}/api/preservation/${e.id}`,n=await PydioApi._PydioRestClient.getOrUpdateJwt();fetch(t,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify(e)}).then((e=>{if(!e.ok)throw new Error(`HTTP error while updating config, Status: ${e.status}`);if(200==e.status)return console.info("config saved successfully"),e.json()})).catch((e=>{console.error("Fetch error:",e),Curate.ui.modals.curatePopup({title:"Error",type:"error",content:"There was an error saving your modified configuration. Please try again, or contact support if the problem persists."}).fire()}))}(s):async function(e){const t=`${window.location.origin}/preservation`,n=await PydioApi._PydioRestClient.getOrUpdateJwt();return fetch(t,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify(e)}).then((e=>{if(e.ok)return console.info("config saved successfully"),e.json();throw new Error(`HTTP error! Status: ${e.status}`)})).catch((e=>{console.error("Fetch error:",e),Curate.ui.modals.curatePopup({title:"Error",type:"error",content:"There was an error saving your configuration. Please try again, or contact support if the problem persists."}).fire()}))}(s).then((t=>{if(t){const t=JSON.parse(sessionStorage.getItem("preservationConfigs"));e().then((e=>{const n=JSON.parse(sessionStorage.getItem("preservationConfigs"));if(s.id)document.querySelector("#config-"+s.id).remove(),i(m,[n.find((e=>e.id===s.id))]);else{const e=n.find((e=>!t.some((t=>t.id===e.id))));i(m,[e])}}))}}))})),p.appendChild(h),d.appendChild(p),p.addEventListener("input",(e=>{let t=p.querySelector("#name").value;0==t.length?h.style.display="none":t.trim().length<3?(h.textContent="Add a name 3 characters or longer",h.style.display="block"):(h.textContent="Save Config",h.style.display="block")}));const g=document.createElement("div");g.classList.add("config-options-container"),g.id="savedConfigsContainer",g.style="display:flex;align-items:center;justify-content:flex-start;flex-direction:column;";const f=document.createElement("div");f.classList.add("config-text-label"),f.style="padding-bottom: 1em; !important",f.textContent="Saved Configs",g.appendChild(f);const y=JSON.parse(sessionStorage.getItem("preservationConfigs"));i(m,g,y),g.appendChild(m),d.appendChild(g),o.appendChild(s);const b=document.createElement("div");b.classList.add("action-buttons");const v=document.createElement("button");v.classList.add("config-modal-close-button"),v.textContent="Close",v.addEventListener("click",(()=>{document.body.removeChild(o)})),b.appendChild(v),s.appendChild(b),document.body.appendChild(o),o.style.display="flex"}("Preservation Configs",r)})),s.querySelector('[role="menu"]').appendChild(l),document.body.appendChild(s);const d=s.firstChild.getBoundingClientRect(),c=t.getBoundingClientRect(),p=c.left,u=window.innerWidth-c.right;var m;return pu?(m=c.top,newRight=window.innerWidth-c.left+d.width,s.style.position="absolute",s.style.top=`${m}px`,s.style.right=`${newRight}px`):(m=c.top,newRight=window.innerWidth-c.right,s.style.position="absolute",s.style.top=`${m}px`,s.style.right=`${newRight}px`),s}function n(e,t,n="16px",o="5px"){const i=document.createElement("div");return i.style.transition="0.3s ease all",i.style.maxWidth="20em",i.addEventListener("mouseenter",(e=>{e.target.style.background="var(--md-sys-color-outline-variant-50)"})),i.addEventListener("mouseleave",(e=>{e.target.style.background="none"})),i.id="preservationConfigDropdown",i.innerHTML='
'+e+"
",i}function o(e){const o=JSON.parse(sessionStorage.getItem("preservationConfigs"));setTimeout((()=>{for(const i of e.querySelectorAll("div")){if("Preserve"==i.innerText){const a=n("Preservation Configs","mdi-menu-right","24px","0px");e.insertBefore(a,i.nextSibling);const r=document.querySelector("#preservationConfigDropdown"),s=[1,3];return document.addEventListener("mousedown",(e=>{}),{once:!0}),r.addEventListener("click",(e=>{const n=t(r,'
',o);setTimeout((()=>{document.addEventListener("mousedown",(e=>{s.includes(e.which)&&(n.contains(e.target)||n.remove())}),{once:!0})}),100)})),void o.forEach((t=>{const o=JSON.parse(localStorage.getItem(t.id.toString()));if(o&&o.bookmarked){const o=n(t.name,"mdi-console");e.insertBefore(o,i.nextSibling)}}))}document.querySelector("#preservationConfigDropdown")&&document.querySelector("#preservationConfigDropdown").remove()}}),10)}function i(t,n,o){console.log(o),o?.forEach((n=>{const o=document.createElement("div");o.id="config-"+n.id,o.classList.add("saved-config-item"),o.style.opacity="0",o.addEventListener("mouseenter",(e=>{o.style.backgroundColor="var(--md-sys-color-outline-variant)"})),o.addEventListener("mouseleave",(e=>{o.style.backgroundColor="var(--md-sys-color-on-secondary)"})),o.addEventListener("click",(e=>{if(!["saved-config-delete","config-bookmark-container","mdi-star","mdi-star-outline"].includes(e.target.className))for(var t in n)if(n.hasOwnProperty(t)){var o="#"+t,i=document.querySelector(o);i&&("checkbox"==i.type?i.checked=!!n[t]:"select-one"==i.type?"image_normalization_tiff"==i.id&&(i.value=1===n[t]?"TIFF":"JPEG2000"):"range"==i.type?(i.value=n[t],i.dispatchEvent(new CustomEvent("input",{bubbles:!0}))):i.value=n[t],i.dispatchEvent(new CustomEvent("change",{bubbles:!0})))}}));const i=document.createElement("div");i.classList.add("saved-config-information");const a=document.createElement("label");a.textContent=n.name,a.style.fontWeight="500",a.style.marginBottom="0";const r=document.createElement("label");r.classList.add("config-text-label");const s=document.createElement("div"),l=document.createElement("label");l.for="config-description-"+n.id,l.textContent="Description: ";const d=document.createElement("span");d.textContent=n.description,d.id="config-description-"+n.id,s.appendChild(l),s.appendChild(d);const c=document.createElement("div"),p=document.createElement("label");p.id="config-user-"+n.id,p.textContent="User: ";const u=document.createElement("span");u.id="config-user-"+n.id,u.textContent=n.user,c.appendChild(p),c.appendChild(u),r.appendChild(s),r.appendChild(c),i.appendChild(a),i.appendChild(r);const m=document.createElement("button");m.classList.add("saved-config-delete"),m.addEventListener("mouseenter",(e=>{o.style.backgroundColor="var(--md-sys-color-on-secondary)",m.style.backgroundColor="#ff2c2c"})),m.addEventListener("mouseleave",(e=>{m.style.backgroundColor="var(--md-sys-color-error-container)",e.toElement==o||e.toElement==o.querySelector(".saved-config-information")?o.style.backgroundColor="var(--md-sys-color-outline-variant)":o.style.backgroundColor="var(--md-sys-color-on-secondary)"})),m.addEventListener("click",(t=>{confirm("Deleting a config is permanent and cannot be reverted, do you wish to continue?")&&(o.style.opacity="1",async function(t){const n=`${window.location.origin}/preservation/${t}`,o=await PydioApi._PydioRestClient.getOrUpdateJwt();return fetch(n,{method:"DELETE",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${o}`}}).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return e.json()})).then((t=>{if(t)return e(),t;throw new Error("Delete operation failed.")})).catch((e=>{console.error("Fetch error:",e),Curate.ui.modals.curatePopup({title:"Error",type:"error",content:"There was an error deleting your configuration. Please try again, or contact support if the problem persists."}).fire()}))}(n.id).then((e=>{console.info("Delete successful:",e),o.style.animation="none",o.offsetWidth,o.style.animation="config-slide-and-fade-in 0.4s forwards reverse",setTimeout((e=>{o.remove()}),400)})).catch((e=>{o.style.animation="delete-failed-shake-animation 0.5s 0s infinite";const t=o.style.backgroundColor;o.style.backgroundColor="red",console.error("Delete failed:",e),setTimeout((()=>{o.style.animation="none",o.style.backgroundColor=t}),500)})))})),m.textContent="Delete Config";const h=document.createElement("div");h.classList.add("config-bookmark-container"),h.addEventListener("click",(e=>{e.target.classList.contains("mdi-star-outline")?(console.info("bookmarked!"),localStorage.setItem(n.id,JSON.stringify({name:n.name,bookmarked:!0})),e.target.classList.remove("mdi-star-outline"),e.target.classList.add("mdi-star")):e.target.classList.contains("mdi-star")&&(console.info("un-bookmarked!"),localStorage.setItem(n.id,JSON.stringify({name:n.name,bookmarked:!1})),e.target.classList.remove("mdi-star"),e.target.classList.add("mdi-star-outline"))}));const g=document.createElement("span"),f=JSON.parse(localStorage.getItem(n.id.toString()));f&&f.bookmarked?g.classList.add("mdi-star"):g.classList.add("mdi-star-outline"),h.appendChild(g),o.appendChild(h),o.appendChild(i),o.appendChild(m),t.appendChild(o)}));const i=t.querySelectorAll(".saved-config-item");if(i?.forEach(((e,t)=>e.style.animationDelay=.55*t/i.length+"s")),i?.forEach(((e,t,n)=>{const o=.05*(t+1),i=1-o;e.style.animationDelay=`${o}s`,e.style.animationDuration=`${i}s`})),!o||0==o?.length){const e=document.createElement("div");e.textContent="No Saved Preservation Configs Found",e.style.margin="3em",e.style.width="80%",e.style.height="10%",e.style.textAlign="center",e.style.display="flex",e.style.color="white",e.style.background="var(--md-sys-color-outline-variant-50)",e.style.justifyContent="center",e.style.alignItems="center",e.style.borderRadius="1.5em",n.appendChild(e)}}function a(e,t){const n=document.createElement("div");if(n.classList.add("input-container"),"info"===e.type){const t=document.createElement("div");t.classList.add("config-info"),t.textContent=e.text,n.appendChild(t)}if("text"===e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const o=document.createElement("input");o.id=e.name,o.setAttribute("type","text"),o.classList.add("config-text-input"),n.appendChild(t),n.appendChild(o)}else if("toggle"===e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const o=document.createElement("input");o.setAttribute("type","checkbox"),o.classList.add("tgl"),o.classList.add("tgl-light"),o.id=e.name;const i=document.createElement("label");i.classList.add("tgl-btn"),i.htmlFor=e.name,n.appendChild(t),n.appendChild(o),n.appendChild(i)}else if("dropdown"===e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const o=document.createElement("select");o.id=e.name,o.classList.add("config-dropdown-select"),e.options.forEach((e=>{const t=document.createElement("option");t.value=e,t.textContent=e,o.appendChild(t)})),n.appendChild(t),n.appendChild(o)}else if("slider"==e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const i=document.createElement("div");i.classList.add("config-slider-container");const a=document.createElement("div");a.classList.add("config-slider-value"),a.textContent=e.min;const r=document.createElement("input");r.id=e.name,r.setAttribute("type","range"),r.classList.add("config-slider"),r.setAttribute("min",e.min),r.setAttribute("max",e.range),r.setAttribute("step",e.step),r.setAttribute("value",e.min);const s=document.createElement("div");s.classList.add("config-slider-minmax-container");const l=document.createElement("span");l.classList.add("config-slider-minmax"),l.textContent=e.min;const d=document.createElement("span");d.classList.add("config-slider-minmax"),d.textContent=e.range,r.addEventListener("input",(()=>{const e=r.value;a.textContent=e})),s.appendChild(l);for(var o=0;o{const n=e.name;t.target.id==n&&(t.target.checked?e.suboptions.forEach((e=>{if("info"==e.type)return;const t="#"+e.name;document.querySelector(t).disabled=!1,document.querySelector(t).parentElement.style.opacity="1"})):e.suboptions.forEach((e=>{if("info"==e.type)return;const t="#"+e.name;document.querySelector(t).disabled=!0,document.querySelector(t).checked=!1,document.querySelector(t).parentElement.style.opacity="0.3"})))})),t.appendChild(n),e.suboptions&&e.suboptions.forEach((e=>{a(e,n),setTimeout((t=>{if("info"==e.type)return;const n="#"+e.name;document.querySelector(n).disabled=!0,document.querySelector(n).parentElement.style.opacity="0.3"}),50)}))}const r=[{category:"Details",inputs:[{label:"Config Name",name:"name",type:"text"},{label:"Config Description",name:"description",type:"text"}]},{category:"Normalisation",inputs:[{label:"Normalise Objects",name:"normalize",type:"toggle",suboptions:[{label:"Image Normalisation Format",name:"image_normalization_tiff",type:"dropdown",options:["TIFF","JPEG2000"]}]}]},{category:"Dissemination",inputs:[{label:"Create Dissemination Package",name:"dip_enabled",type:"toggle",suboptions:[{label:"Dissemination Information",name:"dip_info",type:"info",text:"Create dissemination packages from AIPs generated by this config. Created DIPs will automatically be connected to the linked description of the source data. For this option to work, you must configure a connected AtoM instance."},{label:"Go to AtoM Configuration",name:"atom_config",type:"button",text:"Go to AtoM Configuration",onclick:e=>{Curate.ui.modals.curatePopup({title:"Connect to Your AtoM Instance"},{afterLoaded:e=>{const t=document.createElement("connect-to-atom");e.querySelector(".config-main-options-container").appendChild(t)}}).fire()}}]}]},{category:"Packaging and Compression",inputs:[{label:"AIP Packaging Type",name:"process_type",type:"dropdown",options:["standard","eark"]},{label:"Compress AIPs",name:"compress_aip",type:"toggle",suboptions:[{label:"Warning",name:"compression_warning",type:"info",text:"Compressing AIPs will make their contents unsearchable and prevent descriptive metadata from being reassociated with output objects. You can compress your AIPs for distribution or deep-storage while conserving the uncompressed AIP by right-clicking an AIP in a workspace."},{label:"Compression Algorithm",name:"compression_algorithm",type:"dropdown",options:["tar","tar_bzip2","tar_gzip","s7_copy ","s7_bzip2","s7_lzma"]},{label:"Compression Level",name:"compression_level",type:"slider",min:1,range:9,step:1}]}]},{category:"Transfer Options",inputs:[{label:"Generate Transfer Structure Report",name:"gen_transfer_struct_report",type:"toggle"},{label:"Document Empty Directories",name:"document_empty_directories",type:"toggle"},{label:"Extract Packages",name:"extract_packages",type:"toggle",suboptions:[{label:"Delete Packages After Extraction",name:"delete_packages_after_extraction",type:"toggle"}]}]}];window.addEventListener("load",(t=>{!async function(){try{await((e,t=50)=>new Promise((n=>{const o=setInterval((()=>{void 0!==window[e]&&(clearInterval(o),n(window[e]))}),t)})))("PydioApi");e()}catch(e){console.error("An error occurred:",e)}}(),setTimeout((()=>{document.addEventListener("mousedown",(e=>{document.querySelector('.context-menu [role="menu"]')&&document.querySelector('.context-menu [role="menu"]').contains(e.target)||document.querySelector(".main-files-list")&&(3==e.which&&document.querySelector(".main-files-list").contains(e.target)?document.querySelector('.context-menu [role="menu"]')&&!document.querySelector("#preservationConfigDropdown")?setTimeout((()=>{o(document.querySelector('.context-menu [role="menu"]'))}),100):function(e){if(document.querySelector("#\\/recycle_bin")&&document.querySelector("#\\/recycle_bin").contains(e.target))return void(document.querySelector("#preservationConfigDropdown")&&document.querySelector("#preservationConfigDropdown").remove());const t=new MutationObserver((e=>{e.forEach((e=>{e.addedNodes.forEach((e=>{if(e.nodeType===Node.ELEMENT_NODE){const n=e.querySelector('.context-menu [role="menu"]');n&&(o(n),t.disconnect())}}))}))}));t.observe(document.body,{childList:!0,subtree:!0,once:!0})}(e):document.querySelector("#preservationConfigDropdown")&&setTimeout((()=>{document.querySelector("#preservationConfigDropdown")&&document.querySelector("#preservationConfigDropdown").remove()}),150))}),150)}))}))},627:()=>{document.addEventListener("change",(function(e){if(1===pydio._dataModel._selectedNodes.length&&e.target.nextElementSibling?.textContent.includes("Enable OAI Harvesting")&&"checkbox"===e.target.type){const t=e.target.nextElementSibling?.textContent.includes("Enable OAI-PMH Harvesting"),n=pydio._dataModel._selectedNodes[0],o=!n._isLeaf;t&&o&&Curate.ui.modals.curatePopup({title:"Send Update to Children",buttonType:"okCancel"},{afterLoaded:e=>{e.querySelector(".config-main-options-container").appendChild(function(){const e=document.createElement("div");e.style="margin: 12px 0px 6px;";const t=document.createElement("div");t.style="cursor: pointer; position: relative; overflow: visible; display: table; height: 52px; width: 100%; background-color: var(--md-sys-color-surface-variant); border-radius: 4px; margin-top: 8px; font-size: 15px; padding: 15px 10px 4px;";const n=document.createElement("input");n.type="checkbox",n.id="inheritValues",n.checked=!1,n.style="position: absolute; cursor: inherit; pointer-events: all; opacity: 0; width: 100%; height: 100%; z-index: 2; left: 0px; box-sizing: border-box; padding: 0px; margin: 0px;";const o=document.createElement("div");o.style="display: flex; width: 100%; height: 100%;";const i=document.createElement("div");i.style="transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; float: left; position: relative; display: block; flex-shrink: 0; width: 36px; margin-right: 8px; margin-left: 0px; padding: 4px 0px 6px 2px;";const a=document.createElement("div");a.style="transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; width: 100%; height: 14px; border-radius: 30px; background-color: var(--md-sys-color-outline-variant);";const r=document.createElement("div");r.style="color: rgb(25, 28, 30); background-color: var(--md-sys-color-primary); transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; box-sizing: border-box; font-family: Roboto, sans-serif; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 6px, rgba(0, 0, 0, 0.12) 0px 1px 4px; border-radius: 50%; position: absolute; top: 1px; left: 100%; width: 20px; height: 20px; line-height: 24px; margin-left: -20px;";const s=document.createElement("label");return s.style="float: left; position: relative; display: block; width: calc(100% - 46px); line-height: 24px; color: rgb(25, 28, 30); font-family: Roboto, sans-serif;",s.textContent="Update Children With New Value ",i.appendChild(a),i.appendChild(r),o.appendChild(i),o.appendChild(s),t.appendChild(n),t.appendChild(o),e.appendChild(t),n.addEventListener("change",(function(){n.checked?(a.style.backgroundColor="rgba(0, 102, 137, 0.5)",r.style.left="100%",s.textContent="Update Children With New Value (yes)"):(r.style.left="55%",a.style.backgroundColor="var(--md-sys-color-outline-variant)",s.textContent="Update Direct Descendant Files With New Value (no)")})),n.dispatchEvent(new Event("change")),e}())},onOk:()=>{const t=this.querySelector("#inheritValues[type='checkbox']");if(t&&t.checked){(async function(e,t=100){const n=async(e,n=0)=>{const o={NodePaths:[e+"/*"],Limit:t.toString(),Offset:n.toString()};return await Curate.api.fetchCurate("/a/tree/stats","POST",o)};let o=[],i=0,a=!0;for(;a;){const r=(await n(e,i)).Nodes||[];o=o.concat(r),a=r.length===t,i+=r.length}return o})(Curate.workspaces.getOpenWorkspace()+"/"+n._path).then((t=>{const n=[];t.forEach((e=>"LEAF"===e.Type?n.push(e.Uuid):null));var o,i;(o=n,i=50,Array.from({length:Math.ceil(o.length/i)},((e,t)=>o.slice(t*i,t*i+i)))).forEach((t=>{const n=((e,t)=>({MetaDatas:e.map((e=>({NodeUuid:e,Namespace:"usermeta-export-oai-harvest-enabled",JsonValue:t.toString(),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]}))),Operation:"PUT"}))(t,e.target.checked);Curate.api.fetchCurate("/a/user-meta/update","PUT",n)}))})).catch((e=>{console.error("Error retrieving nodes:",e)}))}}}).fire()}}))},93:()=>{const e={upload:{enforceWorkspaceUpload:{event:"drop",target:document,description:"enforce workspace upload permissions for standard users",handler:e=>{pydio.user.getIdmUser().then((t=>{if(!["quarantine","personal-files","common files"].includes(Curate.workspaces.getOpenWorkspace())&&!t.Roles.find((e=>e.Label="Admin"))&&e.dataTransfer?.files.length>0){e.stopImmediatePropagation();const t="
\n

Please upload your content to the Quarantine workspace instead. This will ensure your content is correctly scanned for malware before being released into the system.

\n

You can also upload your content to the Personal and Common Files workspaces, which is scanned for malware once but will not be quarantined and cannot be released into the system.

\n
";Curate.ui.modals.curatePopup({title:"You do not have permission to upload to this workspace",type:"warning",content:t}).fire()}}))}}},sharedSite:{enforceNoCustomActions:{event:"readystatechange",target:document,description:"enforce no custom actions for shared sites",handler:e=>{if(console.log("shared site enforce no custom actions"),window.location.pathname.includes("/public/"),window.location.pathname.includes("/public/")){const e=document.querySelector(".toolbars-button-menu.action-group_more_action"),t=Array.from(document.querySelector("#main-toolbar").children).find((e=>"button"===e.type&&e.querySelector(".action-local_toggle_theme"))),n=Array.from(document.querySelectorAll(".toolbars-button-menu")).find((e=>1==e.classList.length));e&&e.remove(),t&&t.remove(),n&&n.remove()}}}},move:{}};document.addEventListener("DOMContentLoaded",(t=>{var n;n=e,Object.entries(n).forEach((([e,t])=>{Object.entries(t).forEach((([t,{event:o,target:i,handler:a}])=>{console.log("attaching event handler",n[e][t]);try{i.addEventListener(o,a)}catch(o){console.error("could not attach: ",n[e][t])}}))}))}))},937:()=>{const e=[e=>e.querySelector(".icomoon-cells")?.closest("button"),e=>e.querySelector(".layout-fill")];window.addEventListener("load",(function t(){if(window.location.pathname.includes("/login")){const e=new MutationObserver((()=>{window.location.pathname.includes("/login")||(e.disconnect(),t())}));e.observe(document.documentElement,{childList:!0,subtree:!0})}else pydio?.user?(pydio.user.isAdmin||pydio.observe("context_changed",(t=>{if("Settings"===t._label){const t=new MutationObserver((()=>{let n=!1;e.forEach((e=>{const t=e(document);t&&(t.remove(),n=!0)})),n&&t.disconnect()}));t.observe(document.body,{childList:!0,subtree:!0})}})),window.removeEventListener("load",t)):setTimeout(t,100)}))},678:()=>{const e=e=>{try{return pydio._dataModel._selectedNodes[0]._metadata.get(e)||null}catch(e){return null}},t=(e,t,n,o)=>{const i=Curate.workspaces.getOpenWorkspace();return n&&"File has not been scanned"!=e||"quarantine"!=i||"Scan Limit Exceeded"===n?n&&"File has not been scanned"!=e||"quarantine"===i||"Scan Limit Exceeded"===n?"Quarantined"==n?`File in quarantine, current period: ${(e=>Math.floor((new Date-new Date(e))/864e5))(o)} days.`:"Scan Limit Exceeded"==n?"File is too large to be scanned.":"Passed"!=n||"personal-files"!=i&&"common files"!=i?"Passed"==n?"File has passed an initial scan but will not be scanned again, please move it into the Quarantine workspace.":"Released"==n?"File has been released from quarantine.":"Risk"==n?"File has not completed its quarantine period and is at risk.":void 0:`File has passed the ${i.replace("-"," ")} scan.`:"This file has not been scanned and is at risk. Please move it into the Quarantine workspace to be scanned.":"This file has not been scanned and is at risk."},n=(e,t)=>{const n=(e,t,n={})=>{const o=document.createElement("div");return o.className=e,o.textContent=t,Object.assign(o.style,n),o},o=n("infoPanelRow",null,{padding:"0px 16px 6px"}),i=n("infoPanelLabel",e,{fontWeight:"415"}),a=n("infoPanelValue",t);return o.appendChild(i),o.appendChild(a),o};function o(o){var i=e("files")?.[0]?.matches?.[0]?.id??"File has not been characterised",a=["usermeta-virus-scan-first","usermeta-virus-scan-second"].map((t=>e(t)||"File has not been scanned")),r=pydio._dataModel._selectedNodes[0]._metadata.get("etag");r.endsWith("-1")&&(r="Local hash");var s=e("mime");const l=e("usermeta-virus-scan"),d=e("usermeta-virus-scan-passed-date");var c=t(...a,l,d);setTimeout((function(){let e=document.createElement("div");e.style.marginTop="-11px",e.id="curateAdditionalInfo";let t=n("Pronom ID",i);"File has not been characterised"!==i&&(t.style.cursor="pointer",t.style.transition="all 0.2s ease-in-out",t.addEventListener("mouseenter",(e=>{t.style.textDecoration="underline",t.style.backgroundColor="rgba(153, 153, 153, 0.2)"})),t.addEventListener("mouseleave",(e=>{t.style.textDecoration="none",t.style.backgroundColor="transparent"})),t.addEventListener("click",(e=>{window.open(`https://www.nationalarchives.gov.uk/pronom/${i}`)})));let l=n("First virus scan result",a[0]),d=n("Second virus scan result",a[1]),p=(n("Mimetype",s),n("Status",c));o.querySelector(".panelContent").childNodes.forEach((e=>{e.innerText.includes("ETag")&&(e.firstChild.innerText="Checksum",e.querySelector(".infoPanelValue").innerText=r)}));let u=document.createElement("HR"),m=document.createElement("div"),h=document.createElement("div");h.style.marginBottom="5px",m.textContent="Quarantine Info",m.id="quarantineInfoLabel",m.style.color="rgb(77, 122, 143)",m.style.fontSize="14px",m.style.fontWeight="500",m.style.marginLeft="15px",m.style.marginBottom="10px",e.appendChild(t),e.appendChild(u),e.appendChild(m),e.appendChild(p),e.appendChild(l),e.appendChild(d),e.appendChild(h),o.querySelector("#curateAdditionalInfo")?(Array.from(document.querySelectorAll(".panelCard")).find((e=>e.textContent.includes("File Info")))?.querySelector("#curateAdditionalInfo")?.remove(),o.appendChild(e)):o.appendChild(e)}),5)}const i=(e,t)=>{t=Array.from(document.querySelectorAll(".panelCard")).find((e=>e.textContent.includes("File Info")));e.memo._selectedNodes&&0!=e.memo._selectedNodes.length&&e.memo._selectedNodes[0]!=a&&t&&t.querySelector(".panelContent")&&(o(t),a=e.memo._selectedNodes[0])};var a;const r=e=>{if(e)return pydio._dataModel._observers.selection_changed.includes(i)||pydio._dataModel.observe("selection_changed",(e=>{i(e)})),e.firstElementChild.addEventListener("click",(t=>{e.querySelector('[class*="mdi-chevron-"]').classList.contains("mdi-chevron-up")||e.querySelector('[class*="mdi-chevron-"]').classList.contains("mdi-chevron-down")})),function(e,t){if(!e||!e.parentElement)return void console.error("The element or its parent is not defined.");const n=new MutationObserver((o=>{for(let i of o)if(i.removedNodes.length)for(let o of i.removedNodes)if(o===e||o.contains(e))return t(),void n.disconnect()}));n.observe(e.parentElement,{childList:!0,subtree:!0})}(e.querySelector(".panelContent"),(()=>{e.querySelector("#curateAdditionalInfo").remove()})),void(e.querySelector(".panelContent")&&o(e))};new MutationObserver(((e,t)=>{for(const t of e)if("childList"===t.type)for(const e of t.addedNodes)e instanceof HTMLElement&&e.classList.contains("panelCard")&&e.innerText.includes("File Info")?r(e):e instanceof HTMLElement&&e.classList.contains("panelContent")&&e.parentElement.classList.contains("panelCard")&&e.parentElement.innerText.includes("File Info")&&r(e.parentElement)})).observe(document.documentElement,{childList:!0,subtree:!0})},663:()=>{window.addEventListener("load",(function(){new Promise(((e,t)=>{!function t(){"undefined"!=typeof pydio?e():setTimeout(t,100)}()})).then((()=>{pydio._dataModel.observe("selection_changed",(function(e){setTimeout((()=>{const e=document.querySelector("#info_panel > div");e&&e.scrollTo({top:0,left:0})}),50)}))}))}))},711:()=>{const e=window.curateDistrobution||"Soteria+",t=()=>{console.log("message modifier");const n=pydioBootstrap.parameters.get("i18nMessages");Object.keys(n).forEach((t=>{"string"==typeof n[t]&&(n[t]=n[t].replace(/Pydio\s*Cells/gi,e).replace(/(?{function e(e){let t=document.createElement("div"),n=document.createElement("button"),o=document.createElement("span"),i=document.createElement("text"),a=document.createElement("hr");i.textContent=e,i.style.marginTop="1em",o.style.ariaHidden="true",o.innerHTML="×",n.style.ariaLabel="Close alert",n.style.type="button",n.style.backgroundColor="white",n.style.border="0",n.style.position="absolute",n.style.top="0",n.style.right="0",n.onclick=function(){this.parentNode.className="slideOut",setTimeout((function(){t.remove()}),1e3)},n.appendChild(o),t.style.backgroundColor="white",t.style.borderRadius="0.5em",t.style.width="16em",t.style.height="auto",t.style.padding="1.8em",t.style.paddingBottom="0em",t.style.margin="2em",t.style.position="absolute",t.style.bottom="5em",t.style.right="0",t.style.boxShadow="0 10px 16px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19)",t.className="slideIn",a.style.borderTop="1px solid black",a.style.marginTop="1em",a.className="lineLoad",n.appendChild(o),t.appendChild(n),t.appendChild(i),t.appendChild(a),document.querySelector("body").appendChild(t),setTimeout((function(){t.classList.remove("slideIn")}),1e3),setTimeout((function(){t.className="slideOut",setTimeout((function(){t.remove()}),1e3)}),6e3)}let t=e=>new Promise((t=>setTimeout(t,e)));function n(){setTimeout((function(){let e=["Generate mimetype report","Export Archivematica JSON"];for(let t=0;t{window.addEventListener("load",(function(){var t=Object.fromEntries(pydioBootstrap.parameters).i18nMessages;Object.entries(e).forEach((function(e){t[e[0]]=e[1]}))}));var e={"ajax_gui.tour.welcomemodal.title":"Welcome to Curate","ajax_gui.tour.welcomemodal.subtitle":"Drag'n'drop a photo of you for your profile! This quick tour will guide you through the web interface.","ajax_gui.tour.welcomemodal.start":"Start the tour","ajax_gui.tour.workspaces.1":"Workspaces are top-level folders that help you manage your archiving workflow and organise your data. The Personal Files workspace can only be accessed by you and the Quarantine, Appraisal and Archive workspaces are shared with your workgroup. The Package Templates workspace is common to all accounts and is read only.","ajax_gui.tour.workspaces.2":"You can upload into the Personal Files and Quarantine workspaces, move files to Appraisal to work on them and deposit packages in the Archive when you are finished.","ajax_gui.tour.globsearch.title":"Global Search","ajax_gui.tour.globsearch.1":"Use this search form to find files or folders in any workspace. Only the first 5 results are shown, enter a workspace to get more results, and more search options. Tip: you can use an asterisk as a wild card.","ajax_gui.tour.globsearch.2":"When no search is entered, the history of your recently accessed files and folder is displayed instead.","ajax_gui.tour.openworkspace.title":"Open a workspace","ajax_gui.tour.openworkspace":"At the first connection, your history is probably empty. Enter the Personal or Quarantine workspaces to start adding files. Tip: files are virus checked when they are uploaded and should be kept in Quarantine for 30 days, after which they are scanned again.","ajax_gui.tour.create-menu.title":"Add files","ajax_gui.tour.create-menu":"Start adding new files or folders to the current workspace.","ajax_gui.tour.display-bar.title":"Display Options","ajax_gui.tour.display-bar":"This toolbar allows you to change the display: switch to thumbnails or detail mode depending on your usage, and sort files by name, date, etc...","ajax_gui.tour.infopanel.title":"Info Panel","ajax_gui.tour.infopanel.1":"Here, you will find a preview and comprehensive information about your current selection: file information, virus scan status, metadata, etc.","ajax_gui.tour.infopanel.2":"You can close this panel by using the info button in the display toolbar","ajax_gui.tour.uwidget.title":"User Settings","ajax_gui.tour.uwidget.addressbook":"Directory of all the users accessing to the platform. Create your own users, and constitute teams that can be used to share resources","ajax_gui.tour.uwidget.alerts":"Alerts panel will inform you when a user with whom you shared some resources did access it. They can be sent to you directly by email.","ajax_gui.tour.uwidget.menu":"Access to other options : manage your profile and password, view all of the public links you have created, send a support message, configure the Archivematica Connector and sign out of the platform.","ajax_gui.tour.uwidget.home":"Go back to the welcome panel with this button"}},92:()=>{[{name:"he",url:"https://cdn.jsdelivr.net/npm/he@1.2.0/he.min.js"},{name:"swal",url:"https://cdn.jsdelivr.net/npm/sweetalert2@11"},{name:"papaparse",url:"https://cdn.jsdelivr.net/npm/papaparse@5.4.1/papaparse.min.js"},{name:"chart.js",url:"https://cdn.jsdelivr.net/npm/chart.js"},{name:"spark-md5",url:"https://cdnjs.cloudflare.com/ajax/libs/spark-md5/3.0.2/spark-md5.min.js"}].forEach((e=>{let t=document.createElement("script");t.src=e.url,t.onerror=function(){console.error("Failed to load external library: ",e.name,"please reload the page or contact your admin if the issue persists.")},document.head.appendChild(t)}))},380:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.apiKey="",this.atomUrl="",this.username="",this.password="",this.retrieveDetails(),this.render()}async retrieveDetails(){try{const e=await Curate.api.fetchCurate("/api/atom","GET");this.apiKey=e.atom_api_key,this.atomUrl=e.atom_url,this.username=e.atom_username,this.password=e.atom_password,this.render()}catch(e){console.error("Error retrieving details from Atom:",e)}}saveDetails(e){e.preventDefault(),Curate.api.fetchCurate("/api/atom","POST",{atom_api_key:this.apiKey,atom_url:this.atomUrl,atom_username:this.username,atom_password:this.password}).then((e=>{console.log("Saved Atom details:",e)})).catch((e=>{console.error("Error saving Atom details:",e)})),""!==this.apiKey&&(localStorage.setItem("atom_api_key",this.apiKey),console.log("Saving API Key:",this.apiKey)),""!==this.atomUrl&&(localStorage.setItem("atom_url",this.atomUrl),console.log("Saving Atom URL:",this.atomUrl)),""!==this.username&&(localStorage.setItem("atom_username",this.username),console.log("Saving Atom Username:",this.username)),""!==this.password&&(localStorage.setItem("atom_password",this.password),console.log("Saving Atom Password:",this.password)),this.render()}handleApiKeyChange(e){this.apiKey=e.target.value}handleUrlChange(e){this.atomUrl=e.target.value}handleUsernameChange(e){this.username=e.target.value}handlePasswordChange(e){this.password=e.target.value}togglePasswordVisibility(){const e=this.shadowRoot.querySelector("#password"),t=this.shadowRoot.querySelector("#toggle-password");"password"===e.type?(e.type="text",t.textContent="Hide"):(e.type="password",t.textContent="Show")}render(){this.shadowRoot.innerHTML=`\n \n
\n
\n
\n Current API Key:\n ${"*".repeat(this.apiKey?.length)||"Not Set"}\n
\n
\n Current Atom URL:\n ${this.atomUrl||"Not Set"}\n
\n
\n Current Username:\n ${this.username||"Not Set"}\n
\n
\n Current Password:\n ${"*".repeat(this.password?.length)||"Not Set"}\n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n \n
\n \n
\n
\n `,this.shadowRoot.querySelector("#details-form").addEventListener("submit",(e=>this.saveDetails(e))),this.shadowRoot.querySelector("#api-key").addEventListener("input",(e=>this.handleApiKeyChange(e))),this.shadowRoot.querySelector("#atom-url").addEventListener("input",(e=>this.handleUrlChange(e))),this.shadowRoot.querySelector("#username").addEventListener("input",(e=>this.handleUsernameChange(e))),this.shadowRoot.querySelector("#password").addEventListener("input",(e=>this.handlePasswordChange(e))),this.shadowRoot.querySelector("#toggle-password").addEventListener("click",(()=>this.togglePasswordVisibility()))}}customElements.define("connect-to-atom",e)},543:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.atomUrl=null,this.criteria=[{id:0,query:"",field:"",operator:""}],this.results=[],this.criterionIndex=1,this.node=null,this.error=null,this.isLoading=!1,this.currentPage=1,this.totalResults=0,this.resultsPerPage=10,this.initialise(),this.render()}async initialise(){this.atomUrl=await this.getAtomUrl()}setNode(e){this.node=e,this.render()}addCriterion(){this.criteria.push({id:this.criterionIndex,query:"",field:"",operator:"and"}),this.criterionIndex++,this.render()}removeCriterion(e){this.criteria=this.criteria.filter((t=>t.id!==e)),this.render()}handleInputChange(e,t,n){this.criteria=this.criteria.map((o=>o.id===e?{...o,[t]:n}:o));const o=this.shadowRoot.querySelector(`[data-id="${e}"][data-field="${t}"]`);o&&(o.value=n)}async performSearch(e=1){this.isLoading=!0,this.error=null,this.currentPage=e,this.render();const t=new URLSearchParams;this.criteria.forEach(((e,n)=>{n>0&&t.append(`so${n}`,e.operator),t.append(`sq${n}`,e.query),t.append(`sf${n}`,e.field)})),t.append("topLod",0),t.append("skip",(e-1)*this.resultsPerPage);try{const e=`${window.location.protocol}//${window.location.hostname}/api/atom/search`,n=await PydioApi._PydioRestClient.getOrUpdateJwt(),o=await fetch(`${e}?${t.toString()}`,{headers:{Authorization:`Bearer ${n}`}});if(!o.ok)throw new Error(`HTTP error! status: ${o.status}`);const i=await o.json();console.log("Retrieved results:",i),this.results=i.results,this.totalResults=i.total}catch(e){console.error("Error performing search:",e),this.error=`An error occurred while searching: ${e.message}`}finally{this.isLoading=!1,this.render()}}handleResultClick(e){console.log("Result clicked:",e);var t=[];if(!this.node)throw new Error("No node set");console.log("node to link to:",this.node),t.push({NodeUuid:this.node._metadata.get("uuid"),JsonValue:JSON.stringify(e),Namespace:"usermeta-atom-linked-description",Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]}),Curate.api.fetchCurate("/a/user-meta/update","PUT",{MetaDatas:t,Operation:"PUT"}),this.dispatchEvent(new CustomEvent("description-linked",{detail:e})),this.remove()}toggleAccordion(e){e.classList.toggle("collapsed");const t=e.nextElementSibling,n=e.querySelector(".chevron");t.classList.contains("show")?(t.classList.remove("show"),n.classList.remove("down"),localStorage.setItem("accordionState","true")):(t.classList.add("show"),n.classList.add("down"),localStorage.setItem("accordionState","false"))}renderPagination(){const e=Math.ceil(this.totalResults/this.resultsPerPage);let t="";if(e>1){t+='
',t+='
Showing results '+((this.currentPage-1)*this.resultsPerPage+1)+" - "+Math.min(this.currentPage*this.resultsPerPage,this.totalResults)+" of "+this.totalResults+"
",t+='",t+="
"}return t}getPageRange(e,t){let n=[];const o=e-2,i=e+2+1;for(let e=1;e<=t;e++)(1===e||e===t||e>=o&&e1===e||e===t||(!i[o-1]||i[o-1]+1===e||(n.splice(o,0,null),!0)))),n}async getAtomUrl(){return Curate.api.fetchCurate(":6900/atom","GET").then((e=>e.atom_url))}render(){this.shadowRoot.innerHTML=`\n \n
\n \n
\n
\n

This interface allows you to search for descriptions in your AtoM instance using a set of search criteria.

\n

You can add as many search criteria as you like, and then perform a search to find descriptions that match your criteria.

\n

Once you have found a description, you can link it to your selected node in Curate.

\n

Please note: only the top-level linked description will be considered when associating your dissemination package with AtoM.

\n

For example, if you create an AIP from a folder containing multiple files, only the folder itself will be checked for a linked description.

\n

AtoM automatically links the sub-files or folders as child level descendants of the top-level linked description.

\n
\n
\n
\n
\n
\n ${this.criteria.map(((e,t)=>`\n
\n ${t>0?`\n \n `:""}\n \n \n \n
\n `)).join("")}\n
\n \n \n\n ${this.isLoading?'
':""}\n \n ${this.error?`
${this.error}
`:""}\n\n
\n ${0!==this.results.length||this.isLoading||this.error?this.results.map((e=>`\n
\n
\n

${e.title}

\n

Reference code: ${e.reference_code}

\n

Level of description: ${e.level_of_description}

\n

URL: ${this.atomUrl}/${e.slug}

\n \n
\n ${e.thumbnail_url?`\n \n `:""}\n
\n `)).join(""):"

No results found. Please try a different search.

"}\n
\n ${this.renderPagination()}\n
\n \n `}}customElements.define("atom-search-interface",e)},738:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this.render(),console.log("connected help"),this.updateContent()}render(){this.shadowRoot.innerHTML='\n \n
\n '}updateContent(){const e=Curate.contextualHelp.context;this.shadowRoot.querySelector(".help-content").textContent=this.getHelpContent(e)}getHelpContent(e){const{page:t,lastRightClickedElement:n,selection:o}=e,i=o&&o.length>0;n&&n.tagName.toLowerCase();return!0===i?`You've selected ${o.length} item(s). This area allows you to perform actions on your selection.`:`You're on the ${t} page. Right-click on elements to see context-specific help.`}}customElements.define("contextual-help",e)},523:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.processQueue=[],this.runningProcesses=new Map,this.maxConcurrent=5}connectedCallback(){this.render(),this.processQueueInterval=setInterval((()=>this.processQueuedItems()),1e3)}disconnectedCallback(){clearInterval(this.processQueueInterval)}render(){this.shadowRoot.innerHTML='\n \n
\n '}addToQueue(e){const t={id:this.generateUniqueId(e),node:e,status:"queued",title:`Queued: ${e._metadata.get("usermeta-import-oai-link-id")}`,details:`Repository: ${e._metadata.get("usermeta-import-oai-repo-url")}`,nodeTitle:e._label};this.processQueue.push(t),this.updateStatusCard(t)}async processQueuedItems(){for(;this.runningProcesses.size0;){const e=this.processQueue.shift();this.runningProcesses.set(e.id,e),this.initiateHarvest(e)}}async initiateHarvest(e){const{node:t,id:n}=e,o=t._metadata.get("usermeta-import-oai-repo-url"),i=t._metadata.get("usermeta-import-oai-link-id"),a=t._metadata.get("usermeta-import-oai-metadata-prefix");if(o&&i&&a){this.updateProcessStatus(n,"loading",`Harvesting ${i}`,`Repository: ${o}`,0);try{const e=await fetch("http://127.0.0.1:5000/harvest",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({repo_url:o,identifier:i,metadata_prefix:a})});if(!e.ok){const t=await e.json();throw{message:t.error,data:t.data}}const r=await e.json(),s=this.convertJson(r);await Curate.api.files.updateMetadata(t,s),this.updateProcessStatus(n,"success",`Harvested ${i}`,`Successfully processed data from ${o}${i}`,100)}catch(e){this.updateProcessStatus(n,"error",`Failed to harvest ${i}`,`Error: ${e.message}: ${e.data?e.data:""}`,100)}finally{this.runningProcesses.delete(n)}}else this.updateProcessStatus(n,"error",`Failed to harvest ${i}`,"Repository, identifier, or metadata prefix not found",100)}updateProcessStatus(e,t,n,o,i){const a=this.runningProcesses.get(e)||this.processQueue.find((t=>t.id===e));a&&(Object.assign(a,{status:t,title:n,details:o,progress:i}),this.updateStatusCard(a))}updateStatusCard(e){const t=this.shadowRoot.querySelector(".status-container");let n=t.querySelector(`[data-id="${e.id}"]`);n||(n=document.createElement("div"),n.classList.add("status-item"),n.setAttribute("data-id",e.id),t.appendChild(n));const{status:o,title:i,details:a,progress:r,nodeTitle:s}=e;n.innerHTML=`\n
\n ${i}\n \n
\n
${a}
\n
Node: ${s}
\n ${"loading"===o?`\n
\n
\n
\n `:""}\n `}generateUniqueId(e){return`${e._metadata.get("uuid")}-${e._metadata.get("usermeta-import-oai-link-id")}`}convertJson(e){const t=e.schema,n=e.data;let o=[];for(const e in n)if(Array.isArray(n[e])){let t=n[e].join(", ");o.push({field:e,value:t})}let i={};return i[t]=o,i}processAllNodes(e){e.forEach((e=>this.addToQueue(e)))}}customElements.define("oai-harvest-status",e)}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var a=t[o]={exports:{}};return e[o](a,a.exports,n),a.exports}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var o=t.getElementsByTagName("script");if(o.length)for(var i=o.length-1;i>-1&&(!e||!/^http(s?):/.test(e));)e=o[i--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),(()=>{"use strict";const e={fetchCurate:async function(e,t="POST",n){if(!e)throw new Error("No endpoint provided");try{const o=await PydioApi._PydioRestClient.getOrUpdateJwt(),i={method:t,headers:{accept:"application/json","accept-language":navigator.language+",en-GB,en-US;q=0.9,en;q=0.8",authorization:"Bearer "+o,"content-type":"application/json","sec-fetch-dest":"empty","sec-fetch-mode":"cors","sec-fetch-site":"same-origin","x-pydio-language":pydio.user.getPreference("lang")},referrer:window.location.href,referrerPolicy:"strict-origin-when-cross-origin",mode:"cors",credentials:"include"};["GET","HEAD"].includes(t)||(i.body=JSON.stringify(n));const a=await fetch(window.location.origin+e,i);if(!a.ok)throw new Error("Network response was not ok");return await a.json()}catch(e){throw console.error("Curate fetch error:",e),e}},files:{createFiles:async function(e){if(!e)throw new Error("No nodes provided");async function t(e,t){const n={MetaDatas:[],Operation:"PUT"};for(const o in e)"path"!==o&&e[o].forEach((e=>{const i=`usermeta-${o}-${e.field}`,a={NodeUuid:t,Namespace:i,JsonValue:JSON.stringify(e.value),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]};n.MetaDatas.push(a)}));return n}const n=e.nodes.map((async e=>{const t=e.path.split("/").pop(),n=(await Curate.api.fetchCurate("/a/tree/create","POST",{Nodes:[{Path:e.path,Type:"LEAF"}],TemplateUUID:""})).Children[0].Path;return{filename:t,uuid:(await Curate.api.fetchCurate("/a/meta/bulk/get","POST",{Limit:200,NodePaths:[n]})).Nodes[0].Uuid,node:e}})),o=await Promise.all(n);for(const{filename:e,uuid:n,node:i}of o){const e=await t(i,n);await Curate.api.fetchCurate("/a/user-meta/update","PUT",e)}},getFileData:async function(e,t="text"){if(!e)throw new Error("No node provided");try{await PydioApi._PydioRestClient.getOrUpdateJwt();const n=await pydio.ApiClient.buildPresignedGetUrl(e),o=await fetch(n);if(!o.ok)throw new Error("Network response was not ok");if("text"===t)data=await o.text();return data}catch(e){throw console.error("Error fetching object:",e),e}},updateMetadata:async function(e,t){if(!t)throw new Error("No metadata provided");if(!e)throw new Error("No node provided");const n=((e,t)=>{const n={MetaDatas:[],Operation:"PUT"};for(const o in t)t[o].forEach((t=>{const i=`usermeta-${o}-${t.field}`,a={NodeUuid:e._metadata.get("uuid"),Namespace:i,JsonValue:JSON.stringify(t.value),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]};n.MetaDatas.push(a)}));return n})(e,t);return await Curate.api.fetchCurate("/a/user-meta/update","PUT",n)}}},t={getOpenWorkspace:function(){return pydio._dataModel._rootNode._label.toLowerCase()==pydio.user.id.toLowerCase()?"personal-files":pydio._dataModel._rootNode._label.toLowerCase().replace(/^\d+\.\s*/,"")}},o={modals:{curatePopup:function(e,t){const n=e.title,o=e.message,i=e.type,a=e.content,r=e.buttonType||"close",s=t?.afterLoaded||function(){},l=t?.afterClosed||function(){},d=t?.onOk||function(){},c=t?.onCancel||function(){},p={warning:{color:"#FFA500",icon:"mdi-alert"},error:{color:"#FF0000",icon:"mdi-alert-circle"},success:{color:"#008000",icon:"mdi-check-circle"},info:{color:"#0000FF",icon:"mdi-information"}};return{fire:function(){const e=document.createElement("div");e.classList.add("config-modal-container"),e.style.display="flex",e.addEventListener("click",(function(t){y(t,e)}),{once:!0});const t=document.createElement("div");t.classList.add("config-modal-content"),i&&(t.style.borderTop=`4px solid ${p[i].color}`);const u=document.createElement("div");if(u.classList.add("config-popup-title"),i){const e=document.createElement("i");e.classList.add("mdi",p[i].icon),e.style.color=p[i].color,e.style.fontSize="24px",e.style.marginRight="10px",u.appendChild(e)}const m=document.createTextNode(n);u.appendChild(m);const h=document.createElement("div");if(h.classList.add("config-main-options-container"),h.style.width="100%",o){const e=document.createElement("div");e.classList.add("config-popup-message"),e.textContent=o,h.appendChild(e)}if(a){const e=document.createElement("div");e.innerHTML=a,h.appendChild(e)}const g=document.createElement("div");if(g.classList.add("action-buttons"),"okCancel"===r){const t=document.createElement("button");t.classList.add("config-modal-ok-button"),t.textContent="OK",t.addEventListener("click",(()=>{d(),f(e)}));const n=document.createElement("button");n.classList.add("config-modal-cancel-button"),n.textContent="Cancel",n.addEventListener("click",(()=>{c(),f(e)})),g.appendChild(t),g.appendChild(n)}else{const t=document.createElement("button");t.classList.add("config-modal-close-button"),t.textContent="Close",t.addEventListener("click",(()=>{f(e)})),g.appendChild(t)}function f(e){e.remove(),l()}function y(e,t){e.target===t?f(t):t.addEventListener("click",(function(e){y(e,t)}),{once:!0})}t.appendChild(u),t.appendChild(h),t.appendChild(g),e.appendChild(t),document.body.appendChild(e),e.addEventListener("keyup",(function(e){e.stopPropagation()})),s(e)}}}}},i=e=>{const t={"ISAD(G)":({},{sections:[{title:"Identity Statement",fields:["reference code(s)","title","date(s)","level of description","extent and medium of the unit of description"]},{title:"Context",fields:["name of creator(s)","administrative/biographical history","archival history","immediate source of acquisition or transfer"]},{title:"Content And Structure",fields:["scope and content","appraisal, destruction and scheduling information","accruals","system of arrangement"]},{title:"Conditions Of Access And Use",fields:["conditions governing access","conditions governing reproduction","language/scripts of material","physical characteristics and technical requirements","finding aids"]},{title:"Allied Materials",fields:["existence and location of originals","existence and location of copies","related units of description","publication note"]},{title:"Notes",fields:["note"]},{title:"Description Control",fields:["archivists note","rules or conventions","date(s) of descriptions"]}]}),DC:({},{fields:["contributor","coverage","creator","date","description","format","identifier","language","publisher","relation","rights","source","subject","title","type"]})};return e&&e in t?t[e]:e?void console.error("invalid schema"):t},a={schemas:{getSchemas:function(e){return i(e)}}};const r={context:{page:window.location.pathname,lastRightClickedElement:null,selection:null}};function s(e){2===e.button&&(r.context.lastRightClickedElement=e.target,r.context.page=window.location.pathname,r.context.selection=pydio?._dataModel._selectedNodes||null)}window.addEventListener("load",(()=>document.addEventListener("mousedown",s)));const l={api:e,workspaces:t,ui:o,metadata:a,contextualHelp:r};window.Curate=l;n(125),n(678),n(887),n(578);function d(){return new Worker(n.p+"hashWorker.worker.52fb74a7a206414c3233.worker.js")}const c=class{constructor(){this.taskQueue=[],this.isProcessing=!1,this.worker=null}initWorker(){this.worker&&this.worker.terminate(),this.worker=new d,console.log("Worker initialized: ",this.worker),this.setupWorkerHandlers()}setupWorkerHandlers(){this.worker.onmessage=e=>{console.log("goober: ",e.data),"complete"===e.data.status&&this.currentResolve&&this.currentResolve({file:this.currentFile,hash:e.data.hash,name:this.currentFile.name}),this.processNextTask()},this.worker.onerror=e=>{this.currentReject&&this.currentReject("Worker error: "+e.message),this.processNextTask()}}generateChecksum(e){return new Promise(((t,n)=>{this.taskQueue.push({file:e,resolve:t,reject:n}),this.isProcessing||this.processNextTask()}))}processNextTask(){if(this.taskQueue.length>0){this.worker||this.initWorker();const e=this.taskQueue.shift();this.currentResolve=e.resolve,this.currentReject=e.reject,this.currentFile=e.file,this.isProcessing=!0,this.worker.postMessage({file:e.file,msg:"begin hash"})}else this.isProcessing=!1,this.worker&&(this.worker.terminate(),this.worker=null)}};window.addEventListener("load",(()=>{(async()=>{for(;"undefined"==typeof UploaderModel;)await new Promise((e=>setTimeout(e,100)));const e=new c;console.log("WorkerManager initialized");const t=UploaderModel.UploadItem.prototype.uploadPresigned;function n(e,t,i){Curate.api.fetchCurate("/a/tree/stats","POST",{NodePaths:[e]}).then((a=>{const r=a.Nodes.find((t=>t.Path===e));r?function(e,t,i,a){const r=3;"temporary"===e.Etag&&a{n(i,t,a+1)}),2e3)):e.Etag===t?(console.log("Checksum validation passed."),o(e.Uuid,"usermeta-file-integrity","✓ Integrity verified")):(console.error("Checksum validation failed.","Expected:",t,"Received:",e.Etag),o(e.Uuid,"usermeta-file-integrity","X Integrity compromised"))}(r,t,e,i):console.error("Node not found in response:",e)})).catch((e=>{console.error("Error fetching node stats:",e)}))}function o(e,t,n){const o={MetaDatas:[{NodeUuid:e,Namespace:t,JsonValue:JSON.stringify(n),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]}],Operation:"PUT"};Curate.api.fetchCurate("/a/user-meta/update","PUT",o)}UploaderModel.UploadItem.prototype.uploadPresigned=function(){const o=t.apply(this,arguments),i=t=>{console.log(t),"loaded"===t&&(this._observers.status.forEach(((e,t)=>{e===i&&this._observers.status.splice(t,1)})),console.log("Attempting to generate checksum for: ",this._file),e.generateChecksum(this._file).then((e=>{console.log("Generated checksum data:",e);const t=Math.min(5e3,Math.max(500,.01*this._file.size));setTimeout((()=>{const t=this._targetNode._path,o=t.endsWith("/")?"":"/",i=this._parent._label?`${this._parent._label}/`:"";n(`${Curate.workspaces.getOpenWorkspace()}${t}${o}${i}${this._label}`,e.hash,0)}),t)})).catch((e=>{console.error("Checksum generation failed:",e)})))};return this._observers.status.push(i),o}})()}));n(627),n(937),n(711),n(663),n(543),n(380);class p extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.nodes=[],this.render()}setNodes(e){this.nodes=e,this.render()}render(){this.shadowRoot.innerHTML=`\n \n
\n
\n The selected preservation configuration has DIP generation enabled. The following items do not have a linked AtoM description, which will cause DIP generation to fail.\n
\n
\n ${this.nodes.map((e=>`\n
\n ${e._path}\n \n
\n `)).join("")}\n
\n
\n `,this.shadowRoot.querySelectorAll(".link-button").forEach((e=>{e.addEventListener("click",(()=>{console.log(`Add description for ${e.getAttribute("data-path")}`),Curate.ui.modals.curatePopup({title:"Connect Selected Node to an AtoM Description"},{afterLoaded:t=>{const n=document.createElement("atom-search-interface");n.setNode(this.nodes.find((t=>t._path==e.getAttribute("data-path")))),t.querySelector(".config-main-options-container").appendChild(n),n.addEventListener("description-linked",(n=>{console.log("description linked"),t.remove();const o=document.createElement("div");o.innerHTML="
🔗
",e.parentElement.querySelector(".file-name").after(o),e.remove()}))},afterClosed:()=>{}}).fire()}))}))}}customElements.define("dip-slug-resolver",p);n(738),n(523),n(93),n(92)})()})(); \ No newline at end of file