diff --git a/dist/FilesVersionsSidebarTab-0wNUfEkv.chunk.mjs b/dist/FilesVersionsSidebarTab-DsT8l27C.chunk.mjs similarity index 98% rename from dist/FilesVersionsSidebarTab-0wNUfEkv.chunk.mjs rename to dist/FilesVersionsSidebarTab-DsT8l27C.chunk.mjs index 5de1bdcb5dcaa..6985506c39a5e 100644 --- a/dist/FilesVersionsSidebarTab-0wNUfEkv.chunk.mjs +++ b/dist/FilesVersionsSidebarTab-DsT8l27C.chunk.mjs @@ -1,4 +1,4 @@ -import{d as j,a as Y}from"./index-JpgrUA2Z-Rp7fa0gf.chunk.mjs";import{a as O,g as te,e as I}from"./index-Bndk0DrU.chunk.mjs";import{t as c,a as P}from"./translation-DoG5ZELJ-Bni_xMHF.chunk.mjs";import{N as oe,u as se}from"./index-Cg5VsXN5.chunk.mjs";import{N as ne}from"./mdi-DXIZZeEd.chunk.mjs";import{f as re}from"./index-DNfSxz5H.chunk.mjs";import{a as E,l as ae,j as le,e as ce}from"./index-xFugdZPW.chunk.mjs";import{k as de,g as J,f as ue}from"./createElementId-DhjFt1I9-CNrdQIoZ.chunk.mjs";import{N as M,P as ve}from"./PencilOutline-a19hsj34.chunk.mjs";import{N as me,_ as pe}from"./NcDateTime.vue_vue_type_script_setup_true_lang-BhB8yA4U-Utjw7yHu.chunk.mjs";import{N as fe}from"./NcAvatar-C9d7Wrc8-pzWde3CT.chunk.mjs";import{D as he,N as ge,s as be}from"./TrayArrowDown-DXqUo7y4.chunk.mjs";import{j as m,o as a,k as C,l as b,t as _,z as Q,b as R,r as A,c as V,w as f,p as h,u as d,g as N,e as S,L as G,x as we,a5 as X,m as B,M as ee,v as ye,Y as _e,F as Ce,C as ke}from"./runtime-dom.esm-bundler-CU8rrbZA.chunk.mjs";import{D as Se,_ as Ve}from"./TrashCanOutline-D95Fx13e.chunk.mjs";import{P as Z}from"./folder-D9CBQngR-CuPN_AFd.chunk.mjs";import{c as He}from"./index-Conii63U.chunk.mjs";import{g as ze}from"./dav-CufFHsl4.chunk.mjs";import"./NcNoteCard-Cok_4Fld-BI3-Vu_l.chunk.mjs";import"./logger-D3RVzcfQ-B9jnX7-s.chunk.mjs";import"./string_decoder-BO00msnV.chunk.mjs";import"./colors-BHGKZFDI-BMbI6zNx.chunk.mjs";import"./NcUserStatusIcon-XiwrgeCm-CQdLdRFx.chunk.mjs";import"./NcInputField-o5OFv3z6-DW3Gcl3I.chunk.mjs";import"./index-JSJM6V6X.chunk.mjs";const Le={name:"BackupRestoreIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},$e=["aria-hidden","aria-label"],xe=["fill","width","height"],Ae={d:"M12,3A9,9 0 0,0 3,12H0L4,16L8,12H5A7,7 0 0,1 12,5A7,7 0 0,1 19,12A7,7 0 0,1 12,19C10.5,19 9.09,18.5 7.94,17.7L6.5,19.14C8.04,20.3 9.94,21 12,21A9,9 0 0,0 21,12A9,9 0 0,0 12,3M14,12A2,2 0 0,0 12,10A2,2 0 0,0 10,12A2,2 0 0,0 12,14A2,2 0 0,0 14,12Z"},De={key:0};function Ee(e,t,i,n,v,r){return a(),m("span",Q(e.$attrs,{"aria-hidden":i.title?null:"true","aria-label":i.title,class:"material-design-icon backup-restore-icon",role:"img",onClick:t[0]||(t[0]=l=>e.$emit("click",l))}),[(a(),m("svg",{fill:i.fillColor,class:"material-design-icon__svg",width:i.size,height:i.size,viewBox:"0 0 24 24"},[C("path",Ae,[i.title?(a(),m("title",De,_(i.title),1)):b("",!0)])],8,xe))],16,$e)}const Ne=E(Le,[["render",Ee]]),Te={name:"FileCompareIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},Ie=["aria-hidden","aria-label"],Me=["fill","width","height"],Be={d:"M10,18H6V16H10V18M10,14H6V12H10V14M10,1V2H6C4.89,2 4,2.89 4,4V20A2,2 0 0,0 6,22H10V23H12V1H10M20,8V20C20,21.11 19.11,22 18,22H14V20H18V11H14V9H18.5L14,4.5V2L20,8M16,14H14V12H16V14M16,18H14V16H16V18Z"},Oe={key:0};function Pe(e,t,i,n,v,r){return a(),m("span",Q(e.$attrs,{"aria-hidden":i.title?null:"true","aria-label":i.title,class:"material-design-icon file-compare-icon",role:"img",onClick:t[0]||(t[0]=l=>e.$emit("click",l))}),[(a(),m("svg",{fill:i.fillColor,class:"material-design-icon__svg",width:i.size,height:i.size,viewBox:"0 0 24 24"},[C("path",Be,[i.title?(a(),m("title",Oe,_(i.title),1)):b("",!0)])],8,Me))],16,Ie)}const Re=E(Te,[["render",Pe]]),Ue={name:"ImageOffOutlineIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},Fe=["aria-hidden","aria-label"],qe=["fill","width","height"],Ke={d:"M22 20.7L3.3 2L2 3.3L3 4.3V19C3 20.1 3.9 21 5 21H19.7L20.7 22L22 20.7M5 19V6.3L12.6 13.9L11.1 15.8L9 13.1L6 17H15.7L17.7 19H5M8.8 5L6.8 3H19C20.1 3 21 3.9 21 5V17.2L19 15.2V5H8.8"},We={key:0};function je(e,t,i,n,v,r){return a(),m("span",Q(e.$attrs,{"aria-hidden":i.title?null:"true","aria-label":i.title,class:"material-design-icon image-off-outline-icon",role:"img",onClick:t[0]||(t[0]=l=>e.$emit("click",l))}),[(a(),m("svg",{fill:i.fillColor,class:"material-design-icon__svg",width:i.size,height:i.size,viewBox:"0 0 24 24"},[C("path",Ke,[i.title?(a(),m("title",We,_(i.title),1)):b("",!0)])],8,qe))],16,Fe)}const Ye=E(Ue,[["render",je]]),Ze={key:0,class:"version__image"},Je=["src"],Ge={key:2,class:"version__image"},Qe={class:"version__info"},Xe=["title"],ei={key:1,class:"version__info","data-cy-files-version-author-name":""},ii={key:0},ti=["title"],oi={class:"version__info version__info__subline"},si=R({__name:"VersionEntry",props:{version:{},node:{},isCurrent:{type:Boolean},isFirstVersion:{type:Boolean},loadPreview:{type:Boolean},canView:{type:Boolean},canCompare:{type:Boolean}},emits:["click","compare","restore","delete","labelUpdateRequest"],setup(e,{emit:t}){const i=e,n=t,v=A(!1),r=A(!1),l=A(ae("core","capabilities",{files:{version_labeling:!1,version_deletion:!1}})),H=h(()=>re(i.version.size)),p=h(()=>{const y=i.version.label??"";return i.isCurrent?y===""?c("files_versions","Current version"):`${y} (${c("files_versions","Current version")})`:i.isFirstVersion&&y===""?c("files_versions","Initial version"):y}),w=h(()=>!i.version.author||!i.version.authorName?"":i.version.author===O()?.uid?c("files_versions","You"):i.version.authorName??i.version.author),s=h(()=>new Date(i.version.mtime).toLocaleString([P(),P().split("-")[0]],{timeStyle:"long",dateStyle:"long"})),k=h(()=>i.isCurrent?i.node.source:de()+i.version.url),z=h(()=>l.value.files.version_labeling===!0),L=h(()=>l.value.files.version_deletion===!0),F=h(()=>$(i.node,Z.DELETE)),T=h(()=>$(i.node,Z.UPDATE)),q=h(()=>!((i.node.permissions&Z.READ)===0||i.node.attributes["mount-type"]==="shared"&&i.node.attributes["share-attributes"]&&(JSON.parse(i.node.attributes["share-attributes"]).find(y=>y.scope==="permissions"&&y.key==="download")||{})?.value===!1));function K(){n("labelUpdateRequest")}function W(){n("restore",i.version)}async function o(){await G(),await G(),n("delete",i.version)}function u(y){i.canView&&y.preventDefault(),n("click",i.version)}function g(){if(!i.canView)throw new Error("Cannot compare version of this file");n("compare",i.version)}function $(y,x){return(y.permissions&x)!==0}return(y,x)=>(a(),V(d(ge),{class:"version",forceDisplayActions:!0,"actions-aria-label":d(c)("files_versions","Actions for version from {versionHumanExplicitDate}",{versionHumanExplicitDate:s.value}),"data-files-versions-version":e.version.fileVersion,href:k.value,onClick:u},{icon:f(()=>[e.loadPreview||v.value?e.version.previewUrl&&!r.value?(a(),m("img",{key:1,src:e.version.previewUrl,alt:"",decoding:"async",fetchpriority:"low",loading:"lazy",class:"version__image",onLoad:x[0]||(x[0]=ie=>v.value=!0),onError:x[1]||(x[1]=ie=>r.value=!0)},null,40,Je)):(a(),m("div",Ge,[S(Ye,{size:20})])):(a(),m("div",Ze))]),name:f(()=>[C("div",Qe,[p.value?(a(),m("div",{key:0,class:"version__info__label","data-cy-files-version-label":"",title:p.value},_(p.value),9,Xe)):b("",!0),w.value?(a(),m("div",ei,[p.value?(a(),m("span",ii,"•")):b("",!0),S(d(fe),{class:"avatar",user:e.version.author??void 0,size:20,disableMenu:"",disableTooltip:"",hideStatus:""},null,8,["user"]),C("div",{class:"version__info__author_name",title:w.value},_(w.value),9,ti)])):b("",!0)])]),subname:f(()=>[C("div",oi,[S(d(pe),{class:"version__info__date",relativeTime:"short",timestamp:e.version.mtime},null,8,["timestamp"]),x[2]||(x[2]=C("span",null,"•",-1)),C("span",null,_(H.value),1)])]),actions:f(()=>[z.value&&T.value?(a(),V(d(M),{key:0,"data-cy-files-versions-version-action":"label",closeAfterClick:!0,onClick:K},{icon:f(()=>[S(ve,{size:22})]),default:f(()=>[N(" "+_(e.version.label===""?d(c)("files_versions","Name this version"):d(c)("files_versions","Edit version name")),1)]),_:1})):b("",!0),!e.isCurrent&&e.canView&&e.canCompare?(a(),V(d(M),{key:1,"data-cy-files-versions-version-action":"compare",closeAfterClick:!0,onClick:g},{icon:f(()=>[S(Re,{size:22})]),default:f(()=>[N(" "+_(d(c)("files_versions","Compare to current version")),1)]),_:1})):b("",!0),!e.isCurrent&&T.value?(a(),V(d(M),{key:2,"data-cy-files-versions-version-action":"restore",closeAfterClick:!0,onClick:W},{icon:f(()=>[S(Ne,{size:22})]),default:f(()=>[N(" "+_(d(c)("files_versions","Restore version")),1)]),_:1})):b("",!0),q.value?(a(),V(d(me),{key:3,"data-cy-files-versions-version-action":"download",href:k.value,closeAfterClick:!0,download:k.value},{icon:f(()=>[S(he,{size:22})]),default:f(()=>[N(" "+_(d(c)("files_versions","Download version")),1)]),_:1},8,["href","download"])):b("",!0),!e.isCurrent&&L.value&&F.value?(a(),V(d(M),{key:4,"data-cy-files-versions-version-action":"delete",closeAfterClick:!0,onClick:o},{icon:f(()=>[S(Se,{size:22})]),default:f(()=>[N(" "+_(d(c)("files_versions","Delete version")),1)]),_:1})):b("",!0)]),_:1},8,["actions-aria-label","data-files-versions-version","href"]))}}),ni=E(si,[["__scopeId","data-v-037e7d96"]]),ri={class:"version-label-modal__info"},ai=R({__name:"VersionLabelDialog",props:{open:{type:Boolean,default:!1},label:{type:String,default:""}},emits:["update:open","update:label"],setup(e,{emit:t}){const i=e,n=t,v=we("labelInput"),r=A(""),l=h(()=>{const p=[];return i.label.trim()===""?p.push({label:c("files_versions","Cancel")}):p.push({label:c("files_versions","Remove version name"),type:"reset",variant:"error",callback:()=>{H("")}}),[...p,{label:c("files_versions","Save version name"),icon:be,type:"submit",variant:"primary"}]});X(()=>{r.value=i.label??""}),X(()=>{i.open&&G(()=>v.value?.focus()),r.value=i.label});function H(p){n("update:label",p)}return(p,w)=>(a(),V(d(oe),{buttons:l.value,contentClasses:"version-label-modal",isForm:"",open:e.open,size:"normal",name:d(c)("files_versions","Name this version"),"onUpdate:open":w[1]||(w[1]=s=>p.$emit("update:open",s)),onSubmit:w[2]||(w[2]=s=>H(r.value))},{default:f(()=>[S(d(Ve),{ref_key:"labelInput",ref:v,modelValue:r.value,"onUpdate:modelValue":w[0]||(w[0]=s=>r.value=s),class:"version-label-modal__input",label:d(c)("files_versions","Version name"),placeholder:d(c)("files_versions","Version name")},null,8,["modelValue","label","placeholder"]),C("p",ri,_(d(c)("files_versions","Named versions are persisted, and excluded from automatic cleanups when your storage quota is full.")),1)]),_:1},8,["buttons","open","name"]))}}),li=E(ai,[["__scopeId","data-v-0955585b"]]),D=te().setApp("files_version").detectUser().build(),ci=R({name:"VirtualScrolling",props:{sections:{type:Array,required:!0},containerElement:{type:HTMLElement,default:null},useWindow:{type:Boolean,default:!1},headerHeight:{type:Number,default:75},renderDistance:{type:Number,default:.5},bottomBufferRatio:{type:Number,default:2},scrollToKey:{type:String,default:""}},emits:["needContent"],data(){return{scrollPosition:0,containerHeight:0,rowsContainerHeight:0,resizeObserver:null}},computed:{visibleSections(){D.debug("[VirtualScrolling] Computing visible section",{sections:this.sections});const e=this.containerHeight,t=this.scrollPosition,i=t+e;let n=0,v=0;const r=this.sections.map(s=>(v+=this.headerHeight,{...s,rows:s.rows.reduce((k,z)=>{n=v,v+=z.height;let L=0;return vi&&(L=(n-i)/e),L>this.renderDistance?k:[...k,{...z,distance:L}]},[])})).filter(s=>s.rows.length>0),l=r.flatMap(({rows:s})=>s).flatMap(({items:s})=>s),H=this._rowIdToKeyMap;l.forEach(s=>s.key=H[s.id]);const p=l.map(({key:s})=>s).filter(s=>s!==void 0),w=Object.values(H).filter(s=>!p.includes(s));return l.filter(({key:s})=>s===void 0).forEach(s=>s.key=w.pop()??Math.random().toString(36).substr(2)),this._rowIdToKeyMap=l.reduce((s,{id:k,key:z})=>({...s,[`${k}`]:z}),{}),r},totalHeight(){return this.sections.map(e=>this.headerHeight+e.height).reduce((e,t)=>e+t,0)+0},paddingTop(){if(this.visibleSections.length===0)return 0;let e=0;for(const t of this.sections){if(t.key!==this.visibleSections[0].rows[0].sectionKey){e+=this.headerHeight+t.height;continue}for(const i of t.rows){if(i.key===this.visibleSections[0].rows[0].key)return e;e+=i.height}e+=this.headerHeight}return e},rowsContainerStyle(){return{height:`${this.totalHeight}px`,paddingTop:`${this.paddingTop}px`}},isNearBottom(){const e=this.containerHeight*this.bottomBufferRatio;return this.scrollPosition+this.containerHeight>=this.totalHeight-e},container(){return D.debug("[VirtualScrolling] Computing container"),this.containerElement!==null?this.containerElement:this.useWindow?window:this.$refs.container}},watch:{isNearBottom(e){D.debug("[VirtualScrolling] isNearBottom changed",{value:e}),e&&this.$emit("needContent")},visibleSections(){this.isNearBottom&&this.$emit("needContent")},scrollToKey(e){let t=0;for(const i of this.sections){if(i.key!==e){t+=this.headerHeight+i.height;continue}break}D.debug("[VirtualScrolling] Scrolling to",{currentRowTopDistanceFromTop:t}),this.container.scrollTo({top:t,behavior:"smooth"})}},beforeCreate(){this._rowIdToKeyMap={}},mounted(){this.resizeObserver=new ResizeObserver(e=>{for(const t of e){const i=t.contentRect;t.target===this.container&&(this.containerHeight=i.height),t.target.classList.contains("vs-rows-container")&&(this.rowsContainerHeight=i.height)}}),this.useWindow?(window.addEventListener("resize",this.updateContainerSize,{passive:!0}),this.containerHeight=window.innerHeight):this.resizeObserver.observe(this.container),this.resizeObserver.observe(this.$refs.rowsContainer),this.container.addEventListener("scroll",this.updateScrollPosition,{passive:!0})},beforeUnmount(){this.useWindow&&window.removeEventListener("resize",this.updateContainerSize),this.resizeObserver?.disconnect(),this.container.removeEventListener("scroll",this.updateScrollPosition)},methods:{updateScrollPosition(){this._onScrollHandle??=requestAnimationFrame(()=>{this._onScrollHandle=null,this.useWindow?this.scrollPosition=this.container.scrollY:this.scrollPosition=this.container.scrollTop})},updateContainerSize(){this.containerHeight=window.innerHeight}}}),di={key:0,ref:"container",class:"vs-container"};function ui(e,t,i,n,v,r){return!e.useWindow&&e.containerElement===null?(a(),m("div",di,[C("div",{ref:"rowsContainer",class:"vs-rows-container",style:ee(e.rowsContainerStyle)},[B(e.$slots,"default",{visibleSections:e.visibleSections},void 0,!0),B(e.$slots,"loader",{},void 0,!0)],4)],512)):(a(),m("div",{key:1,ref:"rowsContainer",class:"vs-rows-container",style:ee(e.rowsContainerStyle)},[B(e.$slots,"default",{visibleSections:e.visibleSections},void 0,!0),B(e.$slots,"loader",{},void 0,!0)],4))}const vi=E(ci,[["render",ui],["__scopeId","data-v-0a27da21"]]),mi=` +import{d as j,a as Y}from"./index-JpgrUA2Z-Rp7fa0gf.chunk.mjs";import{a as O,g as te,e as I}from"./index-Bndk0DrU.chunk.mjs";import{t as c,a as P}from"./translation-DoG5ZELJ-Bni_xMHF.chunk.mjs";import{N as oe,u as se}from"./index-Cg5VsXN5.chunk.mjs";import{N as ne}from"./mdi-DXIZZeEd.chunk.mjs";import{f as re}from"./index-sQy2Ug64.chunk.mjs";import{a as E,l as ae,j as le,e as ce}from"./index-xFugdZPW.chunk.mjs";import{k as de,g as J,f as ue}from"./createElementId-DhjFt1I9-CNrdQIoZ.chunk.mjs";import{N as M,P as ve}from"./PencilOutline-a19hsj34.chunk.mjs";import{N as me,_ as pe}from"./NcDateTime.vue_vue_type_script_setup_true_lang-BhB8yA4U-Utjw7yHu.chunk.mjs";import{N as fe}from"./NcAvatar-C9d7Wrc8-pzWde3CT.chunk.mjs";import{D as he,N as ge,s as be}from"./TrayArrowDown-DXqUo7y4.chunk.mjs";import{j as m,o as a,k as C,l as b,t as _,z as Q,b as R,r as A,c as V,w as f,p as h,u as d,g as N,e as S,L as G,x as we,a5 as X,m as B,M as ee,v as ye,Y as _e,F as Ce,C as ke}from"./runtime-dom.esm-bundler-CU8rrbZA.chunk.mjs";import{D as Se,_ as Ve}from"./TrashCanOutline-D95Fx13e.chunk.mjs";import{P as Z}from"./folder-29HuacU_-CwocT1ij.chunk.mjs";import{c as He}from"./index-Conii63U.chunk.mjs";import{g as ze}from"./dav-CMOydKDk.chunk.mjs";import"./NcNoteCard-Cok_4Fld-BI3-Vu_l.chunk.mjs";import"./logger-D3RVzcfQ-B9jnX7-s.chunk.mjs";import"./string_decoder-BO00msnV.chunk.mjs";import"./colors-BHGKZFDI-BMbI6zNx.chunk.mjs";import"./NcUserStatusIcon-XiwrgeCm-CQdLdRFx.chunk.mjs";import"./NcInputField-o5OFv3z6-DW3Gcl3I.chunk.mjs";import"./index-JSJM6V6X.chunk.mjs";const Le={name:"BackupRestoreIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},$e=["aria-hidden","aria-label"],xe=["fill","width","height"],Ae={d:"M12,3A9,9 0 0,0 3,12H0L4,16L8,12H5A7,7 0 0,1 12,5A7,7 0 0,1 19,12A7,7 0 0,1 12,19C10.5,19 9.09,18.5 7.94,17.7L6.5,19.14C8.04,20.3 9.94,21 12,21A9,9 0 0,0 21,12A9,9 0 0,0 12,3M14,12A2,2 0 0,0 12,10A2,2 0 0,0 10,12A2,2 0 0,0 12,14A2,2 0 0,0 14,12Z"},De={key:0};function Ee(e,t,i,n,v,r){return a(),m("span",Q(e.$attrs,{"aria-hidden":i.title?null:"true","aria-label":i.title,class:"material-design-icon backup-restore-icon",role:"img",onClick:t[0]||(t[0]=l=>e.$emit("click",l))}),[(a(),m("svg",{fill:i.fillColor,class:"material-design-icon__svg",width:i.size,height:i.size,viewBox:"0 0 24 24"},[C("path",Ae,[i.title?(a(),m("title",De,_(i.title),1)):b("",!0)])],8,xe))],16,$e)}const Ne=E(Le,[["render",Ee]]),Te={name:"FileCompareIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},Ie=["aria-hidden","aria-label"],Me=["fill","width","height"],Be={d:"M10,18H6V16H10V18M10,14H6V12H10V14M10,1V2H6C4.89,2 4,2.89 4,4V20A2,2 0 0,0 6,22H10V23H12V1H10M20,8V20C20,21.11 19.11,22 18,22H14V20H18V11H14V9H18.5L14,4.5V2L20,8M16,14H14V12H16V14M16,18H14V16H16V18Z"},Oe={key:0};function Pe(e,t,i,n,v,r){return a(),m("span",Q(e.$attrs,{"aria-hidden":i.title?null:"true","aria-label":i.title,class:"material-design-icon file-compare-icon",role:"img",onClick:t[0]||(t[0]=l=>e.$emit("click",l))}),[(a(),m("svg",{fill:i.fillColor,class:"material-design-icon__svg",width:i.size,height:i.size,viewBox:"0 0 24 24"},[C("path",Be,[i.title?(a(),m("title",Oe,_(i.title),1)):b("",!0)])],8,Me))],16,Ie)}const Re=E(Te,[["render",Pe]]),Ue={name:"ImageOffOutlineIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},Fe=["aria-hidden","aria-label"],qe=["fill","width","height"],Ke={d:"M22 20.7L3.3 2L2 3.3L3 4.3V19C3 20.1 3.9 21 5 21H19.7L20.7 22L22 20.7M5 19V6.3L12.6 13.9L11.1 15.8L9 13.1L6 17H15.7L17.7 19H5M8.8 5L6.8 3H19C20.1 3 21 3.9 21 5V17.2L19 15.2V5H8.8"},We={key:0};function je(e,t,i,n,v,r){return a(),m("span",Q(e.$attrs,{"aria-hidden":i.title?null:"true","aria-label":i.title,class:"material-design-icon image-off-outline-icon",role:"img",onClick:t[0]||(t[0]=l=>e.$emit("click",l))}),[(a(),m("svg",{fill:i.fillColor,class:"material-design-icon__svg",width:i.size,height:i.size,viewBox:"0 0 24 24"},[C("path",Ke,[i.title?(a(),m("title",We,_(i.title),1)):b("",!0)])],8,qe))],16,Fe)}const Ye=E(Ue,[["render",je]]),Ze={key:0,class:"version__image"},Je=["src"],Ge={key:2,class:"version__image"},Qe={class:"version__info"},Xe=["title"],ei={key:1,class:"version__info","data-cy-files-version-author-name":""},ii={key:0},ti=["title"],oi={class:"version__info version__info__subline"},si=R({__name:"VersionEntry",props:{version:{},node:{},isCurrent:{type:Boolean},isFirstVersion:{type:Boolean},loadPreview:{type:Boolean},canView:{type:Boolean},canCompare:{type:Boolean}},emits:["click","compare","restore","delete","labelUpdateRequest"],setup(e,{emit:t}){const i=e,n=t,v=A(!1),r=A(!1),l=A(ae("core","capabilities",{files:{version_labeling:!1,version_deletion:!1}})),H=h(()=>re(i.version.size)),p=h(()=>{const y=i.version.label??"";return i.isCurrent?y===""?c("files_versions","Current version"):`${y} (${c("files_versions","Current version")})`:i.isFirstVersion&&y===""?c("files_versions","Initial version"):y}),w=h(()=>!i.version.author||!i.version.authorName?"":i.version.author===O()?.uid?c("files_versions","You"):i.version.authorName??i.version.author),s=h(()=>new Date(i.version.mtime).toLocaleString([P(),P().split("-")[0]],{timeStyle:"long",dateStyle:"long"})),k=h(()=>i.isCurrent?i.node.source:de()+i.version.url),z=h(()=>l.value.files.version_labeling===!0),L=h(()=>l.value.files.version_deletion===!0),F=h(()=>$(i.node,Z.DELETE)),T=h(()=>$(i.node,Z.UPDATE)),q=h(()=>!((i.node.permissions&Z.READ)===0||i.node.attributes["mount-type"]==="shared"&&i.node.attributes["share-attributes"]&&(JSON.parse(i.node.attributes["share-attributes"]).find(y=>y.scope==="permissions"&&y.key==="download")||{})?.value===!1));function K(){n("labelUpdateRequest")}function W(){n("restore",i.version)}async function o(){await G(),await G(),n("delete",i.version)}function u(y){i.canView&&y.preventDefault(),n("click",i.version)}function g(){if(!i.canView)throw new Error("Cannot compare version of this file");n("compare",i.version)}function $(y,x){return(y.permissions&x)!==0}return(y,x)=>(a(),V(d(ge),{class:"version",forceDisplayActions:!0,"actions-aria-label":d(c)("files_versions","Actions for version from {versionHumanExplicitDate}",{versionHumanExplicitDate:s.value}),"data-files-versions-version":e.version.fileVersion,href:k.value,onClick:u},{icon:f(()=>[e.loadPreview||v.value?e.version.previewUrl&&!r.value?(a(),m("img",{key:1,src:e.version.previewUrl,alt:"",decoding:"async",fetchpriority:"low",loading:"lazy",class:"version__image",onLoad:x[0]||(x[0]=ie=>v.value=!0),onError:x[1]||(x[1]=ie=>r.value=!0)},null,40,Je)):(a(),m("div",Ge,[S(Ye,{size:20})])):(a(),m("div",Ze))]),name:f(()=>[C("div",Qe,[p.value?(a(),m("div",{key:0,class:"version__info__label","data-cy-files-version-label":"",title:p.value},_(p.value),9,Xe)):b("",!0),w.value?(a(),m("div",ei,[p.value?(a(),m("span",ii,"•")):b("",!0),S(d(fe),{class:"avatar",user:e.version.author??void 0,size:20,disableMenu:"",disableTooltip:"",hideStatus:""},null,8,["user"]),C("div",{class:"version__info__author_name",title:w.value},_(w.value),9,ti)])):b("",!0)])]),subname:f(()=>[C("div",oi,[S(d(pe),{class:"version__info__date",relativeTime:"short",timestamp:e.version.mtime},null,8,["timestamp"]),x[2]||(x[2]=C("span",null,"•",-1)),C("span",null,_(H.value),1)])]),actions:f(()=>[z.value&&T.value?(a(),V(d(M),{key:0,"data-cy-files-versions-version-action":"label",closeAfterClick:!0,onClick:K},{icon:f(()=>[S(ve,{size:22})]),default:f(()=>[N(" "+_(e.version.label===""?d(c)("files_versions","Name this version"):d(c)("files_versions","Edit version name")),1)]),_:1})):b("",!0),!e.isCurrent&&e.canView&&e.canCompare?(a(),V(d(M),{key:1,"data-cy-files-versions-version-action":"compare",closeAfterClick:!0,onClick:g},{icon:f(()=>[S(Re,{size:22})]),default:f(()=>[N(" "+_(d(c)("files_versions","Compare to current version")),1)]),_:1})):b("",!0),!e.isCurrent&&T.value?(a(),V(d(M),{key:2,"data-cy-files-versions-version-action":"restore",closeAfterClick:!0,onClick:W},{icon:f(()=>[S(Ne,{size:22})]),default:f(()=>[N(" "+_(d(c)("files_versions","Restore version")),1)]),_:1})):b("",!0),q.value?(a(),V(d(me),{key:3,"data-cy-files-versions-version-action":"download",href:k.value,closeAfterClick:!0,download:k.value},{icon:f(()=>[S(he,{size:22})]),default:f(()=>[N(" "+_(d(c)("files_versions","Download version")),1)]),_:1},8,["href","download"])):b("",!0),!e.isCurrent&&L.value&&F.value?(a(),V(d(M),{key:4,"data-cy-files-versions-version-action":"delete",closeAfterClick:!0,onClick:o},{icon:f(()=>[S(Se,{size:22})]),default:f(()=>[N(" "+_(d(c)("files_versions","Delete version")),1)]),_:1})):b("",!0)]),_:1},8,["actions-aria-label","data-files-versions-version","href"]))}}),ni=E(si,[["__scopeId","data-v-037e7d96"]]),ri={class:"version-label-modal__info"},ai=R({__name:"VersionLabelDialog",props:{open:{type:Boolean,default:!1},label:{type:String,default:""}},emits:["update:open","update:label"],setup(e,{emit:t}){const i=e,n=t,v=we("labelInput"),r=A(""),l=h(()=>{const p=[];return i.label.trim()===""?p.push({label:c("files_versions","Cancel")}):p.push({label:c("files_versions","Remove version name"),type:"reset",variant:"error",callback:()=>{H("")}}),[...p,{label:c("files_versions","Save version name"),icon:be,type:"submit",variant:"primary"}]});X(()=>{r.value=i.label??""}),X(()=>{i.open&&G(()=>v.value?.focus()),r.value=i.label});function H(p){n("update:label",p)}return(p,w)=>(a(),V(d(oe),{buttons:l.value,contentClasses:"version-label-modal",isForm:"",open:e.open,size:"normal",name:d(c)("files_versions","Name this version"),"onUpdate:open":w[1]||(w[1]=s=>p.$emit("update:open",s)),onSubmit:w[2]||(w[2]=s=>H(r.value))},{default:f(()=>[S(d(Ve),{ref_key:"labelInput",ref:v,modelValue:r.value,"onUpdate:modelValue":w[0]||(w[0]=s=>r.value=s),class:"version-label-modal__input",label:d(c)("files_versions","Version name"),placeholder:d(c)("files_versions","Version name")},null,8,["modelValue","label","placeholder"]),C("p",ri,_(d(c)("files_versions","Named versions are persisted, and excluded from automatic cleanups when your storage quota is full.")),1)]),_:1},8,["buttons","open","name"]))}}),li=E(ai,[["__scopeId","data-v-0955585b"]]),D=te().setApp("files_version").detectUser().build(),ci=R({name:"VirtualScrolling",props:{sections:{type:Array,required:!0},containerElement:{type:HTMLElement,default:null},useWindow:{type:Boolean,default:!1},headerHeight:{type:Number,default:75},renderDistance:{type:Number,default:.5},bottomBufferRatio:{type:Number,default:2},scrollToKey:{type:String,default:""}},emits:["needContent"],data(){return{scrollPosition:0,containerHeight:0,rowsContainerHeight:0,resizeObserver:null}},computed:{visibleSections(){D.debug("[VirtualScrolling] Computing visible section",{sections:this.sections});const e=this.containerHeight,t=this.scrollPosition,i=t+e;let n=0,v=0;const r=this.sections.map(s=>(v+=this.headerHeight,{...s,rows:s.rows.reduce((k,z)=>{n=v,v+=z.height;let L=0;return vi&&(L=(n-i)/e),L>this.renderDistance?k:[...k,{...z,distance:L}]},[])})).filter(s=>s.rows.length>0),l=r.flatMap(({rows:s})=>s).flatMap(({items:s})=>s),H=this._rowIdToKeyMap;l.forEach(s=>s.key=H[s.id]);const p=l.map(({key:s})=>s).filter(s=>s!==void 0),w=Object.values(H).filter(s=>!p.includes(s));return l.filter(({key:s})=>s===void 0).forEach(s=>s.key=w.pop()??Math.random().toString(36).substr(2)),this._rowIdToKeyMap=l.reduce((s,{id:k,key:z})=>({...s,[`${k}`]:z}),{}),r},totalHeight(){return this.sections.map(e=>this.headerHeight+e.height).reduce((e,t)=>e+t,0)+0},paddingTop(){if(this.visibleSections.length===0)return 0;let e=0;for(const t of this.sections){if(t.key!==this.visibleSections[0].rows[0].sectionKey){e+=this.headerHeight+t.height;continue}for(const i of t.rows){if(i.key===this.visibleSections[0].rows[0].key)return e;e+=i.height}e+=this.headerHeight}return e},rowsContainerStyle(){return{height:`${this.totalHeight}px`,paddingTop:`${this.paddingTop}px`}},isNearBottom(){const e=this.containerHeight*this.bottomBufferRatio;return this.scrollPosition+this.containerHeight>=this.totalHeight-e},container(){return D.debug("[VirtualScrolling] Computing container"),this.containerElement!==null?this.containerElement:this.useWindow?window:this.$refs.container}},watch:{isNearBottom(e){D.debug("[VirtualScrolling] isNearBottom changed",{value:e}),e&&this.$emit("needContent")},visibleSections(){this.isNearBottom&&this.$emit("needContent")},scrollToKey(e){let t=0;for(const i of this.sections){if(i.key!==e){t+=this.headerHeight+i.height;continue}break}D.debug("[VirtualScrolling] Scrolling to",{currentRowTopDistanceFromTop:t}),this.container.scrollTo({top:t,behavior:"smooth"})}},beforeCreate(){this._rowIdToKeyMap={}},mounted(){this.resizeObserver=new ResizeObserver(e=>{for(const t of e){const i=t.contentRect;t.target===this.container&&(this.containerHeight=i.height),t.target.classList.contains("vs-rows-container")&&(this.rowsContainerHeight=i.height)}}),this.useWindow?(window.addEventListener("resize",this.updateContainerSize,{passive:!0}),this.containerHeight=window.innerHeight):this.resizeObserver.observe(this.container),this.resizeObserver.observe(this.$refs.rowsContainer),this.container.addEventListener("scroll",this.updateScrollPosition,{passive:!0})},beforeUnmount(){this.useWindow&&window.removeEventListener("resize",this.updateContainerSize),this.resizeObserver?.disconnect(),this.container.removeEventListener("scroll",this.updateScrollPosition)},methods:{updateScrollPosition(){this._onScrollHandle??=requestAnimationFrame(()=>{this._onScrollHandle=null,this.useWindow?this.scrollPosition=this.container.scrollY:this.scrollPosition=this.container.scrollTop})},updateContainerSize(){this.containerHeight=window.innerHeight}}}),di={key:0,ref:"container",class:"vs-container"};function ui(e,t,i,n,v,r){return!e.useWindow&&e.containerElement===null?(a(),m("div",di,[C("div",{ref:"rowsContainer",class:"vs-rows-container",style:ee(e.rowsContainerStyle)},[B(e.$slots,"default",{visibleSections:e.visibleSections},void 0,!0),B(e.$slots,"loader",{},void 0,!0)],4)],512)):(a(),m("div",{key:1,ref:"rowsContainer",class:"vs-rows-container",style:ee(e.rowsContainerStyle)},[B(e.$slots,"default",{visibleSections:e.visibleSections},void 0,!0),B(e.$slots,"loader",{},void 0,!0)],4))}const vi=E(ci,[["render",ui],["__scopeId","data-v-0a27da21"]]),mi=` `})}async function bi(e){await U.deleteFile(e.filename)}const wi={key:0,class:"versions-tab__container"},yi=["aria-label"],Ki=R({__name:"FilesVersionsSidebarTab",props:{active:{type:Boolean},node:{},folder:{},view:{}},setup(e){const t=e,i=se(),n=A([]),v=A(!1),r=A(!1),l=A(null);ye(_e(()=>t.node),async()=>{if(t.node)try{v.value=!0,n.value=await pi(t.node)}finally{v.value=!1}},{immediate:!0});const H=h(()=>t.node?.mtime?.getTime()??0),p=h(()=>[...n.value].sort((o,u)=>t.node?o.mtime===t.node.mtime?.getTime()?-1:u.mtime===t.node.mtime?.getTime()?1:u.mtime-o.mtime:0)),w=h(()=>[{key:"versions",rows:p.value.map(o=>({key:o.mtime.toString(),height:68,sectionKey:"versions",items:[{id:o.mtime.toString(),version:o}]})),height:68*p.value.length}]),s=h(()=>n.value.map(o=>o.mtime).reduce((o,u)=>Math.min(o,u))),k=h(()=>t.node?window.OCA.Viewer?.mimetypes?.includes(t.node?.mime):!1),z=h(()=>!i.value&&window.OCA.Viewer?.mimetypesCompare?.includes(t.node?.mime));async function L(o){if(!t.node)return;const u=t.node.clone();u.attributes.etag=o.etag,u.size=o.size,u.mtime=new Date(o.mtime);const g={preventDefault:!1,node:u,version:o};if(I("files_versions:restore:requested",g),!g.preventDefault)try{await fi(o),o.label?j(c("files_versions",`${o.label} restored`)):o.mtime===s.value?j(c("files_versions","Initial version restored")):j(c("files_versions","Version restored")),I("files:node:updated",u),I("files_versions:restore:restored",{node:u,version:o})}catch{Y(c("files_versions","Could not restore version")),I("files_versions:restore:failed",o)}}function F(o){r.value=!0,l.value=o}async function T(o){if(l.value===null)throw new Error("editedVersion should be set at that point");const u=l.value.label;l.value.label=o,r.value=!1;try{await gi(l.value,o),l.value=null}catch(g){l.value.label=u,Y(c("files_versions","Could not set version label")),D.error("Could not set version label",{exception:g})}}async function q(o){const u=n.value.indexOf(o);n.value.splice(u,1);try{await bi(o)}catch{n.value.push(o),Y(c("files_versions","Could not delete version"))}}function K(o){if(t.node!==null){if(o.mtime===t.node?.mtime?.getTime()){window.OCA.Viewer.open({path:t.node.path});return}window.OCA.Viewer.open({fileInfo:{...o,filename:o.filename,previewUrl:void 0},enableSidebar:!1})}}function W(o){const u=n.value.map(g=>({...g,previewUrl:void 0}));window.OCA.Viewer.compare({path:t.node.path},u.find(g=>g.source===o.source))}return(o,u)=>e.node?(a(),m("div",wi,[S(vi,{sections:w.value,headerHeight:0},{default:f(({visibleSections:g})=>[C("ul",{"aria-label":d(c)("files_versions","File versions"),"data-files-versions-versions-list":""},[g.length===1?(a(!0),m(Ce,{key:0},ke(g[0].rows,$=>(a(),V(ni,{key:$.items[0].version.mtime,canView:k.value,canCompare:z.value,loadPreview:e.active,version:$.items[0].version,node:e.node,isCurrent:$.items[0].version.mtime===H.value,isFirstVersion:$.items[0].version.mtime===s.value,onClick:K,onCompare:W,onRestore:L,onLabelUpdateRequest:y=>F($.items[0].version),onDelete:q},null,8,["canView","canCompare","loadPreview","version","node","isCurrent","isFirstVersion","onLabelUpdateRequest"]))),128)):b("",!0)],8,yi)]),loader:f(()=>[v.value?(a(),V(d(ne),{key:0,class:"files-list-viewer__loader"})):b("",!0)]),_:1},8,["sections"]),l.value?(a(),V(li,{key:0,open:r.value,"onUpdate:open":u[0]||(u[0]=g=>r.value=g),label:l.value.label,"onUpdate:label":T},null,8,["open","label"])):b("",!0)])):b("",!0)}});export{Ki as default}; -//# sourceMappingURL=FilesVersionsSidebarTab-0wNUfEkv.chunk.mjs.map +//# sourceMappingURL=FilesVersionsSidebarTab-DsT8l27C.chunk.mjs.map diff --git a/dist/FilesVersionsSidebarTab-0wNUfEkv.chunk.mjs.license b/dist/FilesVersionsSidebarTab-DsT8l27C.chunk.mjs.license similarity index 100% rename from dist/FilesVersionsSidebarTab-0wNUfEkv.chunk.mjs.license rename to dist/FilesVersionsSidebarTab-DsT8l27C.chunk.mjs.license diff --git a/dist/FilesVersionsSidebarTab-0wNUfEkv.chunk.mjs.map b/dist/FilesVersionsSidebarTab-DsT8l27C.chunk.mjs.map similarity index 99% rename from dist/FilesVersionsSidebarTab-0wNUfEkv.chunk.mjs.map rename to dist/FilesVersionsSidebarTab-DsT8l27C.chunk.mjs.map index 3896ab6d31295..69d9db0c8e92a 100644 --- a/dist/FilesVersionsSidebarTab-0wNUfEkv.chunk.mjs.map +++ b/dist/FilesVersionsSidebarTab-DsT8l27C.chunk.mjs.map @@ -1 +1 @@ -{"version":3,"file":"FilesVersionsSidebarTab-0wNUfEkv.chunk.mjs","sources":["../node_modules/vue-material-design-icons/BackupRestore.vue","../node_modules/vue-material-design-icons/FileCompare.vue","../node_modules/vue-material-design-icons/ImageOffOutline.vue","../build/frontend/apps/files_versions/src/components/VersionEntry.vue","../build/frontend/apps/files_versions/src/components/VersionLabelDialog.vue","../build/frontend/apps/files_versions/src/utils/logger.ts","../build/frontend/apps/files_versions/src/components/VirtualScrolling.vue","../build/frontend/apps/files_versions/src/utils/davRequest.ts","../build/frontend/apps/files_versions/src/utils/versions.ts","../build/frontend/apps/files_versions/src/views/FilesVersionsSidebarTab.vue"],"sourcesContent":["\n\n","\n\n","\n\n","\n\n\n\n\n\n","\n\n\n\n\n\n","/**\n * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { getLoggerBuilder } from '@nextcloud/logger'\n\nexport default getLoggerBuilder()\n\t.setApp('files_version')\n\t.detectUser()\n\t.build()\n","\n\n\n\n\n\n","/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nexport default `\n\n\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\n`\n","/*!\n * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport type { INode } from '@nextcloud/files'\nimport type { FileStat, ResponseDataDetailed } from 'webdav'\n\nimport { getCurrentUser } from '@nextcloud/auth'\nimport axios from '@nextcloud/axios'\nimport { getClient } from '@nextcloud/files/dav'\nimport { getCanonicalLocale } from '@nextcloud/l10n'\nimport { encodePath, join } from '@nextcloud/paths'\nimport { generateRemoteUrl, generateUrl } from '@nextcloud/router'\nimport davRequest from '../utils/davRequest.ts'\nimport logger from '../utils/logger.ts'\n\nexport interface Version {\n\tfileId: string // The id of the file associated to the version.\n\tlabel: string // 'Current version' or ''\n\tauthor: string | null // UID for the author of the version\n\tauthorName: string | null // Display name of the author\n\tfilename: string // File name relative to the version DAV endpoint\n\tbasename: string // A base name generated from the mtime\n\tmime: string // Empty for the current version, else the actual mime type of the version\n\tetag: string // Empty for the current version, else the actual mime type of the version\n\tsize: number // File size in bytes\n\ttype: string // 'file'\n\tmtime: number // Version creation date as a timestamp\n\tpermissions: string // Only readable: 'R'\n\tpreviewUrl: string // Preview URL of the version\n\turl: string // Download URL of the version\n\tsource: string // The WebDAV endpoint of the resource\n\tfileVersion: string | null // The version id, null for the current version\n}\n\nconst client = getClient()\n\n/**\n * Get file versions for a given node\n *\n * @param node - The node to fetch versions for\n */\nexport async function fetchVersions(node: INode): Promise {\n\tconst path = `/versions/${getCurrentUser()?.uid}/versions/${node.fileid}`\n\n\ttry {\n\t\tconst response = await client.getDirectoryContents(path, {\n\t\t\tdata: davRequest,\n\t\t\tdetails: true,\n\t\t}) as ResponseDataDetailed\n\n\t\tconst versions = response.data\n\t\t\t// Filter out root\n\t\t\t.filter(({ mime }) => mime !== '')\n\t\t\t.map((version) => formatVersion(version as Required, node))\n\n\t\tconst authorIds = new Set(versions.map((version) => String(version.author)))\n\t\tconst authors = await axios.post(generateUrl('/displaynames'), { users: [...authorIds] })\n\n\t\tfor (const version of versions) {\n\t\t\tconst author = authors.data.users[version.author ?? '']\n\t\t\tif (author) {\n\t\t\t\tversion.authorName = author\n\t\t\t}\n\t\t}\n\n\t\treturn versions\n\t} catch (exception) {\n\t\tlogger.error('Could not fetch version', { exception })\n\t\tthrow exception\n\t}\n}\n\n/**\n * Restore the given version\n *\n * @param version - The version to restore\n */\nexport async function restoreVersion(version: Version) {\n\ttry {\n\t\tlogger.debug('Restoring version', { url: version.url })\n\t\tawait client.moveFile(\n\t\t\t`/versions/${getCurrentUser()?.uid}/versions/${version.fileId}/${version.fileVersion}`,\n\t\t\t`/versions/${getCurrentUser()?.uid}/restore/target`,\n\t\t)\n\t} catch (exception) {\n\t\tlogger.error('Could not restore version', { exception })\n\t\tthrow exception\n\t}\n}\n\n/**\n * Format version\n *\n * @param version - The version data from WebDAV\n * @param node - The original node\n */\nfunction formatVersion(version: Required, node: INode): Version {\n\tconst mtime = Date.parse(version.lastmod)\n\tlet previewUrl = ''\n\n\tif (mtime === node.mtime?.getTime()) { // Version is the current one\n\t\tpreviewUrl = generateUrl('/core/preview?fileId={fileId}&c={fileEtag}&x=250&y=250&forceIcon=0&a=0&forceIcon=1&mimeFallback=1', {\n\t\t\tfileId: node.fileid,\n\t\t\tfileEtag: node.attributes.etag,\n\t\t})\n\t} else {\n\t\tpreviewUrl = generateUrl('/apps/files_versions/preview?file={file}&version={fileVersion}&mimeFallback=1', {\n\t\t\tfile: node.path,\n\t\t\tfileVersion: version.basename,\n\t\t})\n\t}\n\n\treturn {\n\t\tfileId: node.fileid!.toString(),\n\t\t// If version-label is defined make sure it is a string (prevent issue if the label is a number an PHP returns a number then)\n\t\tlabel: version.props['version-label'] ? String(version.props['version-label']) : '',\n\t\tauthor: version.props['version-author'] ? String(version.props['version-author']) : null,\n\t\tauthorName: null,\n\t\tfilename: version.filename,\n\t\tbasename: new Date(mtime).toLocaleString(\n\t\t\t[getCanonicalLocale(), getCanonicalLocale().split('-')[0]!],\n\t\t\t{\n\t\t\t\ttimeStyle: 'long',\n\t\t\t\tdateStyle: 'medium',\n\t\t\t},\n\t\t),\n\t\tmime: version.mime,\n\t\tetag: `${version.props.getetag}`,\n\t\tsize: version.size,\n\t\ttype: version.type,\n\t\tmtime,\n\t\tpermissions: 'R',\n\t\tpreviewUrl,\n\t\turl: join('/remote.php/dav', version.filename),\n\t\tsource: generateRemoteUrl('dav') + encodePath(version.filename),\n\t\tfileVersion: version.basename,\n\t}\n}\n\n/**\n * Set version label\n *\n * @param version - The version to set the label for\n * @param newLabel - The new label\n */\nexport async function setVersionLabel(version: Version, newLabel: string) {\n\treturn await client.customRequest(\n\t\tversion.filename,\n\t\t{\n\t\t\tmethod: 'PROPPATCH',\n\t\t\tdata: `\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t${newLabel}\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t`,\n\t\t},\n\t)\n}\n\n/**\n * Delete version\n *\n * @param version - The version to delete\n */\nexport async function deleteVersion(version: Version) {\n\tawait client.deleteFile(version.filename)\n}\n","\n\n\n\n\n\n"],"names":["_sfc_main","_hoisted_3","_createElementBlock","_mergeProps","_ctx","$props","_cache","$event","_createElementVNode","_openBlock","props","__props","emit","__emit","previewLoaded","ref","previewErrored","capabilities","loadState","humanReadableSize","computed","formatFileSize","versionLabel","label","t","versionAuthor","getCurrentUser","versionHumanExplicitDate","getCanonicalLocale","downloadURL","getRootUrl","enableLabeling","enableDeletion","hasDeletePermissions","hasPermission","Permission","hasUpdatePermissions","isDownloadable","attribute","labelUpdate","restoreVersion","deleteVersion","nextTick","click","event","compareVersion","node","permission","_createBlock","_unref","NcListItem","_createVNode","ImageOffOutline","_hoisted_1","_hoisted_4","_hoisted_5","_hoisted_6","NcAvatar","_hoisted_8","_hoisted_9","NcDateTime","NcActionButton","Pencil","_createTextVNode","FileCompare","BackupRestore","NcActionLink","Download","Delete","labelInput","useTemplateRef","internalLabel","dialogButtons","buttons","setVersionLabel","svgCheck","watchEffect","NcDialog","$emit","NcTextField","_toDisplayString","logger","getLoggerBuilder","_sfc_main$1","defineComponent","containerHeight","containerTop","containerBottom","currentRowTop","currentRowBottom","visibleSections","section","visibleRows","row","distance","visibleItems","rows","items","rowIdToKeyMap","item","usedTokens","key","unusedTokens","finalMapping","id","totalHeight","sectionHeight","paddingTop","buffer","value","currentRowTopDistanceFromTop","entries","entry","cr","_normalizeStyle","_renderSlot","davRequest","client","getClient","fetchVersions","path","versions","mime","version","formatVersion","authorIds","authors","axios","generateUrl","author","exception","mtime","previewUrl","join","generateRemoteUrl","encodePath","newLabel","isMobile","useIsMobile","loading","showVersionLabelForm","editedVersion","watch","toRef","currentVersionMtime","orderedVersions","a","b","sections","initialVersionMtime","canView","canCompare","handleRestore","restoredNode","restoreStartedEventState","showSuccess","showError","handleLabelUpdateRequest","handleLabelUpdate","oldLabel","handleDelete","index","openVersion","_versions","v","VirtualScrolling","_withCtx","_Fragment","_renderList","VersionEntry","NcLoadingIcon","VersionLabelDialog"],"mappings":"6hDAoBA,MAAKA,GAAU,CACb,KAAM,oBACN,MAAO,CAAC,OAAO,EACf,MAAO,CACL,MAAO,CACL,KAAM,QAER,UAAW,CACT,KAAM,OACN,QAAS,gBAEX,KAAM,CACJ,KAAM,OACN,QAAS,EACX,CACF,CACF,+DAxBYC,GAAA,CAAA,EAAE,uPAAuP,iDAXnQC,EAeO,OAfPC,EAAcC,EAAA,OAAM,CACb,cAAaC,EAAA,MAAK,KAAA,OAClB,aAAYA,EAAA,MACb,MAAM,2CACN,KAAK,MACJ,QAAKC,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAC,GAAEH,EAAA,MAAK,QAAUG,CAAM,WACjCL,EAQM,MAAA,CARA,KAAMG,EAAA,UACP,MAAM,4BACL,MAAOA,EAAA,KACP,OAAQA,EAAA,KAC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AAA,EAAC,iBAAA,eAAA,EAAqC,oCAAA,EAAA,GACtCkE,EAAgB,SAAM,GACrCjF,EAAA,EAAA,EAAAP,EAc0BqK,GAAA,CAAA,IAAA,CAAA,EAAAC,GAbT9E,EAAe,CAAA,EAAI,KAA3BG,QADT7C,EAc0ByH,GAAA,CAZxB,IAAK5E,EAAI,MAAK,CAAA,EAAI,QAAQ,MAC1B,QAASyD,EAAA,MACT,WAAYC,EAAA,MACZ,YAAa5I,EAAA,OACb,QAASkF,EAAI,SAAS,QACtB,KAAMlF,EAAA,KACN,UAAWkF,EAAI,SAAS,QAAQ,QAAUmD,EAAA,MAC1C,eAAgBnD,EAAI,SAAS,QAAQ,QAAUwD,EAAA,MAC/C,QAAOa,EACP,UAASrH,EACT,UAAS2G,EACT,wBAAoBK,EAAyBhE,EAAI,SAAS,OAAO,EACjE,SAAQmE,CAAA,gJAIF,SACV,IAAkE,CAA7CrB,EAAA,WAArB3F,EAAkEC,EAAAyH,EAAA,EAAA,OAApC,MAAM,2BAAA,oCAI/B7B,EAAA,WADP7F,EAIqC2H,GAAA,OAF5B,KAAM/B,EAAA,qCAAAA,EAAoB,MAAArI,GACjC,MAAOsI,EAAA,MAAc,MACrB,iBAAciB,CAAA","x_google_ignoreList":[0,1,2]} \ No newline at end of file +{"version":3,"file":"FilesVersionsSidebarTab-DsT8l27C.chunk.mjs","sources":["../node_modules/vue-material-design-icons/BackupRestore.vue","../node_modules/vue-material-design-icons/FileCompare.vue","../node_modules/vue-material-design-icons/ImageOffOutline.vue","../build/frontend/apps/files_versions/src/components/VersionEntry.vue","../build/frontend/apps/files_versions/src/components/VersionLabelDialog.vue","../build/frontend/apps/files_versions/src/utils/logger.ts","../build/frontend/apps/files_versions/src/components/VirtualScrolling.vue","../build/frontend/apps/files_versions/src/utils/davRequest.ts","../build/frontend/apps/files_versions/src/utils/versions.ts","../build/frontend/apps/files_versions/src/views/FilesVersionsSidebarTab.vue"],"sourcesContent":["\n\n","\n\n","\n\n","\n\n\n\n\n\n","\n\n\n\n\n\n","/**\n * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { getLoggerBuilder } from '@nextcloud/logger'\n\nexport default getLoggerBuilder()\n\t.setApp('files_version')\n\t.detectUser()\n\t.build()\n","\n\n\n\n\n\n","/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nexport default `\n\n\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\n`\n","/*!\n * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport type { INode } from '@nextcloud/files'\nimport type { FileStat, ResponseDataDetailed } from 'webdav'\n\nimport { getCurrentUser } from '@nextcloud/auth'\nimport axios from '@nextcloud/axios'\nimport { getClient } from '@nextcloud/files/dav'\nimport { getCanonicalLocale } from '@nextcloud/l10n'\nimport { encodePath, join } from '@nextcloud/paths'\nimport { generateRemoteUrl, generateUrl } from '@nextcloud/router'\nimport davRequest from '../utils/davRequest.ts'\nimport logger from '../utils/logger.ts'\n\nexport interface Version {\n\tfileId: string // The id of the file associated to the version.\n\tlabel: string // 'Current version' or ''\n\tauthor: string | null // UID for the author of the version\n\tauthorName: string | null // Display name of the author\n\tfilename: string // File name relative to the version DAV endpoint\n\tbasename: string // A base name generated from the mtime\n\tmime: string // Empty for the current version, else the actual mime type of the version\n\tetag: string // Empty for the current version, else the actual mime type of the version\n\tsize: number // File size in bytes\n\ttype: string // 'file'\n\tmtime: number // Version creation date as a timestamp\n\tpermissions: string // Only readable: 'R'\n\tpreviewUrl: string // Preview URL of the version\n\turl: string // Download URL of the version\n\tsource: string // The WebDAV endpoint of the resource\n\tfileVersion: string | null // The version id, null for the current version\n}\n\nconst client = getClient()\n\n/**\n * Get file versions for a given node\n *\n * @param node - The node to fetch versions for\n */\nexport async function fetchVersions(node: INode): Promise {\n\tconst path = `/versions/${getCurrentUser()?.uid}/versions/${node.fileid}`\n\n\ttry {\n\t\tconst response = await client.getDirectoryContents(path, {\n\t\t\tdata: davRequest,\n\t\t\tdetails: true,\n\t\t}) as ResponseDataDetailed\n\n\t\tconst versions = response.data\n\t\t\t// Filter out root\n\t\t\t.filter(({ mime }) => mime !== '')\n\t\t\t.map((version) => formatVersion(version as Required, node))\n\n\t\tconst authorIds = new Set(versions.map((version) => String(version.author)))\n\t\tconst authors = await axios.post(generateUrl('/displaynames'), { users: [...authorIds] })\n\n\t\tfor (const version of versions) {\n\t\t\tconst author = authors.data.users[version.author ?? '']\n\t\t\tif (author) {\n\t\t\t\tversion.authorName = author\n\t\t\t}\n\t\t}\n\n\t\treturn versions\n\t} catch (exception) {\n\t\tlogger.error('Could not fetch version', { exception })\n\t\tthrow exception\n\t}\n}\n\n/**\n * Restore the given version\n *\n * @param version - The version to restore\n */\nexport async function restoreVersion(version: Version) {\n\ttry {\n\t\tlogger.debug('Restoring version', { url: version.url })\n\t\tawait client.moveFile(\n\t\t\t`/versions/${getCurrentUser()?.uid}/versions/${version.fileId}/${version.fileVersion}`,\n\t\t\t`/versions/${getCurrentUser()?.uid}/restore/target`,\n\t\t)\n\t} catch (exception) {\n\t\tlogger.error('Could not restore version', { exception })\n\t\tthrow exception\n\t}\n}\n\n/**\n * Format version\n *\n * @param version - The version data from WebDAV\n * @param node - The original node\n */\nfunction formatVersion(version: Required, node: INode): Version {\n\tconst mtime = Date.parse(version.lastmod)\n\tlet previewUrl = ''\n\n\tif (mtime === node.mtime?.getTime()) { // Version is the current one\n\t\tpreviewUrl = generateUrl('/core/preview?fileId={fileId}&c={fileEtag}&x=250&y=250&forceIcon=0&a=0&forceIcon=1&mimeFallback=1', {\n\t\t\tfileId: node.fileid,\n\t\t\tfileEtag: node.attributes.etag,\n\t\t})\n\t} else {\n\t\tpreviewUrl = generateUrl('/apps/files_versions/preview?file={file}&version={fileVersion}&mimeFallback=1', {\n\t\t\tfile: node.path,\n\t\t\tfileVersion: version.basename,\n\t\t})\n\t}\n\n\treturn {\n\t\tfileId: node.fileid!.toString(),\n\t\t// If version-label is defined make sure it is a string (prevent issue if the label is a number an PHP returns a number then)\n\t\tlabel: version.props['version-label'] ? String(version.props['version-label']) : '',\n\t\tauthor: version.props['version-author'] ? String(version.props['version-author']) : null,\n\t\tauthorName: null,\n\t\tfilename: version.filename,\n\t\tbasename: new Date(mtime).toLocaleString(\n\t\t\t[getCanonicalLocale(), getCanonicalLocale().split('-')[0]!],\n\t\t\t{\n\t\t\t\ttimeStyle: 'long',\n\t\t\t\tdateStyle: 'medium',\n\t\t\t},\n\t\t),\n\t\tmime: version.mime,\n\t\tetag: `${version.props.getetag}`,\n\t\tsize: version.size,\n\t\ttype: version.type,\n\t\tmtime,\n\t\tpermissions: 'R',\n\t\tpreviewUrl,\n\t\turl: join('/remote.php/dav', version.filename),\n\t\tsource: generateRemoteUrl('dav') + encodePath(version.filename),\n\t\tfileVersion: version.basename,\n\t}\n}\n\n/**\n * Set version label\n *\n * @param version - The version to set the label for\n * @param newLabel - The new label\n */\nexport async function setVersionLabel(version: Version, newLabel: string) {\n\treturn await client.customRequest(\n\t\tversion.filename,\n\t\t{\n\t\t\tmethod: 'PROPPATCH',\n\t\t\tdata: `\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t${newLabel}\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t`,\n\t\t},\n\t)\n}\n\n/**\n * Delete version\n *\n * @param version - The version to delete\n */\nexport async function deleteVersion(version: Version) {\n\tawait client.deleteFile(version.filename)\n}\n","\n\n\n\n\n\n"],"names":["_sfc_main","_hoisted_3","_createElementBlock","_mergeProps","_ctx","$props","_cache","$event","_createElementVNode","_openBlock","props","__props","emit","__emit","previewLoaded","ref","previewErrored","capabilities","loadState","humanReadableSize","computed","formatFileSize","versionLabel","label","t","versionAuthor","getCurrentUser","versionHumanExplicitDate","getCanonicalLocale","downloadURL","getRootUrl","enableLabeling","enableDeletion","hasDeletePermissions","hasPermission","Permission","hasUpdatePermissions","isDownloadable","attribute","labelUpdate","restoreVersion","deleteVersion","nextTick","click","event","compareVersion","node","permission","_createBlock","_unref","NcListItem","_createVNode","ImageOffOutline","_hoisted_1","_hoisted_4","_hoisted_5","_hoisted_6","NcAvatar","_hoisted_8","_hoisted_9","NcDateTime","NcActionButton","Pencil","_createTextVNode","FileCompare","BackupRestore","NcActionLink","Download","Delete","labelInput","useTemplateRef","internalLabel","dialogButtons","buttons","setVersionLabel","svgCheck","watchEffect","NcDialog","$emit","NcTextField","_toDisplayString","logger","getLoggerBuilder","_sfc_main$1","defineComponent","containerHeight","containerTop","containerBottom","currentRowTop","currentRowBottom","visibleSections","section","visibleRows","row","distance","visibleItems","rows","items","rowIdToKeyMap","item","usedTokens","key","unusedTokens","finalMapping","id","totalHeight","sectionHeight","paddingTop","buffer","value","currentRowTopDistanceFromTop","entries","entry","cr","_normalizeStyle","_renderSlot","davRequest","client","getClient","fetchVersions","path","versions","mime","version","formatVersion","authorIds","authors","axios","generateUrl","author","exception","mtime","previewUrl","join","generateRemoteUrl","encodePath","newLabel","isMobile","useIsMobile","loading","showVersionLabelForm","editedVersion","watch","toRef","currentVersionMtime","orderedVersions","a","b","sections","initialVersionMtime","canView","canCompare","handleRestore","restoredNode","restoreStartedEventState","showSuccess","showError","handleLabelUpdateRequest","handleLabelUpdate","oldLabel","handleDelete","index","openVersion","_versions","v","VirtualScrolling","_withCtx","_Fragment","_renderList","VersionEntry","NcLoadingIcon","VersionLabelDialog"],"mappings":"6hDAoBA,MAAKA,GAAU,CACb,KAAM,oBACN,MAAO,CAAC,OAAO,EACf,MAAO,CACL,MAAO,CACL,KAAM,QAER,UAAW,CACT,KAAM,OACN,QAAS,gBAEX,KAAM,CACJ,KAAM,OACN,QAAS,EACX,CACF,CACF,+DAxBYC,GAAA,CAAA,EA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IAAA,EACpByJ,EAAU,KAAMC,GAAMA,EAAE,SAAWzC,EAAQ,MAAM,CAAA,CAEnD,cA1QYhH,EAAA,MAAXF,EAAA,EAAAP,EAkCM,MAlCNmD,GAkCM,CAjCLF,EA2BmBkH,GAAA,CA1BjB,SAAUjB,EAAA,MACV,aAAc,CAAA,GACJ,QAAOkB,EACjB,CAkBK,CAnBgB,gBAAA5E,KAAe,CACpClF,EAkBK,KAAA,CAlBA,aAAYyC,EAAAzB,CAAA,EAAC,iBAAA,eAAA,EAAqC,oCAAA,EAAA,GACtCkE,EAAgB,SAAM,GACrCjF,EAAA,EAAA,EAAAP,EAc0BqK,GAAA,CAAA,IAAA,CAAA,EAAAC,GAbT9E,EAAe,CAAA,EAAI,KAA3BG,QADT7C,EAc0ByH,GAAA,CAZxB,IAAK5E,EAAI,MAAK,CAAA,EAAI,QAAQ,MAC1B,QAASyD,EAAA,MACT,WAAYC,EAAA,MACZ,YAAa5I,EAAA,OACb,QAASkF,EAAI,SAAS,QACtB,KAAMlF,EAAA,KACN,UAAWkF,EAAI,SAAS,QAAQ,QAAUmD,EAAA,MAC1C,eAAgBnD,EAAI,SAAS,QAAQ,QAAUwD,EAAA,MAC/C,QAAOa,EACP,UAASrH,EACT,UAAS2G,EACT,wBAAoBK,EAAyBhE,EAAI,SAAS,OAAO,EACjE,SAAQmE,CAAA,gJAIF,SACV,IAAkE,CAA7CrB,EAAA,WAArB3F,EAAkEC,EAAAyH,EAAA,EAAA,OAApC,MAAM,2BAAA,oCAI/B7B,EAAA,WADP7F,EAIqC2H,GAAA,OAF5B,KAAM/B,EAAA,qCAAAA,EAAoB,MAAArI,GACjC,MAAOsI,EAAA,MAAc,MACrB,iBAAciB,CAAA","x_google_ignoreList":[0,1,2]} \ No newline at end of file diff --git a/dist/FilesVersionsSidebarTab-0wNUfEkv.chunk.mjs.map.license b/dist/FilesVersionsSidebarTab-DsT8l27C.chunk.mjs.map.license similarity index 100% rename from dist/FilesVersionsSidebarTab-0wNUfEkv.chunk.mjs.map.license rename to dist/FilesVersionsSidebarTab-DsT8l27C.chunk.mjs.map.license diff --git a/dist/SystemTagPicker-DZ1dvV0F.chunk.mjs b/dist/SystemTagPicker-CxL9oUpy.chunk.mjs similarity index 97% rename from dist/SystemTagPicker-DZ1dvV0F.chunk.mjs rename to dist/SystemTagPicker-CxL9oUpy.chunk.mjs index 3886154a7cc83..01ebbf23ace11 100644 --- a/dist/SystemTagPicker-DZ1dvV0F.chunk.mjs +++ b/dist/SystemTagPicker-CxL9oUpy.chunk.mjs @@ -1,2 +1,2 @@ -import{e as E,d as q,a as J}from"./index-Bndk0DrU.chunk.mjs";import{a as _}from"./index-JpgrUA2Z-Rp7fa0gf.chunk.mjs";import{a as A,l as K}from"./index-xFugdZPW.chunk.mjs";import{t as y,g as S,e as Q,p as W,b as k}from"./translation-DoG5ZELJ-Bni_xMHF.chunk.mjs";import{N as X}from"./logger-D3RVzcfQ-B9jnX7-s.chunk.mjs";import{N as Y}from"./NcCheckboxRadioSwitch-BMsPx74L-CaXJJ1WR.chunk.mjs";import{N as tt}from"./NcChip-B71t2Ny2-DeGKCj7f.chunk.mjs";import{N as et}from"./NcColorPicker-DDHxR-iN-Dglc-YtF.chunk.mjs";import{N as st}from"./index-Cg5VsXN5.chunk.mjs";import{P as at,N as it}from"./Plus-DQFE3py0.chunk.mjs";import{N as ot}from"./mdi-DXIZZeEd.chunk.mjs";import{N as lt}from"./NcNoteCard-Cok_4Fld-BI3-Vu_l.chunk.mjs";import{_ as nt}from"./TrashCanOutline-D95Fx13e.chunk.mjs";import{j as d,o as a,k as g,l as C,t as p,z as w,b as rt,f as c,c as h,w as m,E as ct,F as R,e as u,C as dt,M as mt,g as N,G as gt,n as ht}from"./runtime-dom.esm-bundler-CU8rrbZA.chunk.mjs";import{P as pt}from"./PencilOutline-a19hsj34.chunk.mjs";import{l as L,g as O,s as z,e as I,h as x,c as ut,i as ft,f as yt,u as Ct}from"./api-DlsqY5DV.chunk.mjs";import{e as bt,i as kt,a as Nt}from"./systemtags-init.mjs";import"./createElementId-DhjFt1I9-CNrdQIoZ.chunk.mjs";import"./colors-BHGKZFDI-BMbI6zNx.chunk.mjs";import"./NcInputField-o5OFv3z6-DW3Gcl3I.chunk.mjs";import"./index-Conii63U.chunk.mjs";import"./string_decoder-BO00msnV.chunk.mjs";import"./index-DjsbsIll.chunk.mjs";import"./NcPasswordField-uaMO2pdt-D3pIyOm0.chunk.mjs";import"./dav-CufFHsl4.chunk.mjs";import"./index-JSJM6V6X.chunk.mjs";import"./folder-D9CBQngR-CuPN_AFd.chunk.mjs";import"./index-DNfSxz5H.chunk.mjs";const At={name:"CheckCircleIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},vt=["aria-hidden","aria-label"],wt=["fill","width","height"],Tt={d:"M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M10 17L5 12L6.41 10.59L10 14.17L17.59 6.58L19 8L10 17Z"},_t={key:0};function St(t,s,e,o,l,n){return a(),d("span",w(t.$attrs,{"aria-hidden":e.title?null:"true","aria-label":e.title,class:"material-design-icon check-circle-icon",role:"img",onClick:s[0]||(s[0]=i=>t.$emit("click",i))}),[(a(),d("svg",{fill:e.fillColor,class:"material-design-icon__svg",width:e.size,height:e.size,viewBox:"0 0 24 24"},[g("path",Tt,[e.title?(a(),d("title",_t,p(e.title),1)):C("",!0)])],8,wt))],16,vt)}const Lt=A(At,[["render",St]]),It={name:"CircleIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},$t=["aria-hidden","aria-label"],Et=["fill","width","height"],Rt={d:"M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z"},Ot={key:0};function zt(t,s,e,o,l,n){return a(),d("span",w(t.$attrs,{"aria-hidden":e.title?null:"true","aria-label":e.title,class:"material-design-icon circle-icon",role:"img",onClick:s[0]||(s[0]=i=>t.$emit("click",i))}),[(a(),d("svg",{fill:e.fillColor,class:"material-design-icon__svg",width:e.size,height:e.size,viewBox:"0 0 24 24"},[g("path",Rt,[e.title?(a(),d("title",Ot,p(e.title),1)):C("",!0)])],8,Et))],16,$t)}const xt=A(It,[["render",zt]]),Pt={name:"CircleOutlineIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},Mt=["aria-hidden","aria-label"],Vt=["fill","width","height"],Bt={d:"M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z"},Ut={key:0};function Gt(t,s,e,o,l,n){return a(),d("span",w(t.$attrs,{"aria-hidden":e.title?null:"true","aria-label":e.title,class:"material-design-icon circle-outline-icon",role:"img",onClick:s[0]||(s[0]=i=>t.$emit("click",i))}),[(a(),d("svg",{fill:e.fillColor,class:"material-design-icon__svg",width:e.size,height:e.size,viewBox:"0 0 24 24"},[g("path",Bt,[e.title?(a(),d("title",Ut,p(e.title),1)):C("",!0)])],8,Vt))],16,Mt)}const Dt=A(Pt,[["render",Gt]]),jt={name:"TagOutlineIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},Ft=["aria-hidden","aria-label"],Ht=["fill","width","height"],Zt={d:"M21.41 11.58L12.41 2.58A2 2 0 0 0 11 2H4A2 2 0 0 0 2 4V11A2 2 0 0 0 2.59 12.42L11.59 21.42A2 2 0 0 0 13 22A2 2 0 0 0 14.41 21.41L21.41 14.41A2 2 0 0 0 22 13A2 2 0 0 0 21.41 11.58M13 20L4 11V4H11L20 13M6.5 5A1.5 1.5 0 1 1 5 6.5A1.5 1.5 0 0 1 6.5 5Z"},qt={key:0};function Jt(t,s,e,o,l,n){return a(),d("span",w(t.$attrs,{"aria-hidden":e.title?null:"true","aria-label":e.title,class:"material-design-icon tag-outline-icon",role:"img",onClick:s[0]||(s[0]=i=>t.$emit("click",i))}),[(a(),d("svg",{fill:e.fillColor,class:"material-design-icon__svg",width:e.size,height:e.size,viewBox:"0 0 24 24"},[g("path",Zt,[e.title?(a(),d("title",qt,p(e.title),1)):C("",!0)])],8,Ht))],16,Ft)}const Kt=A(jt,[["render",Jt]]),Qt=q(Ct,500),Wt=getComputedStyle(document.body).getPropertyValue("--color-main-background").replace("#","")||(Nt()?"000000":"ffffff");var P=(t=>(t.BASE="base",t.LOADING="loading",t.CREATING_TAG="creating-tag",t.DONE="done",t))(P||{});const Xt=K("systemtags","restrictSystemTagsCreationToAdmin",!1),Yt=rt({name:"SystemTagPicker",components:{CheckIcon:Lt,CircleIcon:xt,CircleOutlineIcon:Dt,NcButton:X,NcCheckboxRadioSwitch:Y,NcChip:tt,NcColorPicker:et,NcDialog:st,NcEmptyContent:it,NcLoadingIcon:ot,NcNoteCard:lt,NcTextField:nt,PencilIcon:pt,PlusIcon:at,TagIcon:Kt},props:{nodes:{type:Array,required:!0}},emits:{close(t){return t===null||typeof t=="boolean"}},setup(){return{emit:E,Status:P,t:y,canEditOrCreateTag:!Xt||J()?.isAdmin}},data(){return{status:"base",opened:!0,openedPicker:!1,input:"",tags:[],tagList:{},toAdd:[],toRemove:[]}},computed:{sortedTags(){return[...this.tags].sort((t,s)=>t.displayName.localeCompare(s.displayName,S(),{ignorePunctuation:!0}))},filteredTags(){return this.input.trim()===""?this.sortedTags:this.sortedTags.filter(t=>t.displayName.normalize().toLowerCase().includes(this.input.normalize().toLowerCase()))},hasChanges(){return this.toAdd.length>0||this.toRemove.length>0},canCreateTag(){return this.input.trim()!==""&&!this.tags.some(t=>t.displayName.trim().toLocaleLowerCase()===this.input.trim().toLocaleLowerCase())},statusMessage(){if(this.toAdd.length===0&&this.toRemove.length===0)return"";if(this.toAdd.length===1&&this.toRemove.length===1)return k("systemtags","{tag1} will be set and {tag2} will be removed from 1 file.","{tag1} will be set and {tag2} will be removed from {count} files.",this.nodes.length,{tag1:this.formatTagChip(this.toAdd[0]),tag2:this.formatTagChip(this.toRemove[0]),count:this.nodes.length},{escape:!1});const t=this.toAdd.map(this.formatTagChip),s=t.pop(),e=this.toRemove.map(this.formatTagChip),o=e.pop(),l=k("systemtags","{tag} will be set to 1 file.","{tag} will be set to {count} files.",this.nodes.length,{tag:s,count:this.nodes.length},{escape:!1}),n=k("systemtags","{tag} will be removed from 1 file.","{tag} will be removed from {count} files.",this.nodes.length,{tag:o,count:this.nodes.length},{escape:!1}),i=k("systemtags","{tags} and {lastTag} will be set to 1 file.","{tags} and {lastTag} will be set to {count} files.",this.nodes.length,{tags:t.join(", "),lastTag:s,count:this.nodes.length},{escape:!1}),f=k("systemtags","{tags} and {lastTag} will be removed from 1 file.","{tags} and {lastTag} will be removed from {count} files.",this.nodes.length,{tags:e.join(", "),lastTag:o,count:this.nodes.length},{escape:!1});return this.toAdd.length===1&&this.toRemove.length===0?l:this.toAdd.length===0&&this.toRemove.length===1?n:this.toAdd.length>1&&this.toRemove.length===0?i:this.toAdd.length===0&&this.toRemove.length>1?f:this.toAdd.length>1&&this.toRemove.length===1?`${i} ${n}`:this.toAdd.length===1&&this.toRemove.length>1?`${l} ${f}`:`${i} ${f}`}},beforeMount(){yt().then(t=>{this.tags=t}),this.tagList=this.nodes.reduce((t,s)=>((I(s)||[]).forEach(e=>{t[e]=(t[e]||0)+1}),t),{}),this.canEditOrCreateTag||L.debug("System tag creation is restricted to admins and the current user is not an admin")},methods:{formatTagChip(t){const s=this.$refs.chip.$el.cloneNode(!0);if(t.color){const e=this.tagListStyle(t);Object.entries(e).forEach(([o,l])=>{s.style.setProperty(o,l)})}return s.outerHTML.replace("%s",Q(W.sanitize(t.displayName)))},formatTagName(t){return t.userVisible?t.userAssignable?t.displayName:y("systemtags","{displayName} (restricted)",{displayName:t.displayName}):y("systemtags","{displayName} (hidden)",{displayName:t.displayName})},onColorChange(t,s){t.color=s.replace("#",""),Qt(t)},isChecked(t){return t.displayName in this.tagList&&this.tagList[t.displayName]===this.nodes.length},isIndeterminate(t){return t.displayName in this.tagList&&this.tagList[t.displayName]!==0&&this.tagList[t.displayName]!==this.nodes.length},onCheckUpdate(t,s){s?(this.toAdd.push(t),this.toRemove=this.toRemove.filter(e=>e.id!==t.id),this.tagList[t.displayName]=this.nodes.length):(this.toRemove.push(t),this.toAdd=this.toAdd.filter(e=>e.id!==t.id),this.tagList[t.displayName]=0)},async onNewTag(){if(!this.canEditOrCreateTag){_(y("systemtags","Only admins can create new tags"));return}this.status="creating-tag";try{const t={displayName:this.input.trim(),userAssignable:!0,userVisible:!0,canAssign:!0},s=await ut(t),e=await ft(s);this.tags.push(e),this.input="",this.onCheckUpdate(e,!0),await this.$nextTick(),Array.isArray(this.$refs.tags)&&this.$refs.tags.find(o=>o.dataset.cySystemtagsPickerTag===s.toString())?.scrollIntoView({behavior:"instant",block:"center",inline:"center"})}catch(t){_(t?.message||y("systemtags","Failed to create tag"))}finally{this.status="base"}},async onSubmit(){this.status="loading",L.debug("Applying tags",{toAdd:this.toAdd,toRemove:this.toRemove});try{for(const s of this.toAdd){const{etag:e,objects:o}=await O(s,"files"),l=[...new Set([...o.map(n=>n.id).filter(Boolean),...this.nodes.map(n=>n.fileid).filter(Boolean)])];await z(s,"files",l.map(n=>({id:n,type:"files"})),e)}for(const s of this.toRemove){const{etag:e,objects:o}=await O(s,"files"),l=new Set(this.nodes.map(i=>i.fileid)),n=o.map(i=>i.id).filter((i,f,T)=>!l.has(i)&&T.indexOf(i)===f);await z(s,"files",n.map(i=>({id:i,type:"files"})),e)}}catch(s){L.error("Failed to apply tags",{error:s}),_(y("systemtags","Failed to apply tags changes")),this.status="base";return}const t=[];this.toAdd.forEach(s=>{this.nodes.forEach(e=>{const o=[...I(e)||[],s.displayName].sort((l,n)=>l.localeCompare(n,S(),{ignorePunctuation:!0}));x(e,o),t.push(e)})}),this.toRemove.forEach(s=>{this.nodes.forEach(e=>{const o=[...I(e)||[]].filter(l=>l!==s.displayName).sort((l,n)=>l.localeCompare(n,S(),{ignorePunctuation:!0}));x(e,o),t.push(e)})}),t.forEach(s=>E("systemtags:node:updated",s)),this.status="done",setTimeout(()=>{this.opened=!1,this.$emit("close",!0)},2e3)},onCancel(){this.opened=!1,this.$emit("close",null)},tagListStyle(t){if(!t.color)return{"--color-circle-icon":"var(--color-text-maxcontrast)"};const s=bt(`#${t.color}`,`#${Wt}`),e=kt(s)?"#000000":"#ffffff";return{"--color-circle-icon":"var(--color-primary-element)","--color-primary":s,"--color-primary-text":e,"--color-primary-element":s,"--color-primary-element-text":e}}}}),te={class:"systemtags-picker__input"},ee={class:"systemtags-picker__tags","data-cy-systemtags-picker-tags":""},se=["data-cy-systemtags-picker-tag"],ae={class:"systemtags-picker__tag-create-subline"},ie={class:"systemtags-picker__note"},oe=["innerHTML"];function le(t,s,e,o,l,n){const i=c("NcLoadingIcon"),f=c("CheckIcon"),T=c("NcEmptyContent"),M=c("TagIcon"),V=c("NcTextField"),B=c("NcCheckboxRadioSwitch"),U=c("CircleIcon"),G=c("CircleOutlineIcon"),D=c("PencilIcon"),v=c("NcButton"),j=c("NcColorPicker"),F=c("PlusIcon"),$=c("NcNoteCard"),H=c("NcChip"),Z=c("NcDialog");return a(),h(Z,{"data-cy-systemtags-picker":"",noClose:t.status===t.Status.LOADING,name:t.t("systemtags","Manage tags"),open:t.opened,class:ht(["systemtags-picker--"+t.status,"systemtags-picker"]),closeOnClickOutside:"",outTransition:"","onUpdate:open":t.onCancel},{actions:m(()=>[u(v,{disabled:t.status!==t.Status.BASE,variant:"tertiary","data-cy-systemtags-picker-button-cancel":"",onClick:t.onCancel},{default:m(()=>[N(p(t.t("systemtags","Cancel")),1)]),_:1},8,["disabled","onClick"]),u(v,{disabled:!t.hasChanges||t.status!==t.Status.BASE,"data-cy-systemtags-picker-button-submit":"",onClick:t.onSubmit},{default:m(()=>[N(p(t.t("systemtags","Apply")),1)]),_:1},8,["disabled","onClick"])]),default:m(()=>[t.status===t.Status.LOADING||t.status===t.Status.DONE?(a(),h(T,{key:0,name:t.t("systemtags","Applying tags changes…")},{icon:m(()=>[t.status===t.Status.LOADING?(a(),h(i,{key:0})):(a(),h(f,{key:1,fillColor:"var(--color-border-success)"}))]),_:1},8,["name"])):(a(),d(R,{key:1},[g("div",te,[u(V,{modelValue:t.input,"onUpdate:modelValue":s[0]||(s[0]=r=>t.input=r),label:t.canEditOrCreateTag?t.t("systemtags","Search or create tag"):t.t("systemtags","Search tag"),"data-cy-systemtags-picker-input":""},{default:m(()=>[u(M,{size:20})]),_:1},8,["modelValue","label"])]),g("ul",ee,[(a(!0),d(R,null,dt(t.filteredTags,r=>(a(),d("li",{key:r.id,ref_for:!0,ref:"tags","data-cy-systemtags-picker-tag":r.id,style:mt(t.tagListStyle(r)),class:"systemtags-picker__tag"},[u(B,{modelValue:t.isChecked(r),disabled:!r.canAssign,indeterminate:t.isIndeterminate(r),label:r.displayName,class:"systemtags-picker__tag-checkbox","onUpdate:modelValue":b=>t.onCheckUpdate(r,b)},{default:m(()=>[N(p(t.formatTagName(r)),1)]),_:2},1032,["modelValue","disabled","indeterminate","label","onUpdate:modelValue"]),t.canEditOrCreateTag?(a(),h(j,{key:0,"data-cy-systemtags-picker-tag-color":r.id,modelValue:`#${r.color||"000000"}`,shown:t.openedPicker===r.id,class:"systemtags-picker__tag-color","onUpdate:shown":b=>t.openedPicker=b?r.id:!1,onSubmit:b=>t.onColorChange(r,b)},{default:m(()=>[u(v,{"aria-label":t.t("systemtags","Change tag color"),variant:"tertiary"},{icon:m(()=>[r.color?(a(),h(U,{key:0,size:24,fillColor:"var(--color-circle-icon)",class:"button-color-circle"})):(a(),h(G,{key:1,size:24,fillColor:"var(--color-circle-icon)",class:"button-color-empty"})),u(D,{class:"button-color-pencil"})]),_:2},1032,["aria-label"])]),_:2},1032,["data-cy-systemtags-picker-tag-color","modelValue","shown","onUpdate:shown","onSubmit"])):C("",!0)],12,se))),128)),g("li",null,[t.canEditOrCreateTag&&t.canCreateTag?(a(),h(v,{key:0,disabled:t.status===t.Status.CREATING_TAG,alignment:"start",class:"systemtags-picker__tag-create",type:"submit",variant:"tertiary","data-cy-systemtags-picker-button-create":"",onClick:t.onNewTag},{icon:m(()=>[u(F)]),default:m(()=>[N(p(t.input.trim()),1),s[1]||(s[1]=g("br",null,null,-1)),g("span",ae,p(t.t("systemtags","Create new tag")),1)]),_:1},8,["disabled","onClick"])):C("",!0)])]),g("div",ie,[t.hasChanges?(a(),h($,{key:1,type:"info"},{default:m(()=>[g("span",{innerHTML:t.statusMessage},null,8,oe)]),_:1})):(a(),h($,{key:0,type:"info"},{default:m(()=>[N(p(t.t("systemtags","Choose tags for the selected files")),1)]),_:1}))])],64)),ct(g("div",null,[u(H,{ref:"chip",text:"%s",noClose:"",variant:"primary"},null,512)],512),[[gt,!1]])]),_:1},8,["noClose","name","open","class","onUpdate:open"])}const xe=A(Yt,[["render",le],["__scopeId","data-v-fbaf4147"]]);export{xe as default}; -//# sourceMappingURL=SystemTagPicker-DZ1dvV0F.chunk.mjs.map +import{e as E,d as q,a as J}from"./index-Bndk0DrU.chunk.mjs";import{a as _}from"./index-JpgrUA2Z-Rp7fa0gf.chunk.mjs";import{a as A,l as K}from"./index-xFugdZPW.chunk.mjs";import{t as y,g as S,e as Q,p as W,b as k}from"./translation-DoG5ZELJ-Bni_xMHF.chunk.mjs";import{N as X}from"./logger-D3RVzcfQ-B9jnX7-s.chunk.mjs";import{N as Y}from"./NcCheckboxRadioSwitch-BMsPx74L-CaXJJ1WR.chunk.mjs";import{N as tt}from"./NcChip-B71t2Ny2-DeGKCj7f.chunk.mjs";import{N as et}from"./NcColorPicker-DDHxR-iN-Dglc-YtF.chunk.mjs";import{N as st}from"./index-Cg5VsXN5.chunk.mjs";import{P as at,N as it}from"./Plus-DQFE3py0.chunk.mjs";import{N as ot}from"./mdi-DXIZZeEd.chunk.mjs";import{N as lt}from"./NcNoteCard-Cok_4Fld-BI3-Vu_l.chunk.mjs";import{_ as nt}from"./TrashCanOutline-D95Fx13e.chunk.mjs";import{j as d,o as a,k as g,l as C,t as p,z as w,b as rt,f as c,c as h,w as m,E as ct,F as R,e as u,C as dt,M as mt,g as N,G as gt,n as ht}from"./runtime-dom.esm-bundler-CU8rrbZA.chunk.mjs";import{P as pt}from"./PencilOutline-a19hsj34.chunk.mjs";import{l as L,g as O,s as z,e as I,h as x,c as ut,i as ft,f as yt,u as Ct}from"./api-CrmL42y-.chunk.mjs";import{e as bt,i as kt,a as Nt}from"./systemtags-init.mjs";import"./createElementId-DhjFt1I9-CNrdQIoZ.chunk.mjs";import"./colors-BHGKZFDI-BMbI6zNx.chunk.mjs";import"./NcInputField-o5OFv3z6-DW3Gcl3I.chunk.mjs";import"./index-Conii63U.chunk.mjs";import"./string_decoder-BO00msnV.chunk.mjs";import"./index-DjsbsIll.chunk.mjs";import"./NcPasswordField-uaMO2pdt-D3pIyOm0.chunk.mjs";import"./dav-CMOydKDk.chunk.mjs";import"./index-JSJM6V6X.chunk.mjs";import"./folder-29HuacU_-CwocT1ij.chunk.mjs";import"./index-sQy2Ug64.chunk.mjs";const At={name:"CheckCircleIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},vt=["aria-hidden","aria-label"],wt=["fill","width","height"],Tt={d:"M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M10 17L5 12L6.41 10.59L10 14.17L17.59 6.58L19 8L10 17Z"},_t={key:0};function St(t,s,e,o,l,n){return a(),d("span",w(t.$attrs,{"aria-hidden":e.title?null:"true","aria-label":e.title,class:"material-design-icon check-circle-icon",role:"img",onClick:s[0]||(s[0]=i=>t.$emit("click",i))}),[(a(),d("svg",{fill:e.fillColor,class:"material-design-icon__svg",width:e.size,height:e.size,viewBox:"0 0 24 24"},[g("path",Tt,[e.title?(a(),d("title",_t,p(e.title),1)):C("",!0)])],8,wt))],16,vt)}const Lt=A(At,[["render",St]]),It={name:"CircleIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},$t=["aria-hidden","aria-label"],Et=["fill","width","height"],Rt={d:"M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z"},Ot={key:0};function zt(t,s,e,o,l,n){return a(),d("span",w(t.$attrs,{"aria-hidden":e.title?null:"true","aria-label":e.title,class:"material-design-icon circle-icon",role:"img",onClick:s[0]||(s[0]=i=>t.$emit("click",i))}),[(a(),d("svg",{fill:e.fillColor,class:"material-design-icon__svg",width:e.size,height:e.size,viewBox:"0 0 24 24"},[g("path",Rt,[e.title?(a(),d("title",Ot,p(e.title),1)):C("",!0)])],8,Et))],16,$t)}const xt=A(It,[["render",zt]]),Pt={name:"CircleOutlineIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},Mt=["aria-hidden","aria-label"],Vt=["fill","width","height"],Bt={d:"M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z"},Ut={key:0};function Gt(t,s,e,o,l,n){return a(),d("span",w(t.$attrs,{"aria-hidden":e.title?null:"true","aria-label":e.title,class:"material-design-icon circle-outline-icon",role:"img",onClick:s[0]||(s[0]=i=>t.$emit("click",i))}),[(a(),d("svg",{fill:e.fillColor,class:"material-design-icon__svg",width:e.size,height:e.size,viewBox:"0 0 24 24"},[g("path",Bt,[e.title?(a(),d("title",Ut,p(e.title),1)):C("",!0)])],8,Vt))],16,Mt)}const Dt=A(Pt,[["render",Gt]]),jt={name:"TagOutlineIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},Ft=["aria-hidden","aria-label"],Ht=["fill","width","height"],Zt={d:"M21.41 11.58L12.41 2.58A2 2 0 0 0 11 2H4A2 2 0 0 0 2 4V11A2 2 0 0 0 2.59 12.42L11.59 21.42A2 2 0 0 0 13 22A2 2 0 0 0 14.41 21.41L21.41 14.41A2 2 0 0 0 22 13A2 2 0 0 0 21.41 11.58M13 20L4 11V4H11L20 13M6.5 5A1.5 1.5 0 1 1 5 6.5A1.5 1.5 0 0 1 6.5 5Z"},qt={key:0};function Jt(t,s,e,o,l,n){return a(),d("span",w(t.$attrs,{"aria-hidden":e.title?null:"true","aria-label":e.title,class:"material-design-icon tag-outline-icon",role:"img",onClick:s[0]||(s[0]=i=>t.$emit("click",i))}),[(a(),d("svg",{fill:e.fillColor,class:"material-design-icon__svg",width:e.size,height:e.size,viewBox:"0 0 24 24"},[g("path",Zt,[e.title?(a(),d("title",qt,p(e.title),1)):C("",!0)])],8,Ht))],16,Ft)}const Kt=A(jt,[["render",Jt]]),Qt=q(Ct,500),Wt=getComputedStyle(document.body).getPropertyValue("--color-main-background").replace("#","")||(Nt()?"000000":"ffffff");var P=(t=>(t.BASE="base",t.LOADING="loading",t.CREATING_TAG="creating-tag",t.DONE="done",t))(P||{});const Xt=K("systemtags","restrictSystemTagsCreationToAdmin",!1),Yt=rt({name:"SystemTagPicker",components:{CheckIcon:Lt,CircleIcon:xt,CircleOutlineIcon:Dt,NcButton:X,NcCheckboxRadioSwitch:Y,NcChip:tt,NcColorPicker:et,NcDialog:st,NcEmptyContent:it,NcLoadingIcon:ot,NcNoteCard:lt,NcTextField:nt,PencilIcon:pt,PlusIcon:at,TagIcon:Kt},props:{nodes:{type:Array,required:!0}},emits:{close(t){return t===null||typeof t=="boolean"}},setup(){return{emit:E,Status:P,t:y,canEditOrCreateTag:!Xt||J()?.isAdmin}},data(){return{status:"base",opened:!0,openedPicker:!1,input:"",tags:[],tagList:{},toAdd:[],toRemove:[]}},computed:{sortedTags(){return[...this.tags].sort((t,s)=>t.displayName.localeCompare(s.displayName,S(),{ignorePunctuation:!0}))},filteredTags(){return this.input.trim()===""?this.sortedTags:this.sortedTags.filter(t=>t.displayName.normalize().toLowerCase().includes(this.input.normalize().toLowerCase()))},hasChanges(){return this.toAdd.length>0||this.toRemove.length>0},canCreateTag(){return this.input.trim()!==""&&!this.tags.some(t=>t.displayName.trim().toLocaleLowerCase()===this.input.trim().toLocaleLowerCase())},statusMessage(){if(this.toAdd.length===0&&this.toRemove.length===0)return"";if(this.toAdd.length===1&&this.toRemove.length===1)return k("systemtags","{tag1} will be set and {tag2} will be removed from 1 file.","{tag1} will be set and {tag2} will be removed from {count} files.",this.nodes.length,{tag1:this.formatTagChip(this.toAdd[0]),tag2:this.formatTagChip(this.toRemove[0]),count:this.nodes.length},{escape:!1});const t=this.toAdd.map(this.formatTagChip),s=t.pop(),e=this.toRemove.map(this.formatTagChip),o=e.pop(),l=k("systemtags","{tag} will be set to 1 file.","{tag} will be set to {count} files.",this.nodes.length,{tag:s,count:this.nodes.length},{escape:!1}),n=k("systemtags","{tag} will be removed from 1 file.","{tag} will be removed from {count} files.",this.nodes.length,{tag:o,count:this.nodes.length},{escape:!1}),i=k("systemtags","{tags} and {lastTag} will be set to 1 file.","{tags} and {lastTag} will be set to {count} files.",this.nodes.length,{tags:t.join(", "),lastTag:s,count:this.nodes.length},{escape:!1}),f=k("systemtags","{tags} and {lastTag} will be removed from 1 file.","{tags} and {lastTag} will be removed from {count} files.",this.nodes.length,{tags:e.join(", "),lastTag:o,count:this.nodes.length},{escape:!1});return this.toAdd.length===1&&this.toRemove.length===0?l:this.toAdd.length===0&&this.toRemove.length===1?n:this.toAdd.length>1&&this.toRemove.length===0?i:this.toAdd.length===0&&this.toRemove.length>1?f:this.toAdd.length>1&&this.toRemove.length===1?`${i} ${n}`:this.toAdd.length===1&&this.toRemove.length>1?`${l} ${f}`:`${i} ${f}`}},beforeMount(){yt().then(t=>{this.tags=t}),this.tagList=this.nodes.reduce((t,s)=>((I(s)||[]).forEach(e=>{t[e]=(t[e]||0)+1}),t),{}),this.canEditOrCreateTag||L.debug("System tag creation is restricted to admins and the current user is not an admin")},methods:{formatTagChip(t){const s=this.$refs.chip.$el.cloneNode(!0);if(t.color){const e=this.tagListStyle(t);Object.entries(e).forEach(([o,l])=>{s.style.setProperty(o,l)})}return s.outerHTML.replace("%s",Q(W.sanitize(t.displayName)))},formatTagName(t){return t.userVisible?t.userAssignable?t.displayName:y("systemtags","{displayName} (restricted)",{displayName:t.displayName}):y("systemtags","{displayName} (hidden)",{displayName:t.displayName})},onColorChange(t,s){t.color=s.replace("#",""),Qt(t)},isChecked(t){return t.displayName in this.tagList&&this.tagList[t.displayName]===this.nodes.length},isIndeterminate(t){return t.displayName in this.tagList&&this.tagList[t.displayName]!==0&&this.tagList[t.displayName]!==this.nodes.length},onCheckUpdate(t,s){s?(this.toAdd.push(t),this.toRemove=this.toRemove.filter(e=>e.id!==t.id),this.tagList[t.displayName]=this.nodes.length):(this.toRemove.push(t),this.toAdd=this.toAdd.filter(e=>e.id!==t.id),this.tagList[t.displayName]=0)},async onNewTag(){if(!this.canEditOrCreateTag){_(y("systemtags","Only admins can create new tags"));return}this.status="creating-tag";try{const t={displayName:this.input.trim(),userAssignable:!0,userVisible:!0,canAssign:!0},s=await ut(t),e=await ft(s);this.tags.push(e),this.input="",this.onCheckUpdate(e,!0),await this.$nextTick(),Array.isArray(this.$refs.tags)&&this.$refs.tags.find(o=>o.dataset.cySystemtagsPickerTag===s.toString())?.scrollIntoView({behavior:"instant",block:"center",inline:"center"})}catch(t){_(t?.message||y("systemtags","Failed to create tag"))}finally{this.status="base"}},async onSubmit(){this.status="loading",L.debug("Applying tags",{toAdd:this.toAdd,toRemove:this.toRemove});try{for(const s of this.toAdd){const{etag:e,objects:o}=await O(s,"files"),l=[...new Set([...o.map(n=>n.id).filter(Boolean),...this.nodes.map(n=>n.fileid).filter(Boolean)])];await z(s,"files",l.map(n=>({id:n,type:"files"})),e)}for(const s of this.toRemove){const{etag:e,objects:o}=await O(s,"files"),l=new Set(this.nodes.map(i=>i.fileid)),n=o.map(i=>i.id).filter((i,f,T)=>!l.has(i)&&T.indexOf(i)===f);await z(s,"files",n.map(i=>({id:i,type:"files"})),e)}}catch(s){L.error("Failed to apply tags",{error:s}),_(y("systemtags","Failed to apply tags changes")),this.status="base";return}const t=[];this.toAdd.forEach(s=>{this.nodes.forEach(e=>{const o=[...I(e)||[],s.displayName].sort((l,n)=>l.localeCompare(n,S(),{ignorePunctuation:!0}));x(e,o),t.push(e)})}),this.toRemove.forEach(s=>{this.nodes.forEach(e=>{const o=[...I(e)||[]].filter(l=>l!==s.displayName).sort((l,n)=>l.localeCompare(n,S(),{ignorePunctuation:!0}));x(e,o),t.push(e)})}),t.forEach(s=>E("systemtags:node:updated",s)),this.status="done",setTimeout(()=>{this.opened=!1,this.$emit("close",!0)},2e3)},onCancel(){this.opened=!1,this.$emit("close",null)},tagListStyle(t){if(!t.color)return{"--color-circle-icon":"var(--color-text-maxcontrast)"};const s=bt(`#${t.color}`,`#${Wt}`),e=kt(s)?"#000000":"#ffffff";return{"--color-circle-icon":"var(--color-primary-element)","--color-primary":s,"--color-primary-text":e,"--color-primary-element":s,"--color-primary-element-text":e}}}}),te={class:"systemtags-picker__input"},ee={class:"systemtags-picker__tags","data-cy-systemtags-picker-tags":""},se=["data-cy-systemtags-picker-tag"],ae={class:"systemtags-picker__tag-create-subline"},ie={class:"systemtags-picker__note"},oe=["innerHTML"];function le(t,s,e,o,l,n){const i=c("NcLoadingIcon"),f=c("CheckIcon"),T=c("NcEmptyContent"),M=c("TagIcon"),V=c("NcTextField"),B=c("NcCheckboxRadioSwitch"),U=c("CircleIcon"),G=c("CircleOutlineIcon"),D=c("PencilIcon"),v=c("NcButton"),j=c("NcColorPicker"),F=c("PlusIcon"),$=c("NcNoteCard"),H=c("NcChip"),Z=c("NcDialog");return a(),h(Z,{"data-cy-systemtags-picker":"",noClose:t.status===t.Status.LOADING,name:t.t("systemtags","Manage tags"),open:t.opened,class:ht(["systemtags-picker--"+t.status,"systemtags-picker"]),closeOnClickOutside:"",outTransition:"","onUpdate:open":t.onCancel},{actions:m(()=>[u(v,{disabled:t.status!==t.Status.BASE,variant:"tertiary","data-cy-systemtags-picker-button-cancel":"",onClick:t.onCancel},{default:m(()=>[N(p(t.t("systemtags","Cancel")),1)]),_:1},8,["disabled","onClick"]),u(v,{disabled:!t.hasChanges||t.status!==t.Status.BASE,"data-cy-systemtags-picker-button-submit":"",onClick:t.onSubmit},{default:m(()=>[N(p(t.t("systemtags","Apply")),1)]),_:1},8,["disabled","onClick"])]),default:m(()=>[t.status===t.Status.LOADING||t.status===t.Status.DONE?(a(),h(T,{key:0,name:t.t("systemtags","Applying tags changes…")},{icon:m(()=>[t.status===t.Status.LOADING?(a(),h(i,{key:0})):(a(),h(f,{key:1,fillColor:"var(--color-border-success)"}))]),_:1},8,["name"])):(a(),d(R,{key:1},[g("div",te,[u(V,{modelValue:t.input,"onUpdate:modelValue":s[0]||(s[0]=r=>t.input=r),label:t.canEditOrCreateTag?t.t("systemtags","Search or create tag"):t.t("systemtags","Search tag"),"data-cy-systemtags-picker-input":""},{default:m(()=>[u(M,{size:20})]),_:1},8,["modelValue","label"])]),g("ul",ee,[(a(!0),d(R,null,dt(t.filteredTags,r=>(a(),d("li",{key:r.id,ref_for:!0,ref:"tags","data-cy-systemtags-picker-tag":r.id,style:mt(t.tagListStyle(r)),class:"systemtags-picker__tag"},[u(B,{modelValue:t.isChecked(r),disabled:!r.canAssign,indeterminate:t.isIndeterminate(r),label:r.displayName,class:"systemtags-picker__tag-checkbox","onUpdate:modelValue":b=>t.onCheckUpdate(r,b)},{default:m(()=>[N(p(t.formatTagName(r)),1)]),_:2},1032,["modelValue","disabled","indeterminate","label","onUpdate:modelValue"]),t.canEditOrCreateTag?(a(),h(j,{key:0,"data-cy-systemtags-picker-tag-color":r.id,modelValue:`#${r.color||"000000"}`,shown:t.openedPicker===r.id,class:"systemtags-picker__tag-color","onUpdate:shown":b=>t.openedPicker=b?r.id:!1,onSubmit:b=>t.onColorChange(r,b)},{default:m(()=>[u(v,{"aria-label":t.t("systemtags","Change tag color"),variant:"tertiary"},{icon:m(()=>[r.color?(a(),h(U,{key:0,size:24,fillColor:"var(--color-circle-icon)",class:"button-color-circle"})):(a(),h(G,{key:1,size:24,fillColor:"var(--color-circle-icon)",class:"button-color-empty"})),u(D,{class:"button-color-pencil"})]),_:2},1032,["aria-label"])]),_:2},1032,["data-cy-systemtags-picker-tag-color","modelValue","shown","onUpdate:shown","onSubmit"])):C("",!0)],12,se))),128)),g("li",null,[t.canEditOrCreateTag&&t.canCreateTag?(a(),h(v,{key:0,disabled:t.status===t.Status.CREATING_TAG,alignment:"start",class:"systemtags-picker__tag-create",type:"submit",variant:"tertiary","data-cy-systemtags-picker-button-create":"",onClick:t.onNewTag},{icon:m(()=>[u(F)]),default:m(()=>[N(p(t.input.trim()),1),s[1]||(s[1]=g("br",null,null,-1)),g("span",ae,p(t.t("systemtags","Create new tag")),1)]),_:1},8,["disabled","onClick"])):C("",!0)])]),g("div",ie,[t.hasChanges?(a(),h($,{key:1,type:"info"},{default:m(()=>[g("span",{innerHTML:t.statusMessage},null,8,oe)]),_:1})):(a(),h($,{key:0,type:"info"},{default:m(()=>[N(p(t.t("systemtags","Choose tags for the selected files")),1)]),_:1}))])],64)),ct(g("div",null,[u(H,{ref:"chip",text:"%s",noClose:"",variant:"primary"},null,512)],512),[[gt,!1]])]),_:1},8,["noClose","name","open","class","onUpdate:open"])}const xe=A(Yt,[["render",le],["__scopeId","data-v-fbaf4147"]]);export{xe as default}; +//# sourceMappingURL=SystemTagPicker-CxL9oUpy.chunk.mjs.map diff --git a/dist/SystemTagPicker-DZ1dvV0F.chunk.mjs.license b/dist/SystemTagPicker-CxL9oUpy.chunk.mjs.license similarity index 100% rename from dist/SystemTagPicker-DZ1dvV0F.chunk.mjs.license rename to dist/SystemTagPicker-CxL9oUpy.chunk.mjs.license diff --git a/dist/SystemTagPicker-DZ1dvV0F.chunk.mjs.map b/dist/SystemTagPicker-CxL9oUpy.chunk.mjs.map similarity index 99% rename from dist/SystemTagPicker-DZ1dvV0F.chunk.mjs.map rename to dist/SystemTagPicker-CxL9oUpy.chunk.mjs.map index 33f1c9689bcd7..344c83752fddc 100644 --- a/dist/SystemTagPicker-DZ1dvV0F.chunk.mjs.map +++ b/dist/SystemTagPicker-CxL9oUpy.chunk.mjs.map @@ -1 +1 @@ -{"version":3,"file":"SystemTagPicker-DZ1dvV0F.chunk.mjs","sources":["../node_modules/vue-material-design-icons/CheckCircle.vue","../node_modules/vue-material-design-icons/Circle.vue","../node_modules/vue-material-design-icons/CircleOutline.vue","../node_modules/vue-material-design-icons/TagOutline.vue","../build/frontend/apps/systemtags/src/components/SystemTagPicker.vue"],"sourcesContent":["\n\n","\n\n","\n\n","\n\n","\n\n\n\n\n\n\n"],"names":["_sfc_main","_hoisted_3","_createElementBlock","_mergeProps","_ctx","$props","_cache","$event","_createElementVNode","_openBlock","debounceUpdateTag","debounce","updateTag","mainBackgroundColor","isDarkModeEnabled","Status","restrictSystemTagsCreationToAdmin","loadState","defineComponent","CheckIcon","CircleIcon","CircleOutlineIcon","NcButton","NcCheckboxRadioSwitch","NcChip","NcColorPicker","NcDialog","NcEmptyContent","NcLoadingIcon","NcNoteCard","NcTextField","PencilIcon","PlusIcon","TagIcon","status","emit","t","getCurrentUser","a","b","getLanguage","tag","n","tagsAdd","lastTagAdd","tagsRemove","lastTagRemove","addStringSingular","removeStringSingular","addStringPlural","removeStringPlural","fetchTags","tags","acc","node","getNodeSystemTags","logger","chipCloneEl","style","key","value","escapeHTML","domPurify","color","checked","search","showError","payload","id","createTag","fetchTag","el","error","etag","objects","getTagObjects","ids","obj","setTagObjects","nodeFileIds","index","self","nodes","setNodeSystemTags","primaryElement","elementColor","textColor","invertTextColor","_hoisted_1","_hoisted_4","_hoisted_5","_createBlock","_component_NcDialog","_normalizeClass","_withCtx","_createVNode","_component_NcButton","_createTextVNode","_toDisplayString","_component_NcEmptyContent","_component_NcLoadingIcon","_component_CheckIcon","_Fragment","_component_NcTextField","_component_TagIcon","_hoisted_2","_renderList","_normalizeStyle","_component_NcCheckboxRadioSwitch","_component_NcColorPicker","_component_CircleIcon","_component_CircleOutlineIcon","_component_PencilIcon","_component_PlusIcon","_component_NcNoteCard","_hoisted_6","_component_NcChip"],"mappings":"0nDAoBA,MAAKA,GAAU,CACb,KAAM,kBACN,MAAO,CAAC,OAAO,EACf,MAAO,CACL,MAAO,CACL,KAAM,QAER,UAAW,CACT,KAAM,OACN,QAAS,gBAEX,KAAM,CACJ,KAAM,OACN,QAAS,EACX,CACF,CACF,+DAxBYC,GAAA,CAAA,EAAE,qHAAqH,iDAXjIC,EAeO,OAfPC,EAAcC,EAAA,OAAM,CACb,cAAaC,EAAA,MAAK,KAAA,OAClB,aAAYA,EAAA,MACb,MAAM,yCACN,KAAK,MACJ,QAAKC,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAC,GAAEH,EAAA,MAAK,QAAUG,CAAM,WACjCL,EAQM,MAAA,CARA,KAAMG,EAAA,UACP,MAAM,4BACL,MAAOA,EAAA,KACP,OAAQA,EAAA,KACT,QAAQ,cACXG,EAEO,OAFPP,GAEO,CADQI,EAAA,OAAbI,EAAA,EAAAP,EAAuC,aAAhBG,EAAA,KAAK,EAAA,CAAA,6DCO/BL,GAAU,CACb,KAAM,aACN,MAAO,CAAC,OAAO,EACf,MAAO,CACL,MAAO,CACL,KAAM,QAER,UAAW,CACT,KAAM,OACN,QAAS,gBAEX,KAAM,CACJ,KAAM,OACN,QAAS,EACX,CACF,CACF,+DAxBYC,GAAA,CAAA,EAAE,8EAA8E,iDAX1FC,EAeO,OAfPC,EAAcC,EAAA,OAAM,CACb,cAAaC,EAAA,MAAK,KAAA,OAClB,aAAYA,EAAA,MACb,MAAM,mCACN,KAAK,MACJ,QAAKC,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAC,GAAEH,EAAA,MAAK,QAAUG,CAAM,WACjCL,EAQM,MAAA,CARA,KAAMG,EAAA,UACP,MAAM,4BACL,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F,kBAGnBuF,EAGauB,EAAA,CAAA,IAAA,EAHM,KAAK,MAAA,EAAA,WAEvB,IAA+B,CAA/B1G,EAA+B,OAAA,CAAzB,UAAQJ,EAAA,eAAa,KAAA,EAAA+G,EAAA,CAAA,CAAA,cAL5BxB,EAEauB,EAAA,CAAA,IAAA,EAFkB,KAAK,MAAA,EAAA,WACnC,IAA2D,CAAAjB,EAAAC,EAAxD9F,EAAA,EAAC,aAAA,oCAAA,CAAA,EAAA,CAAA,CAAA,CAAA,oBA0BPI,EAMM,MAAA,KAAA,CALLuF,EAIqBqB,EAAA,CAHpB,IAAI,OACJ,KAAK,KACL,QAAA,GACA,QAAQ,SAAA,EAAA,KAAA,GAAA,aALG,EAAK,CAAA,CAAA","x_google_ignoreList":[0,1,2,3]} \ No newline at end of file +{"version":3,"file":"SystemTagPicker-CxL9oUpy.chunk.mjs","sources":["../node_modules/vue-material-design-icons/CheckCircle.vue","../node_modules/vue-material-design-icons/Circle.vue","../node_modules/vue-material-design-icons/CircleOutline.vue","../node_modules/vue-material-design-icons/TagOutline.vue","../build/frontend/apps/systemtags/src/components/SystemTagPicker.vue"],"sourcesContent":["\n\n","\n\n","\n\n","\n\n","\n\n\n\n\n\n\n"],"names":["_sfc_main","_hoisted_3","_createElementBlock","_mergeProps","_ctx","$props","_cache","$event","_createElementVNode","_openBlock","debounceUpdateTag","debounce","updateTag","mainBackgroundColor","isDarkModeEnabled","Status","restrictSystemTagsCreationToAdmin","loadState","defineComponent","CheckIcon","CircleIcon","CircleOutlineIcon","NcButton","NcCheckboxRadioSwitch","NcChip","NcColorPicker","NcDialog","NcEmptyContent","NcLoadingIcon","NcNoteCard","NcTextField","PencilIcon","PlusIcon","TagIcon","status","emit","t","getCurrentUser","a","b","getLanguage","tag","n","tagsAdd","lastTagAdd","tagsRemove","lastTagRemove","addStringSingular","removeStringSingular","addStringPlural","removeStringPlural","fetchTags","tags","acc","node","getNodeSystemTags","logger","chipCloneEl","style","key","value","escapeHTML","domPurify","color","checked","search","showError","payload","id","createTag","fetchTag","el","error","etag","objects","getTagObjects","ids","obj","setTagObjects","nodeFileIds","index","self","nodes","setNodeSystemTags","primaryElement","elementColor","textColor","invertTextColor","_hoisted_1","_hoisted_4","_hoisted_5","_createBlock","_component_NcDialog","_normalizeClass","_withCtx","_createVNode","_component_NcButton","_createTextVNode","_toDisplayString","_component_NcEmptyContent","_component_NcLoadingIcon","_component_CheckIcon","_Fragment","_component_NcTextField","_component_TagIcon","_hoisted_2","_renderList","_normalizeStyle","_component_NcCheckboxRadioSwitch","_component_NcColorPicker","_component_CircleIcon","_component_CircleOutlineIcon","_component_PencilIcon","_component_PlusIcon","_component_NcNoteCard","_hoisted_6","_component_NcChip"],"mappings":"0nDAoBA,MAAKA,GAAU,CACb,KAAM,kBACN,MAAO,CAAC,OAAO,EACf,MAAO,CACL,MAAO,CACL,KAAM,QAER,UAAW,CACT,KAAM,OACN,QAAS,gBAEX,KAAM,CACJ,KAAM,OACN,QAAS,EACX,CACF,CACF,+DAxBYC,GAAA,CAAA,EAAE,qHAAqH,iDAXjIC,EAeO,OAfPC,EAAcC,EAAA,OAAM,CACb,cAAaC,EAAA,MAAK,KAAA,OAClB,aAAYA,EAAA,MACb,MAAM,yCACN,KAAK,MACJ,QAAKC,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAC,GAAEH,EAAA,MAAK,QAAUG,CAAM,WACjCL,EAQM,MAAA,CARA,KAAMG,EAAA,UACP,MAAM,4BACL,MAAOA,EAAA,KACP,OAAQA,EAAA,KACT,QAAQ,cACXG,EAEO,OAFPP,GAEO,CADQI,EAAA,OAAbI,EAAA,EAAAP,EAAuC,aAAhBG,EAAA,KAAK,EAAA,CAAA,6DCO/BL,GAAU,CACb,KAAM,aACN,MAAO,CAAC,OAAO,EACf,MAAO,CACL,MAAO,CACL,KAAM,QAER,UAAW,CACT,KAAM,OACN,QAAS,gBAEX,KAAM,CACJ,KAAM,OACN,QAAS,EACX,CACF,CACF,+DAxBYC,GAAA,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AHb,IAAkB,CAAAhB,EAAAC,EAAf9F,QAAM,KAAA,CAAI,EAAA,CAAA,EAAAE,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAKE,EAAI,KAAA,KAAA,KAAA,EAAA,GACtBA,EAAkG,OAAlGiF,GAAkGS,EAA3C9F,EAAA,EAAC,aAAA,gBAAA,CAAA,EAAA,CAAA,CAAA,CAAA,+CAS3DI,EAQM,MARNkF,GAQM,CAPctF,kBAGnBuF,EAGauB,EAAA,CAAA,IAAA,EAHM,KAAK,MAAA,EAAA,WAEvB,IAA+B,CAA/B1G,EAA+B,OAAA,CAAzB,UAAQJ,EAAA,eAAa,KAAA,EAAA+G,EAAA,CAAA,CAAA,cAL5BxB,EAEauB,EAAA,CAAA,IAAA,EAFkB,KAAK,MAAA,EAAA,WACnC,IAA2D,CAAAjB,EAAAC,EAAxD9F,EAAA,EAAC,aAAA,oCAAA,CAAA,EAAA,CAAA,CAAA,CAAA,oBA0BPI,EAMM,MAAA,KAAA,CALLuF,EAIqBqB,EAAA,CAHpB,IAAI,OACJ,KAAK,KACL,QAAA,GACA,QAAQ,SAAA,EAAA,KAAA,GAAA,aALG,EAAK,CAAA,CAAA","x_google_ignoreList":[0,1,2,3]} \ No newline at end of file diff --git a/dist/SystemTagPicker-DZ1dvV0F.chunk.mjs.map.license b/dist/SystemTagPicker-CxL9oUpy.chunk.mjs.map.license similarity index 100% rename from dist/SystemTagPicker-DZ1dvV0F.chunk.mjs.map.license rename to dist/SystemTagPicker-CxL9oUpy.chunk.mjs.map.license diff --git a/dist/api-DlsqY5DV.chunk.mjs b/dist/api-CrmL42y-.chunk.mjs similarity index 97% rename from dist/api-DlsqY5DV.chunk.mjs rename to dist/api-CrmL42y-.chunk.mjs index ade06ec8fd064..c72fa86785614 100644 --- a/dist/api-DlsqY5DV.chunk.mjs +++ b/dist/api-CrmL42y-.chunk.mjs @@ -1,4 +1,4 @@ -import{c as u}from"./index-Conii63U.chunk.mjs";import{g as y,e as c}from"./index-Bndk0DrU.chunk.mjs";import{t as o}from"./translation-DoG5ZELJ-Bni_xMHF.chunk.mjs";import{c as f}from"./index-DjsbsIll.chunk.mjs";import{b as h}from"./createElementId-DhjFt1I9-CNrdQIoZ.chunk.mjs";import{g as b}from"./dav-CufFHsl4.chunk.mjs";const r=y().setApp("systemtags").detectUser().build(),V={userVisible:!0,userAssignable:!0,canAssign:!0},x=Object.freeze({"display-name":"displayName","user-visible":"userVisible","user-assignable":"userAssignable","can-assign":"canAssign"});function p(t){return t.map(({props:s})=>Object.fromEntries(Object.entries(s).map(([e,a])=>(e=x[e]??e,a=e==="displayName"?String(a):a,[e,a]))))}function w(t){const s=t.indexOf("?");s>0&&(t=t.substring(0,s));const e=t.split("/");let a;do a=e[e.length-1],e.pop();while(!a&&e.length>0);return Number(a)}function v(t){if("name"in t&&!("displayName"in t))return{...t};const s={...t};return s.name=s.displayName,delete s.displayName,s}function N(t){const s=t.attributes?.["system-tags"]?.["system-tag"];return s===void 0?[]:[s].flat().map(e=>typeof e=="string"?e:e.text)}function P(t,s){t.attributes["system-tags"]={"system-tag":s},c("files:node:updated",t)}const n=b(),l=` +import{c as u}from"./index-Conii63U.chunk.mjs";import{g as y,e as c}from"./index-Bndk0DrU.chunk.mjs";import{t as o}from"./translation-DoG5ZELJ-Bni_xMHF.chunk.mjs";import{c as f}from"./index-DjsbsIll.chunk.mjs";import{b as h}from"./createElementId-DhjFt1I9-CNrdQIoZ.chunk.mjs";import{g as b}from"./dav-CMOydKDk.chunk.mjs";const r=y().setApp("systemtags").detectUser().build(),V={userVisible:!0,userAssignable:!0,canAssign:!0},x=Object.freeze({"display-name":"displayName","user-visible":"userVisible","user-assignable":"userAssignable","can-assign":"canAssign"});function p(t){return t.map(({props:s})=>Object.fromEntries(Object.entries(s).map(([e,a])=>(e=x[e]??e,a=e==="displayName"?String(a):a,[e,a]))))}function w(t){const s=t.indexOf("?");s>0&&(t=t.substring(0,s));const e=t.split("/");let a;do a=e[e.length-1],e.pop();while(!a&&e.length>0);return Number(a)}function v(t){if("name"in t&&!("displayName"in t))return{...t};const s={...t};return s.name=s.displayName,delete s.displayName,s}function N(t){const s=t.attributes?.["system-tags"]?.["system-tag"];return s===void 0?[]:[s].flat().map(e=>typeof e=="string"?e:e.text)}function P(t,s){t.attributes["system-tags"]={"system-tag":s},c("files:node:updated",t)}const n=b(),l=` @@ -40,4 +40,4 @@ import{c as u}from"./index-Conii63U.chunk.mjs";import{g as y,e as c}from"./index `),await n.customRequest(i,{method:"PROPPATCH",data:d,headers:{"if-match":a}})}async function H(t){const s=t?"1":"0",e=h("/apps/provisioning_api/api/v1/config/apps/{appId}/{key}",{appId:"systemtags",key:"restrict_creation_to_admin"});await f();const{data:a}=await u.post(e,{value:s});return a}export{_ as a,H as b,R as c,V as d,N as e,D as f,q as g,P as h,C as i,r as l,k as s,T as u}; -//# sourceMappingURL=api-DlsqY5DV.chunk.mjs.map +//# sourceMappingURL=api-CrmL42y-.chunk.mjs.map diff --git a/dist/api-DlsqY5DV.chunk.mjs.license b/dist/api-CrmL42y-.chunk.mjs.license similarity index 100% rename from dist/api-DlsqY5DV.chunk.mjs.license rename to dist/api-CrmL42y-.chunk.mjs.license diff --git a/dist/api-DlsqY5DV.chunk.mjs.map b/dist/api-CrmL42y-.chunk.mjs.map similarity index 99% rename from dist/api-DlsqY5DV.chunk.mjs.map rename to dist/api-CrmL42y-.chunk.mjs.map index dabe4b7816267..31cd26ebe7bf5 100644 --- a/dist/api-DlsqY5DV.chunk.mjs.map +++ b/dist/api-CrmL42y-.chunk.mjs.map @@ -1 +1 @@ -{"version":3,"file":"api-DlsqY5DV.chunk.mjs","sources":["../build/frontend/apps/systemtags/src/logger.ts","../build/frontend/apps/systemtags/src/utils.ts","../build/frontend/apps/systemtags/src/services/davClient.ts","../build/frontend/apps/systemtags/src/services/api.ts"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { getLoggerBuilder } from '@nextcloud/logger'\n\nexport default getLoggerBuilder()\n\t.setApp('systemtags')\n\t.detectUser()\n\t.build()\n","/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport type { INode } from '@nextcloud/files'\nimport type { DAVResultResponseProps } from 'webdav'\nimport type { BaseTag, ServerTag, Tag, TagWithId } from './types.ts'\n\nimport { emit } from '@nextcloud/event-bus'\n\nexport const defaultBaseTag: BaseTag = {\n\tuserVisible: true,\n\tuserAssignable: true,\n\tcanAssign: true,\n}\n\nconst propertyMappings = Object.freeze({\n\t'display-name': 'displayName',\n\t'user-visible': 'userVisible',\n\t'user-assignable': 'userAssignable',\n\t'can-assign': 'canAssign',\n})\n\n/**\n * Parse tags from WebDAV response\n *\n * @param tags - Array of tags from WebDAV response\n */\nexport function parseTags(tags: { props: DAVResultResponseProps }[]): TagWithId[] {\n\treturn tags.map(({ props }) => Object.fromEntries(Object.entries(props)\n\t\t.map(([key, value]) => {\n\t\t\tkey = propertyMappings[key] ?? key\n\t\t\tvalue = key === 'displayName' ? String(value) : value\n\t\t\treturn [key, value]\n\t\t})) as unknown as TagWithId)\n}\n\n/**\n * Parse id from `Content-Location` header\n *\n * @param url URL to parse\n */\nexport function parseIdFromLocation(url: string): number {\n\tconst queryPos = url.indexOf('?')\n\tif (queryPos > 0) {\n\t\turl = url.substring(0, queryPos)\n\t}\n\n\tconst parts = url.split('/')\n\tlet result\n\tdo {\n\t\tresult = parts[parts.length - 1]\n\t\tparts.pop()\n\t\t// note: first result can be empty when there is a trailing slash,\n\t\t// so we take the part before that\n\t} while (!result && parts.length > 0)\n\n\treturn Number(result)\n}\n\n/**\n * Format a tag for WebDAV operations\n *\n * @param initialTag - Tag to format\n */\nexport function formatTag(initialTag: Tag | ServerTag): ServerTag {\n\tif ('name' in initialTag && !('displayName' in initialTag)) {\n\t\treturn { ...initialTag }\n\t}\n\n\tconst tag: Record = { ...initialTag }\n\ttag.name = tag.displayName\n\tdelete tag.displayName\n\n\treturn tag as unknown as ServerTag\n}\n\n/**\n * Get system tags from a node\n *\n * @param node - The node to get tags from\n */\nexport function getNodeSystemTags(node: INode): string[] {\n\tconst attribute = node.attributes?.['system-tags']?.['system-tag']\n\tif (attribute === undefined) {\n\t\treturn []\n\t}\n\n\t// if there is only one tag it is a single string or prop object\n\t// if there are multiple then its an array - so we flatten it to be always an array of string or prop objects\n\treturn [attribute]\n\t\t.flat()\n\t\t.map((tag: string | { text: string }) => (\n\t\t\ttypeof tag === 'string'\n\t\t\t\t// its a plain text prop (the tag name) without prop attributes\n\t\t\t\t? tag\n\t\t\t\t// its a prop object with attributes, the tag name is in the 'text' attribute\n\t\t\t\t: tag.text\n\t\t))\n}\n\n/**\n * Set system tags on a node\n *\n * @param node - The node to set tags on\n * @param tags - The tags to set\n */\nexport function setNodeSystemTags(node: INode, tags: string[]): void {\n\tnode.attributes['system-tags'] = {\n\t\t'system-tag': tags,\n\t}\n\temit('files:node:updated', node)\n}\n","/*!\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport type { Node } from '@nextcloud/files'\nimport type { FileStat, ResponseDataDetailed } from 'webdav'\n\nimport { getClient, getDefaultPropfind, getRootPath, resultToNode } from '@nextcloud/files/dav'\n\nexport const davClient = getClient()\n\n/**\n * Fetches a node from the given path\n *\n * @param path - The path to fetch the node from\n */\nexport async function fetchNode(path: string): Promise {\n\tconst propfindPayload = getDefaultPropfind()\n\tconst result = await davClient.stat(`${getRootPath()}${path}`, {\n\t\tdetails: true,\n\t\tdata: propfindPayload,\n\t}) as ResponseDataDetailed\n\treturn resultToNode(result.data)\n}\n","/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport type { OCSResponse } from '@nextcloud/typings/ocs'\nimport type { FileStat, ResponseDataDetailed, WebDAVClientError } from 'webdav'\nimport type { ServerTag, Tag, TagWithId } from '../types.ts'\n\nimport axios from '@nextcloud/axios'\nimport { emit } from '@nextcloud/event-bus'\nimport { t } from '@nextcloud/l10n'\nimport { confirmPassword } from '@nextcloud/password-confirmation'\nimport { generateOcsUrl, generateUrl } from '@nextcloud/router'\nimport logger from '../logger.ts'\nimport { formatTag, parseIdFromLocation, parseTags } from '../utils.ts'\nimport { davClient } from './davClient.ts'\n\nexport const fetchTagsPayload = `\n\n\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\n`\n\n/**\n * Fetch all tags.\n */\nexport async function fetchTags(): Promise {\n\tconst path = '/systemtags'\n\ttry {\n\t\tconst { data: tags } = await davClient.getDirectoryContents(path, {\n\t\t\tdata: fetchTagsPayload,\n\t\t\tdetails: true,\n\t\t\tglob: '/systemtags/*', // Filter out first empty tag\n\t\t}) as ResponseDataDetailed[]>\n\t\treturn parseTags(tags)\n\t} catch (error) {\n\t\tlogger.error(t('systemtags', 'Failed to load tags'), { error })\n\t\tthrow new Error(t('systemtags', 'Failed to load tags'))\n\t}\n}\n\n/**\n * Fetch a single tag by its ID.\n *\n * @param tagId - The ID of the tag to fetch\n */\nexport async function fetchTag(tagId: number): Promise {\n\tconst path = '/systemtags/' + tagId\n\ttry {\n\t\tconst { data: tag } = await davClient.stat(path, {\n\t\t\tdata: fetchTagsPayload,\n\t\t\tdetails: true,\n\t\t}) as ResponseDataDetailed>\n\t\treturn parseTags([tag])[0]!\n\t} catch (error) {\n\t\tlogger.error(t('systemtags', 'Failed to load tag'), { error })\n\t\tthrow new Error(t('systemtags', 'Failed to load tag'))\n\t}\n}\n\n/**\n * Get the last used tag IDs.\n */\nexport async function fetchLastUsedTagIds(): Promise {\n\tconst url = generateUrl('/apps/systemtags/lastused')\n\ttry {\n\t\tconst { data: lastUsedTagIds } = await axios.get(url)\n\t\treturn lastUsedTagIds.map(Number)\n\t} catch (error) {\n\t\tlogger.error(t('systemtags', 'Failed to load last used tags'), { error })\n\t\tthrow new Error(t('systemtags', 'Failed to load last used tags'))\n\t}\n}\n\n/**\n * Create a tag and return the Id of the newly created tag.\n *\n * @param tag The tag to create\n */\nexport async function createTag(tag: Tag | ServerTag): Promise {\n\tconst path = '/systemtags'\n\tconst tagToPost = formatTag(tag)\n\ttry {\n\t\tconst { headers } = await davClient.customRequest(path, {\n\t\t\tmethod: 'POST',\n\t\t\tdata: tagToPost,\n\t\t})\n\t\tconst contentLocation = headers.get('content-location')\n\t\tif (contentLocation) {\n\t\t\temit('systemtags:tag:created', tag)\n\t\t\treturn parseIdFromLocation(contentLocation)\n\t\t}\n\t\tlogger.error(t('systemtags', 'Missing \"Content-Location\" header'))\n\t\tthrow new Error(t('systemtags', 'Missing \"Content-Location\" header'))\n\t} catch (error) {\n\t\tif ((error as WebDAVClientError)?.response?.status === 409) {\n\t\t\tlogger.error(t('systemtags', 'A tag with the same name already exists'), { error })\n\t\t\tthrow new Error(t('systemtags', 'A tag with the same name already exists'))\n\t\t}\n\t\tlogger.error(t('systemtags', 'Failed to create tag'), { error })\n\t\tthrow new Error(t('systemtags', 'Failed to create tag'))\n\t}\n}\n\n/**\n * Update a tag on the server.\n *\n * @param tag - The tag to update\n */\nexport async function updateTag(tag: TagWithId): Promise {\n\tconst path = '/systemtags/' + tag.id\n\tconst data = `\n\t\n\t\t\n\t\t\t\n\t\t\t\t${tag.displayName}\n\t\t\t\t${tag.userVisible}\n\t\t\t\t${tag.userAssignable}\n\t\t\t\t${tag?.color || null}\n\t\t\t\n\t\t\n\t`\n\n\ttry {\n\t\tawait davClient.customRequest(path, {\n\t\t\tmethod: 'PROPPATCH',\n\t\t\tdata,\n\t\t})\n\t\temit('systemtags:tag:updated', tag)\n\t} catch (error) {\n\t\tlogger.error(t('systemtags', 'Failed to update tag'), { error })\n\t\tthrow new Error(t('systemtags', 'Failed to update tag'))\n\t}\n}\n\n/**\n * Delete a tag.\n *\n * @param tag - The tag to delete\n */\nexport async function deleteTag(tag: TagWithId): Promise {\n\tconst path = '/systemtags/' + tag.id\n\ttry {\n\t\tawait davClient.deleteFile(path)\n\t\temit('systemtags:tag:deleted', tag)\n\t} catch (error) {\n\t\tlogger.error(t('systemtags', 'Failed to delete tag'), { error })\n\t\tthrow new Error(t('systemtags', 'Failed to delete tag'))\n\t}\n}\n\ntype TagObject = {\n\tid: number\n\ttype: string\n}\n\ntype TagObjectResponse = {\n\tetag: string\n\tobjects: TagObject[]\n}\n\n/**\n * Get the objects for a tag.\n *\n * @param tag - The tag to get the objects for\n * @param type - The type of the objects\n */\nexport async function getTagObjects(tag: TagWithId, type: string): Promise {\n\tconst path = `/systemtags/${tag.id}/${type}`\n\tconst data = `\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t`\n\n\tconst response = await davClient.stat(path, { data, details: true }) as ResponseDataDetailed\n\tconst etag = response?.data?.props?.getetag || '\"\"'\n\tconst objects = Object.values(response?.data?.props?.['object-ids'] || []).flat() as TagObject[]\n\n\treturn {\n\t\tetag,\n\t\tobjects,\n\t}\n}\n\n/**\n * Set the objects for a tag.\n * Warning: This will overwrite the existing objects.\n *\n * @param tag The tag to set the objects for\n * @param type The type of the objects\n * @param objectIds The objects to set\n * @param etag Strongly recommended to avoid conflict and data loss.\n */\nexport async function setTagObjects(tag: TagWithId, type: string, objectIds: TagObject[], etag: string = ''): Promise {\n\tconst path = `/systemtags/${tag.id}/${type}`\n\tlet data = `\n\t\n\t\t\n\t\t\t\n\t\t\t\t${objectIds.map(({ id, type }) => `${id}${type}`).join('')}\n\t\t\t\n\t\t\n\t`\n\n\tif (objectIds.length === 0) {\n\t\tdata = `\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t`\n\t}\n\n\tawait davClient.customRequest(path, {\n\t\tmethod: 'PROPPATCH',\n\t\tdata,\n\t\theaders: {\n\t\t\t'if-match': etag,\n\t\t},\n\t})\n}\n\n/**\n * Update the system tags admin restriction setting.\n *\n * @param isAllowed - True if system tags creation is allowed for non-admins\n */\nexport async function updateSystemTagsAdminRestriction(isAllowed: boolean): Promise {\n\t// Convert to string for compatibility\n\tconst isAllowedString = isAllowed ? '1' : '0'\n\n\tconst url = generateOcsUrl('/apps/provisioning_api/api/v1/config/apps/{appId}/{key}', {\n\t\tappId: 'systemtags',\n\t\tkey: 'restrict_creation_to_admin',\n\t})\n\n\tawait confirmPassword()\n\n\tconst { data } = await axios.post(url, {\n\t\tvalue: isAllowedString,\n\t})\n\n\treturn data\n}\n"],"names":["logger","getLoggerBuilder","defaultBaseTag","propertyMappings","parseTags","tags","props","key","value","parseIdFromLocation","url","queryPos","parts","result","formatTag","initialTag","tag","getNodeSystemTags","node","attribute","setNodeSystemTags","emit","davClient","getClient","fetchTagsPayload","fetchTags","path","error","t","fetchTag","tagId","createTag","tagToPost","headers","contentLocation","updateTag","data","deleteTag","getTagObjects","type","response","etag","objects","setTagObjects","objectIds","id","updateSystemTagsAdminRestriction","isAllowed","isAllowedString","generateOcsUrl","confirmPassword","axios"],"mappings":"iUAOA,MAAAA,EAAeC,IACb,OAAO,YAAY,EACnB,WAAA,EACA,MAAA,ECCWC,EAA0B,CACtC,YAAa,GACb,eAAgB,GAChB,UAAW,EACZ,EAEMC,EAAmB,OAAO,OAAO,CACtC,eAAgB,cAChB,eAAgB,cAChB,kBAAmB,iBACnB,aAAc,WACf,CAAC,EAOM,SAASC,EAAUC,EAAwD,CACjF,OAAOA,EAAK,IAAI,CAAC,CAAE,MAAAC,CAAA,IAAY,OAAO,YAAY,OAAO,QAAQA,CAAK,EACpE,IAAI,CAAC,CAACC,EAAKC,CAAK,KAChBD,EAAMJ,EAAiBI,CAAG,GAAKA,EAC/BC,EAAQD,IAAQ,cAAgB,OAAOC,CAAK,EAAIA,EACzC,CAACD,EAAKC,CAAK,EAClB,CAAC,CAAyB,CAC7B,CAOO,SAASC,EAAoBC,EAAqB,CACxD,MAAMC,EA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K,EAAE,CAAC;AAAA;AAAA;AAAA,sBAKvIK,EAAU,SAAW,IACxBR,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAUR,MAAMd,EAAU,cAAcI,EAAM,CACnC,OAAQ,YACR,KAAAU,EACA,QAAS,CACR,WAAYK,CAAA,CACb,CACA,CACF,CAOA,eAAsBK,EAAiCC,EAA0C,CAEhG,MAAMC,EAAkBD,EAAY,IAAM,IAEpCrC,EAAMuC,EAAe,0DAA2D,CACrF,MAAO,aACP,IAAK,4BAAA,CACL,EAED,MAAMC,EAAA,EAEN,KAAM,CAAE,KAAAd,CAAA,EAAS,MAAMe,EAAM,KAAKzC,EAAK,CACtC,MAAOsC,CAAA,CACP,EAED,OAAOZ,CACR"} \ No newline at end of file +{"version":3,"file":"api-CrmL42y-.chunk.mjs","sources":["../build/frontend/apps/systemtags/src/logger.ts","../build/frontend/apps/systemtags/src/utils.ts","../build/frontend/apps/systemtags/src/services/davClient.ts","../build/frontend/apps/systemtags/src/services/api.ts"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { getLoggerBuilder } from '@nextcloud/logger'\n\nexport default getLoggerBuilder()\n\t.setApp('systemtags')\n\t.detectUser()\n\t.build()\n","/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport type { INode } from '@nextcloud/files'\nimport type { DAVResultResponseProps } from 'webdav'\nimport type { BaseTag, ServerTag, Tag, TagWithId } from './types.ts'\n\nimport { emit } from '@nextcloud/event-bus'\n\nexport const defaultBaseTag: BaseTag = {\n\tuserVisible: true,\n\tuserAssignable: true,\n\tcanAssign: true,\n}\n\nconst propertyMappings = Object.freeze({\n\t'display-name': 'displayName',\n\t'user-visible': 'userVisible',\n\t'user-assignable': 'userAssignable',\n\t'can-assign': 'canAssign',\n})\n\n/**\n * Parse tags from WebDAV response\n *\n * @param tags - Array of tags from WebDAV response\n */\nexport function parseTags(tags: { props: DAVResultResponseProps }[]): TagWithId[] {\n\treturn tags.map(({ props }) => Object.fromEntries(Object.entries(props)\n\t\t.map(([key, value]) => {\n\t\t\tkey = propertyMappings[key] ?? key\n\t\t\tvalue = key === 'displayName' ? String(value) : value\n\t\t\treturn [key, value]\n\t\t})) as unknown as TagWithId)\n}\n\n/**\n * Parse id from `Content-Location` header\n *\n * @param url URL to parse\n */\nexport function parseIdFromLocation(url: string): number {\n\tconst queryPos = url.indexOf('?')\n\tif (queryPos > 0) {\n\t\turl = url.substring(0, queryPos)\n\t}\n\n\tconst parts = url.split('/')\n\tlet result\n\tdo {\n\t\tresult = parts[parts.length - 1]\n\t\tparts.pop()\n\t\t// note: first result can be empty when there is a trailing slash,\n\t\t// so we take the part before that\n\t} while (!result && parts.length > 0)\n\n\treturn Number(result)\n}\n\n/**\n * Format a tag for WebDAV operations\n *\n * @param initialTag - Tag to format\n */\nexport function formatTag(initialTag: Tag | ServerTag): ServerTag {\n\tif ('name' in initialTag && !('displayName' in initialTag)) {\n\t\treturn { ...initialTag }\n\t}\n\n\tconst tag: Record = { ...initialTag }\n\ttag.name = tag.displayName\n\tdelete tag.displayName\n\n\treturn tag as unknown as ServerTag\n}\n\n/**\n * Get system tags from a node\n *\n * @param node - The node to get tags from\n */\nexport function getNodeSystemTags(node: INode): string[] {\n\tconst attribute = node.attributes?.['system-tags']?.['system-tag']\n\tif (attribute === undefined) {\n\t\treturn []\n\t}\n\n\t// if there is only one tag it is a single string or prop object\n\t// if there are multiple then its an array - so we flatten it to be always an array of string or prop objects\n\treturn [attribute]\n\t\t.flat()\n\t\t.map((tag: string | { text: string }) => (\n\t\t\ttypeof tag === 'string'\n\t\t\t\t// its a plain text prop (the tag name) without prop attributes\n\t\t\t\t? tag\n\t\t\t\t// its a prop object with attributes, the tag name is in the 'text' attribute\n\t\t\t\t: tag.text\n\t\t))\n}\n\n/**\n * Set system tags on a node\n *\n * @param node - The node to set tags on\n * @param tags - The tags to set\n */\nexport function setNodeSystemTags(node: INode, tags: string[]): void {\n\tnode.attributes['system-tags'] = {\n\t\t'system-tag': tags,\n\t}\n\temit('files:node:updated', node)\n}\n","/*!\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport type { Node } from '@nextcloud/files'\nimport type { FileStat, ResponseDataDetailed } from 'webdav'\n\nimport { getClient, getDefaultPropfind, getRootPath, resultToNode } from '@nextcloud/files/dav'\n\nexport const davClient = getClient()\n\n/**\n * Fetches a node from the given path\n *\n * @param path - The path to fetch the node from\n */\nexport async function fetchNode(path: string): Promise {\n\tconst propfindPayload = getDefaultPropfind()\n\tconst result = await davClient.stat(`${getRootPath()}${path}`, {\n\t\tdetails: true,\n\t\tdata: propfindPayload,\n\t}) as ResponseDataDetailed\n\treturn resultToNode(result.data)\n}\n","/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport type { OCSResponse } from '@nextcloud/typings/ocs'\nimport type { FileStat, ResponseDataDetailed, WebDAVClientError } from 'webdav'\nimport type { ServerTag, Tag, TagWithId } from '../types.ts'\n\nimport axios from '@nextcloud/axios'\nimport { emit } from '@nextcloud/event-bus'\nimport { t } from '@nextcloud/l10n'\nimport { confirmPassword } from '@nextcloud/password-confirmation'\nimport { generateOcsUrl, generateUrl } from '@nextcloud/router'\nimport logger from '../logger.ts'\nimport { formatTag, parseIdFromLocation, parseTags } from '../utils.ts'\nimport { davClient } from './davClient.ts'\n\nexport const fetchTagsPayload = `\n\n\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\n`\n\n/**\n * Fetch all tags.\n */\nexport async function fetchTags(): Promise {\n\tconst path = '/systemtags'\n\ttry {\n\t\tconst { data: tags } = await davClient.getDirectoryContents(path, {\n\t\t\tdata: fetchTagsPayload,\n\t\t\tdetails: true,\n\t\t\tglob: '/systemtags/*', // Filter out first empty tag\n\t\t}) as ResponseDataDetailed[]>\n\t\treturn parseTags(tags)\n\t} catch (error) {\n\t\tlogger.error(t('systemtags', 'Failed to load tags'), { error })\n\t\tthrow new Error(t('systemtags', 'Failed to load tags'))\n\t}\n}\n\n/**\n * Fetch a single tag by its ID.\n *\n * @param tagId - The ID of the tag to fetch\n */\nexport async function fetchTag(tagId: number): Promise {\n\tconst path = '/systemtags/' + tagId\n\ttry {\n\t\tconst { data: tag } = await davClient.stat(path, {\n\t\t\tdata: fetchTagsPayload,\n\t\t\tdetails: true,\n\t\t}) as ResponseDataDetailed>\n\t\treturn parseTags([tag])[0]!\n\t} catch (error) {\n\t\tlogger.error(t('systemtags', 'Failed to load tag'), { error })\n\t\tthrow new Error(t('systemtags', 'Failed to load tag'))\n\t}\n}\n\n/**\n * Get the last used tag IDs.\n */\nexport async function fetchLastUsedTagIds(): Promise {\n\tconst url = generateUrl('/apps/systemtags/lastused')\n\ttry {\n\t\tconst { data: lastUsedTagIds } = await axios.get(url)\n\t\treturn lastUsedTagIds.map(Number)\n\t} catch (error) {\n\t\tlogger.error(t('systemtags', 'Failed to load last used tags'), { error })\n\t\tthrow new Error(t('systemtags', 'Failed to load last used tags'))\n\t}\n}\n\n/**\n * Create a tag and return the Id of the newly created tag.\n *\n * @param tag The tag to create\n */\nexport async function createTag(tag: Tag | ServerTag): Promise {\n\tconst path = '/systemtags'\n\tconst tagToPost = formatTag(tag)\n\ttry {\n\t\tconst { headers } = await davClient.customRequest(path, {\n\t\t\tmethod: 'POST',\n\t\t\tdata: tagToPost,\n\t\t})\n\t\tconst contentLocation = headers.get('content-location')\n\t\tif (contentLocation) {\n\t\t\temit('systemtags:tag:created', tag)\n\t\t\treturn parseIdFromLocation(contentLocation)\n\t\t}\n\t\tlogger.error(t('systemtags', 'Missing \"Content-Location\" header'))\n\t\tthrow new Error(t('systemtags', 'Missing \"Content-Location\" header'))\n\t} catch (error) {\n\t\tif ((error as WebDAVClientError)?.response?.status === 409) {\n\t\t\tlogger.error(t('systemtags', 'A tag with the same name already exists'), { error })\n\t\t\tthrow new Error(t('systemtags', 'A tag with the same name already exists'))\n\t\t}\n\t\tlogger.error(t('systemtags', 'Failed to create tag'), { error })\n\t\tthrow new Error(t('systemtags', 'Failed to create tag'))\n\t}\n}\n\n/**\n * Update a tag on the server.\n *\n * @param tag - The tag to update\n */\nexport async function updateTag(tag: TagWithId): Promise {\n\tconst path = '/systemtags/' + tag.id\n\tconst data = `\n\t\n\t\t\n\t\t\t\n\t\t\t\t${tag.displayName}\n\t\t\t\t${tag.userVisible}\n\t\t\t\t${tag.userAssignable}\n\t\t\t\t${tag?.color || null}\n\t\t\t\n\t\t\n\t`\n\n\ttry {\n\t\tawait davClient.customRequest(path, {\n\t\t\tmethod: 'PROPPATCH',\n\t\t\tdata,\n\t\t})\n\t\temit('systemtags:tag:updated', tag)\n\t} catch (error) {\n\t\tlogger.error(t('systemtags', 'Failed to update tag'), { error })\n\t\tthrow new Error(t('systemtags', 'Failed to update tag'))\n\t}\n}\n\n/**\n * Delete a tag.\n *\n * @param tag - The tag to delete\n */\nexport async function deleteTag(tag: TagWithId): Promise {\n\tconst path = '/systemtags/' + tag.id\n\ttry {\n\t\tawait davClient.deleteFile(path)\n\t\temit('systemtags:tag:deleted', tag)\n\t} catch (error) {\n\t\tlogger.error(t('systemtags', 'Failed to delete tag'), { error })\n\t\tthrow new Error(t('systemtags', 'Failed to delete tag'))\n\t}\n}\n\ntype TagObject = {\n\tid: number\n\ttype: string\n}\n\ntype TagObjectResponse = {\n\tetag: string\n\tobjects: TagObject[]\n}\n\n/**\n * Get the objects for a tag.\n *\n * @param tag - The tag to get the objects for\n * @param type - The type of the objects\n */\nexport async function getTagObjects(tag: TagWithId, type: string): Promise {\n\tconst path = `/systemtags/${tag.id}/${type}`\n\tconst data = `\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t`\n\n\tconst response = await davClient.stat(path, { data, details: true }) as ResponseDataDetailed\n\tconst etag = response?.data?.props?.getetag || '\"\"'\n\tconst objects = Object.values(response?.data?.props?.['object-ids'] || []).flat() as TagObject[]\n\n\treturn {\n\t\tetag,\n\t\tobjects,\n\t}\n}\n\n/**\n * Set the objects for a tag.\n * Warning: This will overwrite the existing objects.\n *\n * @param tag The tag to set the objects for\n * @param type The type of the objects\n * @param objectIds The objects to set\n * @param etag Strongly recommended to avoid conflict and data loss.\n */\nexport async function setTagObjects(tag: TagWithId, type: string, objectIds: TagObject[], etag: string = ''): Promise {\n\tconst path = `/systemtags/${tag.id}/${type}`\n\tlet data = `\n\t\n\t\t\n\t\t\t\n\t\t\t\t${objectIds.map(({ id, type }) => `${id}${type}`).join('')}\n\t\t\t\n\t\t\n\t`\n\n\tif (objectIds.length === 0) {\n\t\tdata = `\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t`\n\t}\n\n\tawait davClient.customRequest(path, {\n\t\tmethod: 'PROPPATCH',\n\t\tdata,\n\t\theaders: {\n\t\t\t'if-match': etag,\n\t\t},\n\t})\n}\n\n/**\n * Update the system tags admin restriction setting.\n *\n * @param isAllowed - True if system tags creation is allowed for non-admins\n */\nexport async function updateSystemTagsAdminRestriction(isAllowed: boolean): Promise {\n\t// Convert to string for compatibility\n\tconst isAllowedString = isAllowed ? '1' : '0'\n\n\tconst url = generateOcsUrl('/apps/provisioning_api/api/v1/config/apps/{appId}/{key}', {\n\t\tappId: 'systemtags',\n\t\tkey: 'restrict_creation_to_admin',\n\t})\n\n\tawait confirmPassword()\n\n\tconst { data } = await axios.post(url, {\n\t\tvalue: isAllowedString,\n\t})\n\n\treturn data\n}\n"],"names":["logger","getLoggerBuilder","defaultBaseTag","propertyMappings","parseTags","tags","props","key","value","parseIdFromLocation","url","queryPos","parts","result","formatTag","initialTag","tag","getNodeSystemTags","node","attribute","setNodeSystemTags","emit","davClient","getClient","fetchTagsPayload","fetchTags","path","error","t","fetchTag","tagId","createTag","tagToPost","headers","contentLocation","updateTag","data","deleteTag","getTagObjects","type","response","etag","objects","setTagObjects","objectIds","id","updateSystemTagsAdminRestriction","isAllowed","isAllowedString","generateOcsUrl","confirmPassword","axios"],"mappings":"iUAOA,MAAAA,EAAeC,IACb,OAAO,YAAY,EACnB,WAAA,EACA,MAAA,ECCWC,EAA0B,CACtC,YAAa,GACb,eAAgB,GAChB,UAAW,EACZ,EAEMC,EAAmB,OAAO,OAAO,CACtC,eAAgB,cAChB,eAAgB,cAChB,kBAAmB,iBACnB,aAAc,WACf,CAAC,EAOM,SAASC,EAAUC,EAAwD,CACjF,OAAOA,EAAK,IAAI,CAAC,CAAE,MAAAC,CAAA,IAAY,OAAO,YAAY,OAAO,QAAQA,CAAK,EACpE,IAAI,CAAC,CAACC,EAAKC,CAAK,KAChBD,EAAMJ,EAAiBI,CAAG,GAAKA,EAC/BC,EAAQD,IAAQ,cAAgB,OAAOC,CAAK,EAAIA,EACzC,CAACD,EAAKC,CAAK,EAClB,CAAC,CAAyB,CAC7B,CAOO,SAASC,EAAoBC,EAAqB,CACxD,MAAMC,EAAWD,EAAI,QAAQ,GAAG,EAC5BC,EAAW,IACdD,EAAMA,EAAI,UAAU,EAAGC,CAAQ,GAGhC,MAAMC,EAAQF,EAAI,MAAM,GAAG,EAC3B,IAAIG,EACJ,GACCA,EAASD,EAAMA,EAAM,OAAS,CAAC,EAC/BA,EAAM,IAAA,QAGE,CAACC,GAAUD,EAAM,OAAS,GAEnC,OAAO,OAAOC,CAAM,CACrB,CAOO,SAASC,EAAUC,EAAwC,CACjE,GAAI,SAAUA,GAAc,EAAE,gBAAiBA,GAC9C,MAAO,CAAE,GAAGA,CAAA,EAGb,MAAMC,EAA+B,CAAE,GAAGD,CAAA,EAC1C,OAAAC,EAAI,KAAOA,EAAI,YACf,OAAOA,EAAI,YAEJA,CACR,CAOO,SAASC,EAAkBC,EAAuB,CAC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api-DlsqY5DV.chunk.mjs.map.license b/dist/api-CrmL42y-.chunk.mjs.map.license similarity index 100% rename from dist/api-DlsqY5DV.chunk.mjs.map.license rename to dist/api-CrmL42y-.chunk.mjs.map.license diff --git a/dist/dav-CufFHsl4.chunk.mjs b/dist/dav-CMOydKDk.chunk.mjs similarity index 96% rename from dist/dav-CufFHsl4.chunk.mjs rename to dist/dav-CMOydKDk.chunk.mjs index 2937b9d604db8..802be117ce7a9 100644 --- a/dist/dav-CufFHsl4.chunk.mjs +++ b/dist/dav-CMOydKDk.chunk.mjs @@ -1,2 +1,2 @@ -import{a as h,b as N,o as y}from"./index-Bndk0DrU.chunk.mjs";import{f as E}from"./createElementId-DhjFt1I9-CNrdQIoZ.chunk.mjs";import{i as l,b}from"./index-xFugdZPW.chunk.mjs";import{l as D,_ as $}from"./index-JSJM6V6X.chunk.mjs";import{s as n,l as u,N as P,a as T,b as R,P as i}from"./folder-D9CBQngR-CuPN_AFd.chunk.mjs";function x(e=""){let s=i.NONE;return e&&(e.includes("G")&&(s|=i.READ),e.includes("W")&&(s|=i.WRITE),e.includes("CK")&&(s|=i.CREATE),e.includes("NV")&&(s|=i.UPDATE),e.includes("D")&&(s|=i.DELETE),e.includes("R")&&(s|=i.SHARE)),s}const v=["d:getcontentlength","d:getcontenttype","d:getetag","d:getlastmodified","d:creationdate","d:displayname","d:quota-available-bytes","d:resourcetype","nc:has-preview","nc:is-encrypted","nc:mount-type","oc:comments-unread","oc:favorite","oc:fileid","oc:owner-display-name","oc:owner-id","oc:permissions","oc:size"],g={d:"DAV:",nc:"http://nextcloud.org/ns",oc:"http://owncloud.org/ns",ocs:"http://open-collaboration-services.org/ns"};function S(e,s={nc:"http://nextcloud.org/ns"}){n.davNamespaces??={...g},n.davProperties??=[...v];const a={...n.davNamespaces,...s};if(n.davProperties.find(t=>t===e))return u.warn(`${e} already registered`,{prop:e}),!1;if(e.startsWith("<")||e.split(":").length!==2)return u.error(`${e} is not valid. See example: 'oc:fileid'`,{prop:e}),!1;const o=e.split(":")[0];return a[o]?(n.davProperties.push(e),n.davNamespaces=a,!0):(u.error(`${e} namespace unknown`,{prop:e,namespaces:a}),!1)}function z(){return n.davProperties??=[...v],n.davProperties.map(e=>`<${e} />`).join(" ")}function C(){return n.davNamespaces??={...g},Object.keys(n.davNamespaces).map(e=>`xmlns:${e}="${n.davNamespaces?.[e]}"`).join(" ")}function A(){return l()?`/files/${b()}`:`/files/${h()?.uid}`}const q=A();function W(){const e=E("dav");return l()?e.replace("remote.php","public.php"):e}const w=W();function O(e=w,s={}){const a=D(e,{headers:s});function o(t){a.setHeaders({...s,"X-Requested-With":"XMLHttpRequest",requesttoken:t??""})}return y(o),o(N()),$().patch("fetch",(t,r)=>{const c=r.headers;return c?.method&&(r.method=c.method,delete c.method),fetch(t,r)}),a}function U(e,s=q,a=w){let o=h()?.uid;if(l())o=o??"anonymous";else if(!o)throw new Error("No user id found");const t=e.props,r=x(t?.permissions),c=String(t?.["owner-id"]||o),f=t.fileid||0,d=new Date(Date.parse(e.lastmod)),p=new Date(Date.parse(t.creationdate)),m={id:f,source:`${a}${e.filename}`,mtime:!isNaN(d.getTime())&&d.getTime()!==0?d:void 0,crtime:!isNaN(p.getTime())&&p.getTime()!==0?p:void 0,mime:e.mime||"application/octet-stream",displayname:t.displayname!==void 0?String(t.displayname):void 0,size:t?.size||Number.parseInt(t.getcontentlength||"0"),status:f<0?P.FAILED:void 0,permissions:r,owner:c,root:s,attributes:{...e,...t,hasPreview:t?.["has-preview"]}};return delete m.attributes?.props,e.type==="file"?new T(m):new R(m)}export{C as a,z as b,S as c,w as d,W as e,A as f,O as g,U as r}; -//# sourceMappingURL=dav-CufFHsl4.chunk.mjs.map +import{a as h,b as N,o as y}from"./index-Bndk0DrU.chunk.mjs";import{f as E}from"./createElementId-DhjFt1I9-CNrdQIoZ.chunk.mjs";import{i as l,b}from"./index-xFugdZPW.chunk.mjs";import{l as D,_ as $}from"./index-JSJM6V6X.chunk.mjs";import{s as n,l as u,N as P,a as T,b as R,P as i}from"./folder-29HuacU_-CwocT1ij.chunk.mjs";function x(e=""){let s=i.NONE;return e&&(e.includes("G")&&(s|=i.READ),e.includes("W")&&(s|=i.WRITE),e.includes("CK")&&(s|=i.CREATE),e.includes("NV")&&(s|=i.UPDATE),e.includes("D")&&(s|=i.DELETE),e.includes("R")&&(s|=i.SHARE)),s}const v=["d:getcontentlength","d:getcontenttype","d:getetag","d:getlastmodified","d:creationdate","d:displayname","d:quota-available-bytes","d:resourcetype","nc:has-preview","nc:is-encrypted","nc:mount-type","oc:comments-unread","oc:favorite","oc:fileid","oc:owner-display-name","oc:owner-id","oc:permissions","oc:size"],g={d:"DAV:",nc:"http://nextcloud.org/ns",oc:"http://owncloud.org/ns",ocs:"http://open-collaboration-services.org/ns"};function S(e,s={nc:"http://nextcloud.org/ns"}){n.davNamespaces??={...g},n.davProperties??=[...v];const a={...n.davNamespaces,...s};if(n.davProperties.find(t=>t===e))return u.warn(`${e} already registered`,{prop:e}),!1;if(e.startsWith("<")||e.split(":").length!==2)return u.error(`${e} is not valid. See example: 'oc:fileid'`,{prop:e}),!1;const o=e.split(":")[0];return a[o]?(n.davProperties.push(e),n.davNamespaces=a,!0):(u.error(`${e} namespace unknown`,{prop:e,namespaces:a}),!1)}function z(){return n.davProperties??=[...v],n.davProperties.map(e=>`<${e} />`).join(" ")}function C(){return n.davNamespaces??={...g},Object.keys(n.davNamespaces).map(e=>`xmlns:${e}="${n.davNamespaces?.[e]}"`).join(" ")}function A(){return l()?`/files/${b()}`:`/files/${h()?.uid}`}const q=A();function W(){const e=E("dav");return l()?e.replace("remote.php","public.php"):e}const w=W();function O(e=w,s={}){const a=D(e,{headers:s});function o(t){a.setHeaders({...s,"X-Requested-With":"XMLHttpRequest",requesttoken:t??""})}return y(o),o(N()),$().patch("fetch",(t,r)=>{const c=r.headers;return c?.method&&(r.method=c.method,delete c.method),fetch(t,r)}),a}function U(e,s=q,a=w){let o=h()?.uid;if(l())o=o??"anonymous";else if(!o)throw new Error("No user id found");const t=e.props,r=x(t?.permissions),c=String(t?.["owner-id"]||o),f=t.fileid||0,d=new Date(Date.parse(e.lastmod)),p=new Date(Date.parse(t.creationdate)),m={id:f,source:`${a}${e.filename}`,mtime:!isNaN(d.getTime())&&d.getTime()!==0?d:void 0,crtime:!isNaN(p.getTime())&&p.getTime()!==0?p:void 0,mime:e.mime||"application/octet-stream",displayname:t.displayname!==void 0?String(t.displayname):void 0,size:t?.size||Number.parseInt(t.getcontentlength||"0"),status:f<0?P.FAILED:void 0,permissions:r,owner:c,root:s,attributes:{...e,...t,hasPreview:t?.["has-preview"]}};return delete m.attributes?.props,e.type==="file"?new T(m):new R(m)}export{C as a,z as b,S as c,w as d,W as e,A as f,O as g,U as r}; +//# sourceMappingURL=dav-CMOydKDk.chunk.mjs.map diff --git a/dist/dav-CufFHsl4.chunk.mjs.license b/dist/dav-CMOydKDk.chunk.mjs.license similarity index 90% rename from dist/dav-CufFHsl4.chunk.mjs.license rename to dist/dav-CMOydKDk.chunk.mjs.license index 62b49fdbf837d..42d500e0bc625 100644 --- a/dist/dav-CufFHsl4.chunk.mjs.license +++ b/dist/dav-CMOydKDk.chunk.mjs.license @@ -3,5 +3,5 @@ SPDX-FileCopyrightText: Nextcloud GmbH and Nextcloud contributors This file is generated from multiple sources. Included packages: - @nextcloud/files - - version: 4.0.0-rc.3 + - version: 4.0.0 - license: AGPL-3.0-or-later diff --git a/dist/dav-CufFHsl4.chunk.mjs.map b/dist/dav-CMOydKDk.chunk.mjs.map similarity index 98% rename from dist/dav-CufFHsl4.chunk.mjs.map rename to dist/dav-CMOydKDk.chunk.mjs.map index bfa837d7fe8f0..2334824be970f 100644 --- a/dist/dav-CufFHsl4.chunk.mjs.map +++ b/dist/dav-CMOydKDk.chunk.mjs.map @@ -1 +1 @@ -{"version":3,"file":"dav-CufFHsl4.chunk.mjs","sources":["../node_modules/@nextcloud/files/dist/dav.mjs"],"sourcesContent":["import { getCurrentUser, onRequestTokenUpdate, getRequestToken } from \"@nextcloud/auth\";\nimport { generateRemoteUrl } from \"@nextcloud/router\";\nimport { isPublicShare, getSharingToken } from \"@nextcloud/sharing/public\";\nimport { createClient, getPatcher } from \"webdav\";\nimport { P as Permission, s as scopedGlobals, l as logger, c as NodeStatus, a as File, b as Folder } from \"./chunks/folder-D9CBQngR.mjs\";\nimport \"@nextcloud/paths\";\n/*!\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nfunction parsePermissions(permString = \"\") {\n let permissions = Permission.NONE;\n if (!permString) {\n return permissions;\n }\n if (permString.includes(\"G\")) {\n permissions |= Permission.READ;\n }\n if (permString.includes(\"W\")) {\n permissions |= Permission.WRITE;\n }\n if (permString.includes(\"CK\")) {\n permissions |= Permission.CREATE;\n }\n if (permString.includes(\"NV\")) {\n permissions |= Permission.UPDATE;\n }\n if (permString.includes(\"D\")) {\n permissions |= Permission.DELETE;\n }\n if (permString.includes(\"R\")) {\n permissions |= Permission.SHARE;\n }\n return permissions;\n}\nconst defaultDavProperties = [\n \"d:getcontentlength\",\n \"d:getcontenttype\",\n \"d:getetag\",\n \"d:getlastmodified\",\n \"d:creationdate\",\n \"d:displayname\",\n \"d:quota-available-bytes\",\n \"d:resourcetype\",\n \"nc:has-preview\",\n \"nc:is-encrypted\",\n \"nc:mount-type\",\n \"oc:comments-unread\",\n \"oc:favorite\",\n \"oc:fileid\",\n \"oc:owner-display-name\",\n \"oc:owner-id\",\n \"oc:permissions\",\n \"oc:size\"\n];\nconst defaultDavNamespaces = {\n d: \"DAV:\",\n nc: \"http://nextcloud.org/ns\",\n oc: \"http://owncloud.org/ns\",\n ocs: \"http://open-collaboration-services.org/ns\"\n};\nfunction registerDavProperty(prop, namespace = { nc: \"http://nextcloud.org/ns\" }) {\n scopedGlobals.davNamespaces ??= { ...defaultDavNamespaces };\n scopedGlobals.davProperties ??= [...defaultDavProperties];\n const namespaces = { ...scopedGlobals.davNamespaces, ...namespace };\n if (scopedGlobals.davProperties.find((search) => search === prop)) {\n logger.warn(`${prop} already registered`, { prop });\n return false;\n }\n if (prop.startsWith(\"<\") || prop.split(\":\").length !== 2) {\n logger.error(`${prop} is not valid. See example: 'oc:fileid'`, { prop });\n return false;\n }\n const ns = prop.split(\":\")[0];\n if (!namespaces[ns]) {\n logger.error(`${prop} namespace unknown`, { prop, namespaces });\n return false;\n }\n scopedGlobals.davProperties.push(prop);\n scopedGlobals.davNamespaces = namespaces;\n return true;\n}\nfunction getDavProperties() {\n scopedGlobals.davProperties ??= [...defaultDavProperties];\n return scopedGlobals.davProperties.map((prop) => `<${prop} />`).join(\" \");\n}\nfunction getDavNameSpaces() {\n scopedGlobals.davNamespaces ??= { ...defaultDavNamespaces };\n return Object.keys(scopedGlobals.davNamespaces).map((ns) => `xmlns:${ns}=\"${scopedGlobals.davNamespaces?.[ns]}\"`).join(\" \");\n}\nfunction getDefaultPropfind() {\n return `\n\t\t\n\t\t\t\n\t\t\t\t${getDavProperties()}\n\t\t\t\n\t\t`;\n}\nfunction getFavoritesReport() {\n return `\n\t\t\n\t\t\t\n\t\t\t\t${getDavProperties()}\n\t\t\t\n\t\t\t\n\t\t\t\t1\n\t\t\t\n\t\t`;\n}\nfunction getRecentSearch(lastModified) {\n return `\n\n\t\n\t\t\n\t\t\t\n\t\t\t\t${getDavProperties()}\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t/files/${getCurrentUser()?.uid}/\n\t\t\t\tinfinity\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\thttpd/unix-directory\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t0\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t${lastModified}\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t100\n\t\t\t0\n\t\t\n\t\n`;\n}\nfunction getRootPath() {\n if (isPublicShare()) {\n return `/files/${getSharingToken()}`;\n }\n return `/files/${getCurrentUser()?.uid}`;\n}\nconst defaultRootPath = getRootPath();\nfunction getRemoteURL() {\n const url = generateRemoteUrl(\"dav\");\n if (isPublicShare()) {\n return url.replace(\"remote.php\", \"public.php\");\n }\n return url;\n}\nconst defaultRemoteURL = getRemoteURL();\nfunction getClient(remoteURL = defaultRemoteURL, headers = {}) {\n const client = createClient(remoteURL, { headers });\n function setHeaders(token) {\n client.setHeaders({\n ...headers,\n // Add this so the server knows it is an request from the browser\n \"X-Requested-With\": \"XMLHttpRequest\",\n // Inject user auth\n requesttoken: token ?? \"\"\n });\n }\n onRequestTokenUpdate(setHeaders);\n setHeaders(getRequestToken());\n const patcher = getPatcher();\n patcher.patch(\"fetch\", (url, options) => {\n const headers2 = options.headers;\n if (headers2?.method) {\n options.method = headers2.method;\n delete headers2.method;\n }\n return fetch(url, options);\n });\n return client;\n}\nasync function getFavoriteNodes(options = {}) {\n const client = options.client ?? getClient();\n const path = options.path ?? \"/\";\n const davRoot = options.davRoot ?? defaultRootPath;\n const contentsResponse = await client.getDirectoryContents(`${davRoot}${path}`, {\n signal: options.signal,\n details: true,\n data: getFavoritesReport(),\n headers: {\n // see getClient for patched webdav client\n method: \"REPORT\"\n },\n includeSelf: true\n });\n return contentsResponse.data.filter((node) => node.filename !== path).map((result) => resultToNode(result, davRoot));\n}\nfunction resultToNode(node, filesRoot = defaultRootPath, remoteURL = defaultRemoteURL) {\n let userId = getCurrentUser()?.uid;\n if (isPublicShare()) {\n userId = userId ?? \"anonymous\";\n } else if (!userId) {\n throw new Error(\"No user id found\");\n }\n const props = node.props;\n const permissions = parsePermissions(props?.permissions);\n const owner = String(props?.[\"owner-id\"] || userId);\n const id = props.fileid || 0;\n const mtime = new Date(Date.parse(node.lastmod));\n const crtime = new Date(Date.parse(props.creationdate));\n const nodeData = {\n id,\n source: `${remoteURL}${node.filename}`,\n mtime: !isNaN(mtime.getTime()) && mtime.getTime() !== 0 ? mtime : void 0,\n crtime: !isNaN(crtime.getTime()) && crtime.getTime() !== 0 ? crtime : void 0,\n mime: node.mime || \"application/octet-stream\",\n // Manually cast to work around for https://github.com/perry-mitchell/webdav-client/pull/380\n displayname: props.displayname !== void 0 ? String(props.displayname) : void 0,\n size: props?.size || Number.parseInt(props.getcontentlength || \"0\"),\n // The fileid is set to -1 for failed requests\n status: id < 0 ? NodeStatus.FAILED : void 0,\n permissions,\n owner,\n root: filesRoot,\n attributes: {\n ...node,\n ...props,\n hasPreview: props?.[\"has-preview\"]\n }\n };\n delete nodeData.attributes?.props;\n return node.type === \"file\" ? new File(nodeData) : new Folder(nodeData);\n}\nexport {\n defaultDavNamespaces,\n defaultDavProperties,\n defaultRemoteURL,\n defaultRootPath,\n getClient,\n getDavNameSpaces,\n getDavProperties,\n getDefaultPropfind,\n getFavoriteNodes,\n getFavoritesReport,\n getRecentSearch,\n getRemoteURL,\n getRootPath,\n parsePermissions,\n registerDavProperty,\n resultToNode\n};\n//# sourceMappingURL=dav.mjs.map\n"],"names":["parsePermissions","permString","permissions","Permission","defaultDavProperties","defaultDavNamespaces","registerDavProperty","prop","namespace","scopedGlobals","namespaces","search","logger","ns","getDavProperties","getDavNameSpaces","getRootPath","isPublicShare","getSharingToken","getCurrentUser","defaultRootPath","getRemoteURL","url","generateRemoteUrl","defaultRemoteURL","getClient","remoteURL","headers","client","createClient","setHeaders","token","onRequestTokenUpdate","getRequestToken","getPatcher","options","headers2","resultToNode","node","filesRoot","userId","props","owner","id","mtime","crtime","nodeData","NodeStatus","File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,EACfuB,EAASA,GAAU,oBACV,CAACA,EACV,MAAM,IAAI,MAAM,kBAAkB,EAEpC,MAAMC,EAAQH,EAAK,MACbpC,EAAcF,EAAiByC,GAAO,WAAW,EACjDC,EAAQ,OAAOD,IAAQ,UAAU,GAAKD,CAAM,EAC5CG,EAAKF,EAAM,QAAU,EACrBG,EAAQ,IAAI,KAAK,KAAK,MAAMN,EAAK,OAAO,CAAC,EACzCO,EAAS,IAAI,KAAK,KAAK,MAAMJ,EAAM,YAAY,CAAC,EAChDK,EAAW,CACf,GAAAH,EACA,OAAQ,GAAGjB,CAAS,GAAGY,EAAK,QAAQ,GACpC,MAAO,CAAC,MAAMM,EAAM,QAAO,CAAE,GAAKA,EAAM,QAAO,IAAO,EAAIA,EAAQ,OAClE,OAAQ,CAAC,MAAMC,EAAO,QAAO,CAAE,GAAKA,EAAO,QAAO,IAAO,EAAIA,EAAS,OACtE,KAAMP,EAAK,MAAQ,2BAEnB,YAAaG,EAAM,cAAgB,OAAS,OAAOA,EAAM,WAAW,EAAI,OACxE,KAAMA,GAAO,MAAQ,OAAO,SAASA,EAAM,kBAAoB,GAAG,EAElE,OAAQE,EAAK,EAAII,EAAW,OAAS,OACrC,YAAA7C,EACA,MAAAwC,EACA,KAAMH,EACN,WAAY,CACV,GAAGD,EACH,GAAGG,EACH,WAAYA,IAAQ,aAAa,CACvC,CACA,EACE,OAAA,OAAOK,EAAS,YAAY,MACrBR,EAAK,OAAS,OAAS,IAAIU,EAAKF,CAAQ,EAAI,IAAIG,EAAOH,CAAQ,CACxE","x_google_ignoreList":[0]} \ No newline at end of file +{"version":3,"file":"dav-CMOydKDk.chunk.mjs","sources":["../node_modules/@nextcloud/files/dist/dav.mjs"],"sourcesContent":["import { getCurrentUser, onRequestTokenUpdate, getRequestToken } from \"@nextcloud/auth\";\nimport { generateRemoteUrl } from \"@nextcloud/router\";\nimport { isPublicShare, getSharingToken } from \"@nextcloud/sharing/public\";\nimport { createClient, getPatcher } from \"webdav\";\nimport { P as Permission, s as scopedGlobals, l as logger, c as NodeStatus, a as File, b as Folder } from \"./chunks/folder-29HuacU_.mjs\";\nimport \"@nextcloud/paths\";\n/*!\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nfunction parsePermissions(permString = \"\") {\n let permissions = Permission.NONE;\n if (!permString) {\n return permissions;\n }\n if (permString.includes(\"G\")) {\n permissions |= Permission.READ;\n }\n if (permString.includes(\"W\")) {\n permissions |= Permission.WRITE;\n }\n if (permString.includes(\"CK\")) {\n permissions |= Permission.CREATE;\n }\n if (permString.includes(\"NV\")) {\n permissions |= Permission.UPDATE;\n }\n if (permString.includes(\"D\")) {\n permissions |= Permission.DELETE;\n }\n if (permString.includes(\"R\")) {\n permissions |= Permission.SHARE;\n }\n return permissions;\n}\nconst defaultDavProperties = [\n \"d:getcontentlength\",\n \"d:getcontenttype\",\n \"d:getetag\",\n \"d:getlastmodified\",\n \"d:creationdate\",\n \"d:displayname\",\n \"d:quota-available-bytes\",\n \"d:resourcetype\",\n \"nc:has-preview\",\n \"nc:is-encrypted\",\n \"nc:mount-type\",\n \"oc:comments-unread\",\n \"oc:favorite\",\n \"oc:fileid\",\n \"oc:owner-display-name\",\n \"oc:owner-id\",\n \"oc:permissions\",\n \"oc:size\"\n];\nconst defaultDavNamespaces = {\n d: \"DAV:\",\n nc: \"http://nextcloud.org/ns\",\n oc: \"http://owncloud.org/ns\",\n ocs: \"http://open-collaboration-services.org/ns\"\n};\nfunction registerDavProperty(prop, namespace = { nc: \"http://nextcloud.org/ns\" }) {\n scopedGlobals.davNamespaces ??= { ...defaultDavNamespaces };\n scopedGlobals.davProperties ??= [...defaultDavProperties];\n const namespaces = { ...scopedGlobals.davNamespaces, ...namespace };\n if (scopedGlobals.davProperties.find((search) => search === prop)) {\n logger.warn(`${prop} already registered`, { prop });\n return false;\n }\n if (prop.startsWith(\"<\") || prop.split(\":\").length !== 2) {\n logger.error(`${prop} is not valid. See example: 'oc:fileid'`, { prop });\n return false;\n }\n const ns = prop.split(\":\")[0];\n if (!namespaces[ns]) {\n logger.error(`${prop} namespace unknown`, { prop, namespaces });\n return false;\n }\n scopedGlobals.davProperties.push(prop);\n scopedGlobals.davNamespaces = namespaces;\n return true;\n}\nfunction getDavProperties() {\n scopedGlobals.davProperties ??= [...defaultDavProperties];\n return scopedGlobals.davProperties.map((prop) => `<${prop} />`).join(\" \");\n}\nfunction getDavNameSpaces() {\n scopedGlobals.davNamespaces ??= { ...defaultDavNamespaces };\n return Object.keys(scopedGlobals.davNamespaces).map((ns) => `xmlns:${ns}=\"${scopedGlobals.davNamespaces?.[ns]}\"`).join(\" \");\n}\nfunction getDefaultPropfind() {\n return `\n\t\t\n\t\t\t\n\t\t\t\t${getDavProperties()}\n\t\t\t\n\t\t`;\n}\nfunction getFavoritesReport() {\n return `\n\t\t\n\t\t\t\n\t\t\t\t${getDavProperties()}\n\t\t\t\n\t\t\t\n\t\t\t\t1\n\t\t\t\n\t\t`;\n}\nfunction getRecentSearch(lastModified) {\n return `\n\n\t\n\t\t\n\t\t\t\n\t\t\t\t${getDavProperties()}\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t/files/${getCurrentUser()?.uid}/\n\t\t\t\tinfinity\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\thttpd/unix-directory\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t0\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t${lastModified}\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t100\n\t\t\t0\n\t\t\n\t\n`;\n}\nfunction getRootPath() {\n if (isPublicShare()) {\n return `/files/${getSharingToken()}`;\n }\n return `/files/${getCurrentUser()?.uid}`;\n}\nconst defaultRootPath = getRootPath();\nfunction getRemoteURL() {\n const url = generateRemoteUrl(\"dav\");\n if (isPublicShare()) {\n return url.replace(\"remote.php\", \"public.php\");\n }\n return url;\n}\nconst defaultRemoteURL = getRemoteURL();\nfunction getClient(remoteURL = defaultRemoteURL, headers = {}) {\n const client = createClient(remoteURL, { headers });\n function setHeaders(token) {\n client.setHeaders({\n ...headers,\n // Add this so the server knows it is an request from the browser\n \"X-Requested-With\": \"XMLHttpRequest\",\n // Inject user auth\n requesttoken: token ?? \"\"\n });\n }\n onRequestTokenUpdate(setHeaders);\n setHeaders(getRequestToken());\n const patcher = getPatcher();\n patcher.patch(\"fetch\", (url, options) => {\n const headers2 = options.headers;\n if (headers2?.method) {\n options.method = headers2.method;\n delete headers2.method;\n }\n return fetch(url, options);\n });\n return client;\n}\nasync function getFavoriteNodes(options = {}) {\n const client = options.client ?? getClient();\n const path = options.path ?? \"/\";\n const davRoot = options.davRoot ?? defaultRootPath;\n const contentsResponse = await client.getDirectoryContents(`${davRoot}${path}`, {\n signal: options.signal,\n details: true,\n data: getFavoritesReport(),\n headers: {\n // see getClient for patched webdav client\n method: \"REPORT\"\n },\n includeSelf: true\n });\n return contentsResponse.data.filter((node) => node.filename !== path).map((result) => resultToNode(result, davRoot));\n}\nfunction resultToNode(node, filesRoot = defaultRootPath, remoteURL = defaultRemoteURL) {\n let userId = getCurrentUser()?.uid;\n if (isPublicShare()) {\n userId = userId ?? \"anonymous\";\n } else if (!userId) {\n throw new Error(\"No user id found\");\n }\n const props = node.props;\n const permissions = parsePermissions(props?.permissions);\n const owner = String(props?.[\"owner-id\"] || userId);\n const id = props.fileid || 0;\n const mtime = new Date(Date.parse(node.lastmod));\n const crtime = new Date(Date.parse(props.creationdate));\n const nodeData = {\n id,\n source: `${remoteURL}${node.filename}`,\n mtime: !isNaN(mtime.getTime()) && mtime.getTime() !== 0 ? mtime : void 0,\n crtime: !isNaN(crtime.getTime()) && crtime.getTime() !== 0 ? crtime : void 0,\n mime: node.mime || \"application/octet-stream\",\n // Manually cast to work around for https://github.com/perry-mitchell/webdav-client/pull/380\n displayname: props.displayname !== void 0 ? String(props.displayname) : void 0,\n size: props?.size || Number.parseInt(props.getcontentlength || \"0\"),\n // The fileid is set to -1 for failed requests\n status: id < 0 ? NodeStatus.FAILED : void 0,\n permissions,\n owner,\n root: filesRoot,\n attributes: {\n ...node,\n ...props,\n hasPreview: props?.[\"has-preview\"]\n }\n };\n delete nodeData.attributes?.props;\n return node.type === \"file\" ? new File(nodeData) : new Folder(nodeData);\n}\nexport {\n defaultDavNamespaces,\n defaultDavProperties,\n defaultRemoteURL,\n defaultRootPath,\n getClient,\n getDavNameSpaces,\n getDavProperties,\n getDefaultPropfind,\n getFavoriteNodes,\n getFavoritesReport,\n getRecentSearch,\n getRemoteURL,\n getRootPath,\n parsePermissions,\n registerDavProperty,\n resultToNode\n};\n//# sourceMappingURL=dav.mjs.map\n"],"names":["parsePermissions","permString","permissions","Permission","defaultDavProperties","defaultDavNamespaces","registerDavProperty","prop","namespace","scopedGlobals","namespaces","search","logger","ns","getDavProperties","getDavNameSpaces","getRootPath","isPublicShare","getSharingToken","getCurrentUser","defaultRootPath","getRemoteURL","url","generateRemoteUrl","defaultRemoteURL","getClient","remoteURL","headers","client","createClient","setHeaders","token","onRequestTokenUpdate","getRequestToken","getPatcher","options","headers2","resultToNode","node","filesRoot","userId","props","owner","id","mtime","crtime","nodeData","NodeStatus","File","Folder"],"mappings":"kUAUA,SAASA,EAAiBC,EAAa,GAAI,CACzC,IAAIC,EAAcC,EAAW,KAC7B,OAAKF,IAGDA,EAAW,SAAS,GAAG,IACzBC,GAAeC,EAAW,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AAQ,OAAOD,IAAQ,UAAU,GAAKD,CAAM,EAC5CG,EAAKF,EAAM,QAAU,EACrBG,EAAQ,IAAI,KAAK,KAAK,MAAMN,EAAK,OAAO,CAAC,EACzCO,EAAS,IAAI,KAAK,KAAK,MAAMJ,EAAM,YAAY,CAAC,EAChDK,EAAW,CACf,GAAAH,EACA,OAAQ,GAAGjB,CAAS,GAAGY,EAAK,QAAQ,GACpC,MAAO,CAAC,MAAMM,EAAM,QAAO,CAAE,GAAKA,EAAM,QAAO,IAAO,EAAIA,EAAQ,OAClE,OAAQ,CAAC,MAAMC,EAAO,QAAO,CAAE,GAAKA,EAAO,QAAO,IAAO,EAAIA,EAAS,OACtE,KAAMP,EAAK,MAAQ,2BAEnB,YAAaG,EAAM,cAAgB,OAAS,OAAOA,EAAM,WAAW,EAAI,OACxE,KAAMA,GAAO,MAAQ,OAAO,SAASA,EAAM,kBAAoB,GAAG,EAElE,OAAQE,EAAK,EAAII,EAAW,OAAS,OACrC,YAAA7C,EACA,MAAAwC,EACA,KAAMH,EACN,WAAY,CACV,GAAGD,EACH,GAAGG,EACH,WAAYA,IAAQ,aAAa,CACvC,CACA,EACE,OAAA,OAAOK,EAAS,YAAY,MACrBR,EAAK,OAAS,OAAS,IAAIU,EAAKF,CAAQ,EAAI,IAAIG,EAAOH,CAAQ,CACxE","x_google_ignoreList":[0]} \ No newline at end of file diff --git a/dist/dav-CufFHsl4.chunk.mjs.map.license b/dist/dav-CMOydKDk.chunk.mjs.map.license similarity index 90% rename from dist/dav-CufFHsl4.chunk.mjs.map.license rename to dist/dav-CMOydKDk.chunk.mjs.map.license index 62b49fdbf837d..42d500e0bc625 100644 --- a/dist/dav-CufFHsl4.chunk.mjs.map.license +++ b/dist/dav-CMOydKDk.chunk.mjs.map.license @@ -3,5 +3,5 @@ SPDX-FileCopyrightText: Nextcloud GmbH and Nextcloud contributors This file is generated from multiple sources. Included packages: - @nextcloud/files - - version: 4.0.0-rc.3 + - version: 4.0.0 - license: AGPL-3.0-or-later diff --git a/dist/files_external-init.mjs b/dist/files_external-init.mjs index d64e6bfac3d1f..07721751ac827 100644 --- a/dist/files_external-init.mjs +++ b/dist/files_external-init.mjs @@ -1,3 +1,3 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=[window.OC.filePath('', '', 'dist/CredentialsDialog-D1vWW4wH.chunk.mjs'),window.OC.filePath('', '', 'dist/translation-DoG5ZELJ-Bni_xMHF.chunk.mjs'),window.OC.filePath('', '', 'dist/index-Bndk0DrU.chunk.mjs'),window.OC.filePath('', '', 'dist/index-Cg5VsXN5.chunk.mjs'),window.OC.filePath('', '', 'dist/runtime-dom.esm-bundler-CU8rrbZA.chunk.mjs'),window.OC.filePath('', '', 'dist/createElementId-DhjFt1I9-CNrdQIoZ.chunk.mjs'),window.OC.filePath('', '', 'dist/createElementId-DhjFt1I9-C_oBIsvc.chunk.css'),window.OC.filePath('', '', 'dist/logger-D3RVzcfQ-B9jnX7-s.chunk.mjs'),window.OC.filePath('', '', 'dist/logger-D3RVzcfQ-R3us1MM8.chunk.css'),window.OC.filePath('', '', 'dist/mdi-DXIZZeEd.chunk.mjs'),window.OC.filePath('', '', 'dist/mdi-BYHcrfvW.chunk.css'),window.OC.filePath('', '', 'dist/index-CySLkPBX.chunk.css'),window.OC.filePath('', '', 'dist/NcNoteCard-Cok_4Fld-BI3-Vu_l.chunk.mjs'),window.OC.filePath('', '', 'dist/NcNoteCard-Cok_4Fld-Jq77EThs.chunk.css'),window.OC.filePath('', '', 'dist/NcPasswordField-uaMO2pdt-D3pIyOm0.chunk.mjs'),window.OC.filePath('', '', 'dist/index-Conii63U.chunk.mjs'),window.OC.filePath('', '', 'dist/string_decoder-BO00msnV.chunk.mjs'),window.OC.filePath('', '', 'dist/index-xFugdZPW.chunk.mjs'),window.OC.filePath('', '', 'dist/NcInputField-o5OFv3z6-DW3Gcl3I.chunk.mjs'),window.OC.filePath('', '', 'dist/NcInputField-o5OFv3z6-BYlw6Xsd.chunk.css'),window.OC.filePath('', '', 'dist/NcPasswordField-uaMO2pdt-DxPSRxK-.chunk.css'),window.OC.filePath('', '', 'dist/TrashCanOutline-D95Fx13e.chunk.mjs')])))=>i.map(i=>d[i]); -import{D as x,g as C,V as E,C as p,b as c}from"./index-DNfSxz5H.chunk.mjs";import{_ as V,l as M}from"./index-xFugdZPW.chunk.mjs";import{t as s}from"./translation-DoG5ZELJ-Bni_xMHF.chunk.mjs";import{c as l}from"./index-Conii63U.chunk.mjs";import{d as w,a as h,s as L,e as S}from"./index-JpgrUA2Z-Rp7fa0gf.chunk.mjs";import{e as _,a as u}from"./index-Bndk0DrU.chunk.mjs";import{a as T,P as A}from"./index-DjsbsIll.chunk.mjs";import{g as m,b as N,f as b}from"./createElementId-DhjFt1I9-CNrdQIoZ.chunk.mjs";import{s as P}from"./index-Cg5VsXN5.chunk.mjs";import{S as a}from"./types-CG_Kkihj.chunk.mjs";import{F as k,b as y,P as d}from"./folder-D9CBQngR-CuPN_AFd.chunk.mjs";import{a as D}from"./runtime-dom.esm-bundler-CU8rrbZA.chunk.mjs";import"./string_decoder-BO00msnV.chunk.mjs";import"./NcNoteCard-Cok_4Fld-BI3-Vu_l.chunk.mjs";import"./logger-D3RVzcfQ-B9jnX7-s.chunk.mjs";import"./NcPasswordField-uaMO2pdt-D3pIyOm0.chunk.mjs";import"./NcInputField-o5OFv3z6-DW3Gcl3I.chunk.mjs";import"./mdi-DXIZZeEd.chunk.mjs";const I='',O='';function v(e){return e.status===void 0||e.status===a.Success?!1:e.userProvided||e.authMechanism==="password::global::user"}function H(e){if(e.type===k.File)return!1;const t=e.attributes;return!t.scope||!t.backend?!1:t.scope==="personal"||t.scope==="system"}T(l);async function R(e,t,n){const r=(await l.request({method:"PUT",url:m("apps/files_external/userglobalstorages/{id}",{id:e.attributes.id}),confirmPassword:A.Strict,data:{backendOptions:{user:t,password:n}}})).data;return r.status!==a.Success?(h(s("files_external","Unable to update this external storage config. {statusMessage}",{statusMessage:r?.statusMessage||""})),null):(w(s("files_external","New configuration successfully saved")),e.attributes.config=r,_("files:node:updated",e),!0)}const F="credentials-external-storage",U={id:F,displayName:()=>s("files","Enter missing credentials"),iconSvgInline:()=>O,enabled:({nodes:e})=>{if(e.length!==1||!e[0])return!1;const t=e[0];if(!H(t))return!1;const n=t.attributes?.config||{};return!!v(n)},async exec({nodes:e}){const{login:t,password:n}=await P(D(()=>V(()=>import("./CredentialsDialog-D1vWW4wH.chunk.mjs"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]),import.meta.url)))??{};if(t&&n)try{await R(e[0],t,n),w(s("files_external","Credentials successfully set"))}catch(r){h(s("files_external","Error while setting credentials: {error}",{error:r.message}))}return null},order:-1e3,default:x.DEFAULT,inline:()=>!0},$='',o=`/files/${u()?.uid}`;function B(e){const t=(e.path+"/"+e.name).replace(/^\//gm,"");return new y({id:e.id,source:b("dav"+o+"/"+t),root:o,owner:u()?.uid||null,permissions:e.config.status!==a.Success?d.NONE:e?.permissions||d.READ,attributes:{displayName:t,...e}})}async function Z(){const e=(await l.get(N("apps/files_external/api/v1/mounts"))).data.ocs.data.map(B);return{folder:new y({id:0,source:b("dav"+o),root:o,owner:u()?.uid||null,permissions:d.READ}),contents:e}}function j(e,t=!0){const n=t?"userglobalstorages":"userstorages";return l.get(m(`apps/files_external/${n}/${e}?testOnly=false`))}const q={id:"check-external-storage",displayName:()=>"",iconSvgInline:()=>"",enabled:({nodes:e})=>e.every(t=>H(t)===!0),exec:async()=>null,async renderInline({nodes:e}){if(e.length!==1||!e[0])return null;const t=e[0],n=document.createElement("span");n.className="files-list__row-status",n.innerHTML=s("files_external","Checking storage …");let r;try{const{data:i}=await j(t.attributes.id,t.attributes.scope==="system");if(r=i,t.attributes.config=r,_("files:node:updated",t),r.status!==a.Success)throw new Error(r?.statusMessage||s("files_external","There was an error with this external storage."));n.remove()}catch(i){i.response&&!r&&L(s("files_external","We were unable to check the external storage {basename}",{basename:t.basename})),n.innerHTML="";const f=r?v(r):!1,g=document.createElement("span");g.classList.add(`files-list__row-status--${f?"warning":"error"}`),f||(n.innerHTML=$,n.title=i.message),n.prepend(g)}return n},order:10},W={id:"open-in-files-external-storage",displayName:({nodes:e})=>(e?.[0]?.attributes?.config||{status:a.Indeterminate}).status!==a.Success?s("files_external","Examine this faulty external storage configuration"):s("files","Open in Files"),iconSvgInline:()=>"",enabled:({view:e})=>e.id==="extstoragemounts",async exec({nodes:e}){if(e[0]?.attributes?.config?.status!==a.Success){if(await S({name:s("files_external","External mount error"),text:s("files_external","There was an error with this external storage. Do you want to review this mount point config in the settings page?"),labelConfirm:s("files_external","Open settings"),labelReject:s("files_external","Ignore")})===!0){const t=u()?.isAdmin?"admin":"user";window.location.href=m(`/settings/${t}/externalstorages`)}return null}return window.OCP.Files.Router.goToRoute(null,{view:"files"},{dir:e[0].path}),null},order:-1e3,default:x.HIDDEN},Y=M("files_external","allowUserMounting",!1),z=C();z.register(new E({id:"extstoragemounts",name:s("files_external","External storage"),caption:s("files_external","List of external storage."),emptyCaption:Y?s("files_external","There is no external storage configured. You can configure them in your Personal settings."):s("files_external","There is no external storage configured and you don't have the permission to configure them."),emptyTitle:s("files_external","No external storage"),icon:I,order:30,columns:[new p({id:"storage-type",title:s("files_external","Storage type"),render(e){const t=e.attributes?.backend||s("files_external","Unknown"),n=document.createElement("span");return n.textContent=t,n}}),new p({id:"scope",title:s("files_external","Scope"),render(e){const t=document.createElement("span");let n=s("files_external","Personal");return e.attributes?.scope==="system"&&(n=s("files_external","System")),t.textContent=n,t}})],getContents:Z})),c(U),c(q),c(W); +import{D as x,g as C,V as E,C as p,b as c}from"./index-sQy2Ug64.chunk.mjs";import{_ as V,l as M}from"./index-xFugdZPW.chunk.mjs";import{t as s}from"./translation-DoG5ZELJ-Bni_xMHF.chunk.mjs";import{c as l}from"./index-Conii63U.chunk.mjs";import{d as w,a as h,s as L,e as S}from"./index-JpgrUA2Z-Rp7fa0gf.chunk.mjs";import{e as _,a as u}from"./index-Bndk0DrU.chunk.mjs";import{a as T,P as A}from"./index-DjsbsIll.chunk.mjs";import{g as m,b as N,f as b}from"./createElementId-DhjFt1I9-CNrdQIoZ.chunk.mjs";import{s as P}from"./index-Cg5VsXN5.chunk.mjs";import{S as a}from"./types-CG_Kkihj.chunk.mjs";import{F as k,b as y,P as d}from"./folder-29HuacU_-CwocT1ij.chunk.mjs";import{a as D}from"./runtime-dom.esm-bundler-CU8rrbZA.chunk.mjs";import"./string_decoder-BO00msnV.chunk.mjs";import"./NcNoteCard-Cok_4Fld-BI3-Vu_l.chunk.mjs";import"./logger-D3RVzcfQ-B9jnX7-s.chunk.mjs";import"./NcPasswordField-uaMO2pdt-D3pIyOm0.chunk.mjs";import"./NcInputField-o5OFv3z6-DW3Gcl3I.chunk.mjs";import"./mdi-DXIZZeEd.chunk.mjs";const I='',O='';function v(e){return e.status===void 0||e.status===a.Success?!1:e.userProvided||e.authMechanism==="password::global::user"}function H(e){if(e.type===k.File)return!1;const t=e.attributes;return!t.scope||!t.backend?!1:t.scope==="personal"||t.scope==="system"}T(l);async function R(e,t,n){const r=(await l.request({method:"PUT",url:m("apps/files_external/userglobalstorages/{id}",{id:e.attributes.id}),confirmPassword:A.Strict,data:{backendOptions:{user:t,password:n}}})).data;return r.status!==a.Success?(h(s("files_external","Unable to update this external storage config. {statusMessage}",{statusMessage:r?.statusMessage||""})),null):(w(s("files_external","New configuration successfully saved")),e.attributes.config=r,_("files:node:updated",e),!0)}const F="credentials-external-storage",U={id:F,displayName:()=>s("files","Enter missing credentials"),iconSvgInline:()=>O,enabled:({nodes:e})=>{if(e.length!==1||!e[0])return!1;const t=e[0];if(!H(t))return!1;const n=t.attributes?.config||{};return!!v(n)},async exec({nodes:e}){const{login:t,password:n}=await P(D(()=>V(()=>import("./CredentialsDialog-D1vWW4wH.chunk.mjs"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]),import.meta.url)))??{};if(t&&n)try{await R(e[0],t,n),w(s("files_external","Credentials successfully set"))}catch(r){h(s("files_external","Error while setting credentials: {error}",{error:r.message}))}return null},order:-1e3,default:x.DEFAULT,inline:()=>!0},$='',o=`/files/${u()?.uid}`;function B(e){const t=(e.path+"/"+e.name).replace(/^\//gm,"");return new y({id:e.id,source:b("dav"+o+"/"+t),root:o,owner:u()?.uid||null,permissions:e.config.status!==a.Success?d.NONE:e?.permissions||d.READ,attributes:{displayName:t,...e}})}async function Z(){const e=(await l.get(N("apps/files_external/api/v1/mounts"))).data.ocs.data.map(B);return{folder:new y({id:0,source:b("dav"+o),root:o,owner:u()?.uid||null,permissions:d.READ}),contents:e}}function j(e,t=!0){const n=t?"userglobalstorages":"userstorages";return l.get(m(`apps/files_external/${n}/${e}?testOnly=false`))}const q={id:"check-external-storage",displayName:()=>"",iconSvgInline:()=>"",enabled:({nodes:e})=>e.every(t=>H(t)===!0),exec:async()=>null,async renderInline({nodes:e}){if(e.length!==1||!e[0])return null;const t=e[0],n=document.createElement("span");n.className="files-list__row-status",n.innerHTML=s("files_external","Checking storage …");let r;try{const{data:i}=await j(t.attributes.id,t.attributes.scope==="system");if(r=i,t.attributes.config=r,_("files:node:updated",t),r.status!==a.Success)throw new Error(r?.statusMessage||s("files_external","There was an error with this external storage."));n.remove()}catch(i){i.response&&!r&&L(s("files_external","We were unable to check the external storage {basename}",{basename:t.basename})),n.innerHTML="";const f=r?v(r):!1,g=document.createElement("span");g.classList.add(`files-list__row-status--${f?"warning":"error"}`),f||(n.innerHTML=$,n.title=i.message),n.prepend(g)}return n},order:10},W={id:"open-in-files-external-storage",displayName:({nodes:e})=>(e?.[0]?.attributes?.config||{status:a.Indeterminate}).status!==a.Success?s("files_external","Examine this faulty external storage configuration"):s("files","Open in Files"),iconSvgInline:()=>"",enabled:({view:e})=>e.id==="extstoragemounts",async exec({nodes:e}){if(e[0]?.attributes?.config?.status!==a.Success){if(await S({name:s("files_external","External mount error"),text:s("files_external","There was an error with this external storage. Do you want to review this mount point config in the settings page?"),labelConfirm:s("files_external","Open settings"),labelReject:s("files_external","Ignore")})===!0){const t=u()?.isAdmin?"admin":"user";window.location.href=m(`/settings/${t}/externalstorages`)}return null}return window.OCP.Files.Router.goToRoute(null,{view:"files"},{dir:e[0].path}),null},order:-1e3,default:x.HIDDEN},Y=M("files_external","allowUserMounting",!1),z=C();z.register(new E({id:"extstoragemounts",name:s("files_external","External storage"),caption:s("files_external","List of external storage."),emptyCaption:Y?s("files_external","There is no external storage configured. You can configure them in your Personal settings."):s("files_external","There is no external storage configured and you don't have the permission to configure them."),emptyTitle:s("files_external","No external storage"),icon:I,order:30,columns:[new p({id:"storage-type",title:s("files_external","Storage type"),render(e){const t=e.attributes?.backend||s("files_external","Unknown"),n=document.createElement("span");return n.textContent=t,n}}),new p({id:"scope",title:s("files_external","Scope"),render(e){const t=document.createElement("span");let n=s("files_external","Personal");return e.attributes?.scope==="system"&&(n=s("files_external","System")),t.textContent=n,t}})],getContents:Z})),c(U),c(q),c(W); //# sourceMappingURL=files_external-init.mjs.map diff --git a/dist/files_reminders-init.mjs b/dist/files_reminders-init.mjs index c05a016334803..127c592ca322a 100644 --- a/dist/files_reminders-init.mjs +++ b/dist/files_reminders-init.mjs @@ -1,2 +1,2 @@ -import{b as l}from"./index-DNfSxz5H.chunk.mjs";import{c as Q}from"./dav-CufFHsl4.chunk.mjs";import{e as D,g as X}from"./index-Bndk0DrU.chunk.mjs";import{a as B,t as i}from"./translation-DoG5ZELJ-Bni_xMHF.chunk.mjs";import{c as O}from"./index-Conii63U.chunk.mjs";import{b as W}from"./createElementId-DhjFt1I9-CNrdQIoZ.chunk.mjs";import"./PencilOutline-a19hsj34.chunk.mjs";import"./index-D2bEtPaj.chunk.mjs";import{N as J}from"./NcBreadcrumbs-5gl8Syfa-CCFzuZ9f.chunk.mjs";import{_ as ee}from"./NcDateTime.vue_vue_type_script_setup_true_lang-BhB8yA4U-Utjw7yHu.chunk.mjs";import{N as te,s as re}from"./index-Cg5VsXN5.chunk.mjs";import"./NcAvatar-C9d7Wrc8-pzWde3CT.chunk.mjs";import"./NcRichText-DJlaHs_Q-B-HUjPYZ.chunk.mjs";import{N as k}from"./logger-D3RVzcfQ-B9jnX7-s.chunk.mjs";import"./mdi-DXIZZeEd.chunk.mjs";import"./NcCheckboxRadioSwitch-BMsPx74L-CaXJJ1WR.chunk.mjs";import"./NcChip-B71t2Ny2-DeGKCj7f.chunk.mjs";import"./NcColorPicker-DDHxR-iN-Dglc-YtF.chunk.mjs";import"./TrayArrowDown-DXqUo7y4.chunk.mjs";import"./NcSelect-DLheQ2yp-BkjvUqWu.chunk.mjs";import"./NcEmojiPicker-Djc9a0gw-B1XxWYNH.chunk.mjs";import"./Plus-DQFE3py0.chunk.mjs";/* empty css */import"./NcInputField-o5OFv3z6-DW3Gcl3I.chunk.mjs";import{N as M}from"./NcNoteCard-Cok_4Fld-BI3-Vu_l.chunk.mjs";import"./NcPasswordField-uaMO2pdt-D3pIyOm0.chunk.mjs";import"./TrashCanOutline-D95Fx13e.chunk.mjs";import"./index-Cxfn8yan.chunk.mjs";import"./ContentCopy-E_LPDnCs.chunk.mjs";import"./NcUserBubble-vOAXLHB5-ELPenwW0.chunk.mjs";import"./NcUserStatusIcon-XiwrgeCm-CQdLdRFx.chunk.mjs";import"./colors-BHGKZFDI-BMbI6zNx.chunk.mjs";import{b as ie,N as ae,r as m,A as ne,c as v,l as A,o as y,w as d,k as se,H as oe,e as b,u as n,g as u,t as c}from"./runtime-dom.esm-bundler-CU8rrbZA.chunk.mjs";import{a as f,d as N}from"./index-JpgrUA2Z-Rp7fa0gf.chunk.mjs";import{a as de}from"./index-xFugdZPW.chunk.mjs";import"./folder-D9CBQngR-CuPN_AFd.chunk.mjs";import"./string_decoder-BO00msnV.chunk.mjs";import"./index-JSJM6V6X.chunk.mjs";const le='';async function E(e,t){const r=W("/apps/files_reminders/api/v1/{fileId}",{fileId:e});return(await O.put(r,{dueDate:t.toISOString()})).data.ocs.data}async function Z(e){const t=W("/apps/files_reminders/api/v1/{fileId}",{fileId:e});return(await O.delete(t)).data.ocs.data}var p=(e=>(e.LaterToday="later-today",e.Tomorrow="tomorrow",e.ThisWeekend="this-weekend",e.NextWeek="next-week",e))(p||{});function F(){const e=new Date;return e.setHours(0,0,0,0),e.setDate(e.getDate()-e.getDay()+1),new Date(e)}function I(e){new Date(e).setHours(0,0,0,0);const t=new Date(e.getFullYear(),0,1,0,0,0,0),r=(e.getTime()-t.getTime())/864e5;return Math.ceil((r+t.getDay()+1)/7)}function me(e,t){return I(e)===I(t)&&e.getFullYear()===t.getFullYear()}function ue(e,t){return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}function _(e){return{"later-today":()=>{const t=new Date,r=new Date;r.setHours(18,0,0,0);const s=new Date;return s.setHours(17,0,0,0),t>=s?null:r},tomorrow:()=>{const t=new Date,r=new Date;return r.setDate(t.getDate()+1),r.setHours(8,0,0,0),r},"this-weekend":()=>{const t=new Date;if([5,6,0].includes(t.getDay()))return null;const r=new Date,s=F();return r.setDate(s.getDate()+5),r.setHours(8,0,0,0),r},"next-week":()=>{if(new Date().getDay()===0)return null;const t=new Date,r=F();return t.setDate(r.getDate()+7),t.setHours(8,0,0,0),t}}[e]()}function ce(){const e=new Date,t=new Date;return t.setHours(e.getHours()+2,0,0,0),t}function V(e){let t={hour:"numeric",minute:"2-digit"};const r=new Date;return ue(e,r)||(t={...t,weekday:"short"}),me(e,r)||(t={...t,month:"short",day:"numeric"}),e.getFullYear()!==r.getFullYear()&&(t={...t,year:"numeric"}),e.toLocaleString(B(),t)}function L(e){let t={month:"long",day:"numeric",weekday:"long",hour:"numeric",minute:"2-digit"};const r=new Date;return e.getFullYear()!==r.getFullYear()&&(t={...t,year:"numeric"}),e.toLocaleString(B(),t)}const fe={id:"clear-reminder",displayName:()=>i("files_reminders","Clear reminder"),title:({nodes:e})=>{const t=e.at(0),r=new Date(t.attributes["reminder-due-date"]);return`${i("files_reminders","Clear reminder")} – ${L(r)}`},iconSvgInline:()=>le,enabled:({nodes:e})=>e.length!==1?!1:!!e.at(0).attributes["reminder-due-date"],async exec({nodes:e}){const t=e.at(0);if(t.fileid)try{return await Z(t.fileid),t.attributes["reminder-due-date"]="",D("files:node:updated",t),!0}catch{return!1}return null},order:19},U='',h=X().setApp("files_reminders").detectUser().build(),pe=ie({__name:"SetCustomReminderModal",props:{node:{}},emits:["close"],setup(e,{emit:t}){const r=e,s=t,S=m(!1),C=m(!1),g=m(!0),o=m(),H=m(new Date);ae(()=>{const a=r.node.attributes["reminder-due-date"]?new Date(r.node.attributes["reminder-due-date"]):void 0;S.value=!!a,g.value=!0,C.value=!0,o.value=a??ce(),H.value=new Date}),ne(()=>{const a=document.getElementById("set-custom-reminder");a.focus(),S.value||a.showPicker()});async function z(){if(!(o.value instanceof Date)||isNaN(o.value.getTime())){f(i("files_reminders","Please choose a valid date & time"));return}try{await E(r.node.fileid,o.value);const a=r.node.clone();a.attributes["reminder-due-date"]=o.value.toISOString(),D("files:node:updated",a),N(i("files_reminders",'Reminder set for "{fileName}"',{fileName:r.node.displayname})),w()}catch(a){h.error("Failed to set reminder",{error:a}),f(i("files_reminders","Failed to set reminder"))}}async function j(){try{await Z(r.node.fileid);const a=r.node.clone();a.attributes["reminder-due-date"]="",D("files:node:updated",a),N(i("files_reminders",'Reminder cleared for "{fileName}"',{fileName:r.node.displayname})),w()}catch(a){h.error("Failed to clear reminder",{error:a}),f(i("files_reminders","Failed to clear reminder"))}}function w(){C.value=!1,s("close")}function G(){const a=document.getElementById("set-custom-reminder");g.value=a.checkValidity()}return(a,x)=>C.value?(y(),v(n(te),{key:0,name:n(i)("files_reminders","Set reminder for '{fileName}'",{fileName:e.node.displayname}),outTransition:"",size:"small",closeOnClickOutside:"",onClosing:w},{actions:d(()=>[b(n(k),{variant:"tertiary",onClick:w},{default:d(()=>[u(c(n(i)("files_reminders","Cancel")),1)]),_:1}),S.value?(y(),v(n(k),{key:0,onClick:j},{default:d(()=>[u(c(n(i)("files_reminders","Clear reminder")),1)]),_:1})):A("",!0),b(n(k),{disabled:!g.value,variant:"primary",form:"set-custom-reminder-form",type:"submit"},{default:d(()=>[u(c(n(i)("files_reminders","Set reminder")),1)]),_:1},8,["disabled"])]),default:d(()=>[se("form",{id:"set-custom-reminder-form",class:"custom-reminder-modal",onSubmit:oe(z,["prevent"])},[b(n(J),{id:"set-custom-reminder",modelValue:o.value,"onUpdate:modelValue":x[0]||(x[0]=K=>o.value=K),label:n(i)("files_reminders","Reminder at custom date & time"),min:H.value,required:!0,type:"datetime-local",onInput:G},null,8,["modelValue","label","min"]),g.value&&o.value?(y(),v(n(M),{key:0,type:"info"},{default:d(()=>[u(c(n(i)("files_reminders","We will remind you of this file"))+" ",1),b(n(ee),{timestamp:o.value},null,8,["timestamp"])]),_:1})):(y(),v(n(M),{key:1,type:"error"},{default:d(()=>[u(c(n(i)("files_reminders","Please choose a valid date & time")),1)]),_:1}))],32)]),_:1},8,["name"])):A("",!0)}}),ge=de(pe,[["__scopeId","data-v-1cc1857f"]]);async function q(e){await re(ge,{node:e})}const we={id:"reminder-status",inline:()=>!0,displayName:()=>"",title:({nodes:e})=>{const t=e.at(0),r=new Date(t.attributes["reminder-due-date"]);return`${i("files_reminders","Reminder set")} – ${L(r)}`},iconSvgInline:()=>U,enabled:({nodes:e})=>e.length!==1?!1:!!e.at(0).attributes["reminder-due-date"],async exec({nodes:e}){const t=e.at(0);return await q(t),null},order:-15},ve='',T="set-reminder-menu",ye={id:T,displayName:()=>i("files_reminders","Set reminder"),iconSvgInline:()=>U,enabled:({nodes:e,view:t})=>t.id==="trashbin"||e.length!==1?!1:e.at(0).attributes["reminder-due-date"]!==void 0,async exec(){return null},order:20},be={id:"set-reminder-custom",displayName:()=>i("files_reminders","Custom reminder"),title:()=>i("files_reminders","Reminder at custom date & time"),iconSvgInline:()=>ve,enabled:({nodes:e,view:t})=>t.id==="trashbin"||e.length!==1?!1:e.at(0).attributes["reminder-due-date"]!==void 0,parent:T,async exec({nodes:e}){const t=e.at(0);return q(t),null},order:22},P={dateTimePreset:p.LaterToday,label:i("files_reminders","Later today"),ariaLabel:i("files_reminders","Set reminder for later today"),dateString:"",verboseDateString:""},Y={dateTimePreset:p.Tomorrow,label:i("files_reminders","Tomorrow"),ariaLabel:i("files_reminders","Set reminder for tomorrow"),dateString:"",verboseDateString:""},$={dateTimePreset:p.ThisWeekend,label:i("files_reminders","This weekend"),ariaLabel:i("files_reminders","Set reminder for this weekend"),dateString:"",verboseDateString:""},R={dateTimePreset:p.NextWeek,label:i("files_reminders","Next week"),ariaLabel:i("files_reminders","Set reminder for next week"),dateString:"",verboseDateString:""};function De(){return[P,Y,$,R].forEach(e=>{const t=_(e.dateTimePreset);t&&(e.dateString=V(t),e.verboseDateString=L(t),setInterval(()=>{const r=_(e.dateTimePreset);r&&(e.dateString=V(r),e.verboseDateString=L(r))},1e3*30*60))}),[P,Y,$,R].map(_e)}function _e(e){return{id:`set-reminder-${e.dateTimePreset}`,displayName:()=>`${e.label} – ${e.dateString}`,title:()=>`${e.ariaLabel} – ${e.verboseDateString}`,iconSvgInline:()=>"",enabled:({nodes:t,view:r})=>r.id==="trashbin"||t.length!==1?!1:t.at(0).attributes["reminder-due-date"]!==void 0&&!!_(e.dateTimePreset),parent:T,async exec({nodes:t}){const r=t.at(0);if(!r.fileid)return h.error("Failed to set reminder, missing file id"),f(i("files_reminders","Failed to set reminder")),null;try{const s=_(e.dateTimePreset);await E(r.fileid,s),r.attributes["reminder-due-date"]=s.toISOString(),D("files:node:updated",r),N(i("files_reminders",'Reminder set for "{fileName}"',{fileName:r.basename}))}catch(s){h.error("Failed to set reminder",{error:s}),f(i("files_reminders","Failed to set reminder"))}return null},order:21}}Q("nc:reminder-due-date",{nc:"http://nextcloud.org/ns"}),l(we),l(fe),l(ye),l(be),De().forEach(l); +import{b as l}from"./index-sQy2Ug64.chunk.mjs";import{c as Q}from"./dav-CMOydKDk.chunk.mjs";import{e as D,g as X}from"./index-Bndk0DrU.chunk.mjs";import{a as B,t as i}from"./translation-DoG5ZELJ-Bni_xMHF.chunk.mjs";import{c as O}from"./index-Conii63U.chunk.mjs";import{b as W}from"./createElementId-DhjFt1I9-CNrdQIoZ.chunk.mjs";import"./PencilOutline-a19hsj34.chunk.mjs";import"./index-D2bEtPaj.chunk.mjs";import{N as J}from"./NcBreadcrumbs-5gl8Syfa-CCFzuZ9f.chunk.mjs";import{_ as ee}from"./NcDateTime.vue_vue_type_script_setup_true_lang-BhB8yA4U-Utjw7yHu.chunk.mjs";import{N as te,s as re}from"./index-Cg5VsXN5.chunk.mjs";import"./NcAvatar-C9d7Wrc8-pzWde3CT.chunk.mjs";import"./NcRichText-DJlaHs_Q-B-HUjPYZ.chunk.mjs";import{N as k}from"./logger-D3RVzcfQ-B9jnX7-s.chunk.mjs";import"./mdi-DXIZZeEd.chunk.mjs";import"./NcCheckboxRadioSwitch-BMsPx74L-CaXJJ1WR.chunk.mjs";import"./NcChip-B71t2Ny2-DeGKCj7f.chunk.mjs";import"./NcColorPicker-DDHxR-iN-Dglc-YtF.chunk.mjs";import"./TrayArrowDown-DXqUo7y4.chunk.mjs";import"./NcSelect-DLheQ2yp-BkjvUqWu.chunk.mjs";import"./NcEmojiPicker-Djc9a0gw-B1XxWYNH.chunk.mjs";import"./Plus-DQFE3py0.chunk.mjs";/* empty css */import"./NcInputField-o5OFv3z6-DW3Gcl3I.chunk.mjs";import{N as M}from"./NcNoteCard-Cok_4Fld-BI3-Vu_l.chunk.mjs";import"./NcPasswordField-uaMO2pdt-D3pIyOm0.chunk.mjs";import"./TrashCanOutline-D95Fx13e.chunk.mjs";import"./index-Cxfn8yan.chunk.mjs";import"./ContentCopy-E_LPDnCs.chunk.mjs";import"./NcUserBubble-vOAXLHB5-ELPenwW0.chunk.mjs";import"./NcUserStatusIcon-XiwrgeCm-CQdLdRFx.chunk.mjs";import"./colors-BHGKZFDI-BMbI6zNx.chunk.mjs";import{b as ie,N as ae,r as m,A as ne,c as v,l as A,o as y,w as d,k as se,H as oe,e as b,u as n,g as u,t as c}from"./runtime-dom.esm-bundler-CU8rrbZA.chunk.mjs";import{a as f,d as N}from"./index-JpgrUA2Z-Rp7fa0gf.chunk.mjs";import{a as de}from"./index-xFugdZPW.chunk.mjs";import"./folder-29HuacU_-CwocT1ij.chunk.mjs";import"./string_decoder-BO00msnV.chunk.mjs";import"./index-JSJM6V6X.chunk.mjs";const le='';async function E(e,t){const r=W("/apps/files_reminders/api/v1/{fileId}",{fileId:e});return(await O.put(r,{dueDate:t.toISOString()})).data.ocs.data}async function Z(e){const t=W("/apps/files_reminders/api/v1/{fileId}",{fileId:e});return(await O.delete(t)).data.ocs.data}var p=(e=>(e.LaterToday="later-today",e.Tomorrow="tomorrow",e.ThisWeekend="this-weekend",e.NextWeek="next-week",e))(p||{});function F(){const e=new Date;return e.setHours(0,0,0,0),e.setDate(e.getDate()-e.getDay()+1),new Date(e)}function I(e){new Date(e).setHours(0,0,0,0);const t=new Date(e.getFullYear(),0,1,0,0,0,0),r=(e.getTime()-t.getTime())/864e5;return Math.ceil((r+t.getDay()+1)/7)}function me(e,t){return I(e)===I(t)&&e.getFullYear()===t.getFullYear()}function ue(e,t){return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}function _(e){return{"later-today":()=>{const t=new Date,r=new Date;r.setHours(18,0,0,0);const s=new Date;return s.setHours(17,0,0,0),t>=s?null:r},tomorrow:()=>{const t=new Date,r=new Date;return r.setDate(t.getDate()+1),r.setHours(8,0,0,0),r},"this-weekend":()=>{const t=new Date;if([5,6,0].includes(t.getDay()))return null;const r=new Date,s=F();return r.setDate(s.getDate()+5),r.setHours(8,0,0,0),r},"next-week":()=>{if(new Date().getDay()===0)return null;const t=new Date,r=F();return t.setDate(r.getDate()+7),t.setHours(8,0,0,0),t}}[e]()}function ce(){const e=new Date,t=new Date;return t.setHours(e.getHours()+2,0,0,0),t}function V(e){let t={hour:"numeric",minute:"2-digit"};const r=new Date;return ue(e,r)||(t={...t,weekday:"short"}),me(e,r)||(t={...t,month:"short",day:"numeric"}),e.getFullYear()!==r.getFullYear()&&(t={...t,year:"numeric"}),e.toLocaleString(B(),t)}function L(e){let t={month:"long",day:"numeric",weekday:"long",hour:"numeric",minute:"2-digit"};const r=new Date;return e.getFullYear()!==r.getFullYear()&&(t={...t,year:"numeric"}),e.toLocaleString(B(),t)}const fe={id:"clear-reminder",displayName:()=>i("files_reminders","Clear reminder"),title:({nodes:e})=>{const t=e.at(0),r=new Date(t.attributes["reminder-due-date"]);return`${i("files_reminders","Clear reminder")} – ${L(r)}`},iconSvgInline:()=>le,enabled:({nodes:e})=>e.length!==1?!1:!!e.at(0).attributes["reminder-due-date"],async exec({nodes:e}){const t=e.at(0);if(t.fileid)try{return await Z(t.fileid),t.attributes["reminder-due-date"]="",D("files:node:updated",t),!0}catch{return!1}return null},order:19},U='',h=X().setApp("files_reminders").detectUser().build(),pe=ie({__name:"SetCustomReminderModal",props:{node:{}},emits:["close"],setup(e,{emit:t}){const r=e,s=t,S=m(!1),C=m(!1),g=m(!0),o=m(),H=m(new Date);ae(()=>{const a=r.node.attributes["reminder-due-date"]?new Date(r.node.attributes["reminder-due-date"]):void 0;S.value=!!a,g.value=!0,C.value=!0,o.value=a??ce(),H.value=new Date}),ne(()=>{const a=document.getElementById("set-custom-reminder");a.focus(),S.value||a.showPicker()});async function z(){if(!(o.value instanceof Date)||isNaN(o.value.getTime())){f(i("files_reminders","Please choose a valid date & time"));return}try{await E(r.node.fileid,o.value);const a=r.node.clone();a.attributes["reminder-due-date"]=o.value.toISOString(),D("files:node:updated",a),N(i("files_reminders",'Reminder set for "{fileName}"',{fileName:r.node.displayname})),w()}catch(a){h.error("Failed to set reminder",{error:a}),f(i("files_reminders","Failed to set reminder"))}}async function j(){try{await Z(r.node.fileid);const a=r.node.clone();a.attributes["reminder-due-date"]="",D("files:node:updated",a),N(i("files_reminders",'Reminder cleared for "{fileName}"',{fileName:r.node.displayname})),w()}catch(a){h.error("Failed to clear reminder",{error:a}),f(i("files_reminders","Failed to clear reminder"))}}function w(){C.value=!1,s("close")}function G(){const a=document.getElementById("set-custom-reminder");g.value=a.checkValidity()}return(a,x)=>C.value?(y(),v(n(te),{key:0,name:n(i)("files_reminders","Set reminder for '{fileName}'",{fileName:e.node.displayname}),outTransition:"",size:"small",closeOnClickOutside:"",onClosing:w},{actions:d(()=>[b(n(k),{variant:"tertiary",onClick:w},{default:d(()=>[u(c(n(i)("files_reminders","Cancel")),1)]),_:1}),S.value?(y(),v(n(k),{key:0,onClick:j},{default:d(()=>[u(c(n(i)("files_reminders","Clear reminder")),1)]),_:1})):A("",!0),b(n(k),{disabled:!g.value,variant:"primary",form:"set-custom-reminder-form",type:"submit"},{default:d(()=>[u(c(n(i)("files_reminders","Set reminder")),1)]),_:1},8,["disabled"])]),default:d(()=>[se("form",{id:"set-custom-reminder-form",class:"custom-reminder-modal",onSubmit:oe(z,["prevent"])},[b(n(J),{id:"set-custom-reminder",modelValue:o.value,"onUpdate:modelValue":x[0]||(x[0]=K=>o.value=K),label:n(i)("files_reminders","Reminder at custom date & time"),min:H.value,required:!0,type:"datetime-local",onInput:G},null,8,["modelValue","label","min"]),g.value&&o.value?(y(),v(n(M),{key:0,type:"info"},{default:d(()=>[u(c(n(i)("files_reminders","We will remind you of this file"))+" ",1),b(n(ee),{timestamp:o.value},null,8,["timestamp"])]),_:1})):(y(),v(n(M),{key:1,type:"error"},{default:d(()=>[u(c(n(i)("files_reminders","Please choose a valid date & time")),1)]),_:1}))],32)]),_:1},8,["name"])):A("",!0)}}),ge=de(pe,[["__scopeId","data-v-1cc1857f"]]);async function q(e){await re(ge,{node:e})}const we={id:"reminder-status",inline:()=>!0,displayName:()=>"",title:({nodes:e})=>{const t=e.at(0),r=new Date(t.attributes["reminder-due-date"]);return`${i("files_reminders","Reminder set")} – ${L(r)}`},iconSvgInline:()=>U,enabled:({nodes:e})=>e.length!==1?!1:!!e.at(0).attributes["reminder-due-date"],async exec({nodes:e}){const t=e.at(0);return await q(t),null},order:-15},ve='',T="set-reminder-menu",ye={id:T,displayName:()=>i("files_reminders","Set reminder"),iconSvgInline:()=>U,enabled:({nodes:e,view:t})=>t.id==="trashbin"||e.length!==1?!1:e.at(0).attributes["reminder-due-date"]!==void 0,async exec(){return null},order:20},be={id:"set-reminder-custom",displayName:()=>i("files_reminders","Custom reminder"),title:()=>i("files_reminders","Reminder at custom date & time"),iconSvgInline:()=>ve,enabled:({nodes:e,view:t})=>t.id==="trashbin"||e.length!==1?!1:e.at(0).attributes["reminder-due-date"]!==void 0,parent:T,async exec({nodes:e}){const t=e.at(0);return q(t),null},order:22},P={dateTimePreset:p.LaterToday,label:i("files_reminders","Later today"),ariaLabel:i("files_reminders","Set reminder for later today"),dateString:"",verboseDateString:""},Y={dateTimePreset:p.Tomorrow,label:i("files_reminders","Tomorrow"),ariaLabel:i("files_reminders","Set reminder for tomorrow"),dateString:"",verboseDateString:""},$={dateTimePreset:p.ThisWeekend,label:i("files_reminders","This weekend"),ariaLabel:i("files_reminders","Set reminder for this weekend"),dateString:"",verboseDateString:""},R={dateTimePreset:p.NextWeek,label:i("files_reminders","Next week"),ariaLabel:i("files_reminders","Set reminder for next week"),dateString:"",verboseDateString:""};function De(){return[P,Y,$,R].forEach(e=>{const t=_(e.dateTimePreset);t&&(e.dateString=V(t),e.verboseDateString=L(t),setInterval(()=>{const r=_(e.dateTimePreset);r&&(e.dateString=V(r),e.verboseDateString=L(r))},1e3*30*60))}),[P,Y,$,R].map(_e)}function _e(e){return{id:`set-reminder-${e.dateTimePreset}`,displayName:()=>`${e.label} – ${e.dateString}`,title:()=>`${e.ariaLabel} – ${e.verboseDateString}`,iconSvgInline:()=>"",enabled:({nodes:t,view:r})=>r.id==="trashbin"||t.length!==1?!1:t.at(0).attributes["reminder-due-date"]!==void 0&&!!_(e.dateTimePreset),parent:T,async exec({nodes:t}){const r=t.at(0);if(!r.fileid)return h.error("Failed to set reminder, missing file id"),f(i("files_reminders","Failed to set reminder")),null;try{const s=_(e.dateTimePreset);await E(r.fileid,s),r.attributes["reminder-due-date"]=s.toISOString(),D("files:node:updated",r),N(i("files_reminders",'Reminder set for "{fileName}"',{fileName:r.basename}))}catch(s){h.error("Failed to set reminder",{error:s}),f(i("files_reminders","Failed to set reminder"))}return null},order:21}}Q("nc:reminder-due-date",{nc:"http://nextcloud.org/ns"}),l(we),l(fe),l(ye),l(be),De().forEach(l); //# sourceMappingURL=files_reminders-init.mjs.map diff --git a/dist/files_trashbin-init.mjs b/dist/files_trashbin-init.mjs index 6af59fa8f38c9..9b12f06d9ce79 100644 --- a/dist/files_trashbin-init.mjs +++ b/dist/files_trashbin-init.mjs @@ -1,4 +1,4 @@ -import{C as c,V as _,g as v,a as x,b as V}from"./index-DNfSxz5H.chunk.mjs";import{a as o,g as H,e as p}from"./index-Bndk0DrU.chunk.mjs";import{c as u,i as A}from"./index-Conii63U.chunk.mjs";import{a as b,d as C,g as N}from"./index-JpgrUA2Z-Rp7fa0gf.chunk.mjs";import{P as E}from"./folder-D9CBQngR-CuPN_AFd.chunk.mjs";import{d as S,e as $,l as I}from"./index-xFugdZPW.chunk.mjs";import{t as n,g as y,a as f}from"./translation-DoG5ZELJ-Bni_xMHF.chunk.mjs";import{g as D,f as L}from"./createElementId-DhjFt1I9-CNrdQIoZ.chunk.mjs";import{g as M,a as T,b as k,r as F,d as B}from"./dav-CufFHsl4.chunk.mjs";import{f as U}from"./index-Cg5VsXN5.chunk.mjs";import{h as P}from"./runtime-dom.esm-bundler-CU8rrbZA.chunk.mjs";import{N as O}from"./NcUserBubble-vOAXLHB5-ELPenwW0.chunk.mjs";import"./string_decoder-BO00msnV.chunk.mjs";import"./NcNoteCard-Cok_4Fld-BI3-Vu_l.chunk.mjs";import"./logger-D3RVzcfQ-B9jnX7-s.chunk.mjs";import"./index-JSJM6V6X.chunk.mjs";import"./mdi-DXIZZeEd.chunk.mjs";import"./NcAvatar-C9d7Wrc8-pzWde3CT.chunk.mjs";import"./colors-BHGKZFDI-BMbI6zNx.chunk.mjs";import"./NcUserStatusIcon-XiwrgeCm-CQdLdRFx.chunk.mjs";import"./PencilOutline-a19hsj34.chunk.mjs";import"./NcDateTime.vue_vue_type_script_setup_true_lang-BhB8yA4U-Utjw7yHu.chunk.mjs";const R='',q='',g=`/trashbin/${o()?.uid}/trash`,z=M(),K=` +import{C as c,V as _,g as v,a as x,b as V}from"./index-sQy2Ug64.chunk.mjs";import{a as o,g as H,e as p}from"./index-Bndk0DrU.chunk.mjs";import{c as u,i as A}from"./index-Conii63U.chunk.mjs";import{a as b,d as C,g as N}from"./index-JpgrUA2Z-Rp7fa0gf.chunk.mjs";import{P as E}from"./folder-29HuacU_-CwocT1ij.chunk.mjs";import{d as S,e as $,l as I}from"./index-xFugdZPW.chunk.mjs";import{t as n,g as y,a as f}from"./translation-DoG5ZELJ-Bni_xMHF.chunk.mjs";import{g as D,f as L}from"./createElementId-DhjFt1I9-CNrdQIoZ.chunk.mjs";import{g as M,a as T,b as k,r as F,d as B}from"./dav-CMOydKDk.chunk.mjs";import{f as U}from"./index-Cg5VsXN5.chunk.mjs";import{h as P}from"./runtime-dom.esm-bundler-CU8rrbZA.chunk.mjs";import{N as O}from"./NcUserBubble-vOAXLHB5-ELPenwW0.chunk.mjs";import"./string_decoder-BO00msnV.chunk.mjs";import"./NcNoteCard-Cok_4Fld-BI3-Vu_l.chunk.mjs";import"./logger-D3RVzcfQ-B9jnX7-s.chunk.mjs";import"./index-JSJM6V6X.chunk.mjs";import"./mdi-DXIZZeEd.chunk.mjs";import"./NcAvatar-C9d7Wrc8-pzWde3CT.chunk.mjs";import"./colors-BHGKZFDI-BMbI6zNx.chunk.mjs";import"./NcUserStatusIcon-XiwrgeCm-CQdLdRFx.chunk.mjs";import"./PencilOutline-a19hsj34.chunk.mjs";import"./NcDateTime.vue_vue_type_script_setup_true_lang-BhB8yA4U-Utjw7yHu.chunk.mjs";const R='',q='',g=`/trashbin/${o()?.uid}/trash`,z=M(),K=` diff --git a/dist/files_versions-sidebar-tab.mjs b/dist/files_versions-sidebar-tab.mjs index 3e310b7f960b3..99491d0346836 100644 --- a/dist/files_versions-sidebar-tab.mjs +++ b/dist/files_versions-sidebar-tab.mjs @@ -1,3 +1,3 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=[window.OC.filePath('', '', 'dist/FilesVersionsSidebarTab-0wNUfEkv.chunk.mjs'),window.OC.filePath('', '', 'dist/index-JpgrUA2Z-Rp7fa0gf.chunk.mjs'),window.OC.filePath('', '', 'dist/index-xFugdZPW.chunk.mjs'),window.OC.filePath('', '', 'dist/index-Cg5VsXN5.chunk.mjs'),window.OC.filePath('', '', 'dist/runtime-dom.esm-bundler-CU8rrbZA.chunk.mjs'),window.OC.filePath('', '', 'dist/createElementId-DhjFt1I9-CNrdQIoZ.chunk.mjs'),window.OC.filePath('', '', 'dist/translation-DoG5ZELJ-Bni_xMHF.chunk.mjs'),window.OC.filePath('', '', 'dist/index-Bndk0DrU.chunk.mjs'),window.OC.filePath('', '', 'dist/createElementId-DhjFt1I9-C_oBIsvc.chunk.css'),window.OC.filePath('', '', 'dist/logger-D3RVzcfQ-B9jnX7-s.chunk.mjs'),window.OC.filePath('', '', 'dist/logger-D3RVzcfQ-R3us1MM8.chunk.css'),window.OC.filePath('', '', 'dist/mdi-DXIZZeEd.chunk.mjs'),window.OC.filePath('', '', 'dist/mdi-BYHcrfvW.chunk.css'),window.OC.filePath('', '', 'dist/index-CySLkPBX.chunk.css'),window.OC.filePath('', '', 'dist/NcNoteCard-Cok_4Fld-BI3-Vu_l.chunk.mjs'),window.OC.filePath('', '', 'dist/NcNoteCard-Cok_4Fld-Jq77EThs.chunk.css'),window.OC.filePath('', '', 'dist/index-DNfSxz5H.chunk.mjs'),window.OC.filePath('', '', 'dist/folder-D9CBQngR-CuPN_AFd.chunk.mjs'),window.OC.filePath('', '', 'dist/string_decoder-BO00msnV.chunk.mjs'),window.OC.filePath('', '', 'dist/PencilOutline-a19hsj34.chunk.mjs'),window.OC.filePath('', '', 'dist/PencilOutline-DdQinVMt.chunk.css'),window.OC.filePath('', '', 'dist/NcDateTime.vue_vue_type_script_setup_true_lang-BhB8yA4U-Utjw7yHu.chunk.mjs'),window.OC.filePath('', '', 'dist/NcDateTime-DS-ziNw6.chunk.css'),window.OC.filePath('', '', 'dist/NcAvatar-C9d7Wrc8-pzWde3CT.chunk.mjs'),window.OC.filePath('', '', 'dist/index-Conii63U.chunk.mjs'),window.OC.filePath('', '', 'dist/colors-BHGKZFDI-BMbI6zNx.chunk.mjs'),window.OC.filePath('', '', 'dist/NcUserStatusIcon-XiwrgeCm-CQdLdRFx.chunk.mjs'),window.OC.filePath('', '', 'dist/NcUserStatusIcon-XiwrgeCm-Bq_6hmXG.chunk.css'),window.OC.filePath('', '', 'dist/NcAvatar-C9d7Wrc8-D_G6wUEW.chunk.css'),window.OC.filePath('', '', 'dist/TrayArrowDown-DXqUo7y4.chunk.mjs'),window.OC.filePath('', '', 'dist/TrayArrowDown-D79n0IQ6.chunk.css'),window.OC.filePath('', '', 'dist/TrashCanOutline-D95Fx13e.chunk.mjs'),window.OC.filePath('', '', 'dist/NcInputField-o5OFv3z6-DW3Gcl3I.chunk.mjs'),window.OC.filePath('', '', 'dist/NcInputField-o5OFv3z6-BYlw6Xsd.chunk.css'),window.OC.filePath('', '', 'dist/dav-CufFHsl4.chunk.mjs'),window.OC.filePath('', '', 'dist/index-JSJM6V6X.chunk.mjs'),window.OC.filePath('', '', 'dist/files_versions-FilesVersionsSidebarTab-Cjl2hr1y.chunk.css')])))=>i.map(i=>d[i]); -import{i as s,_ as e}from"./index-xFugdZPW.chunk.mjs";import{r}from"./index-DNfSxz5H.chunk.mjs";import{t}from"./translation-DoG5ZELJ-Bni_xMHF.chunk.mjs";import{d as m,a as n}from"./runtime-dom.esm-bundler-CU8rrbZA.chunk.mjs";import{F as a}from"./folder-D9CBQngR-CuPN_AFd.chunk.mjs";import"./index-Bndk0DrU.chunk.mjs";import"./string_decoder-BO00msnV.chunk.mjs";const d='',i="files-versions_sidebar-tab";r({id:"files_versions",tagName:i,order:90,displayName:t("files_versions","Versions"),iconSvgInline:d,enabled({node:o}){return!(s()||o.type!==a.File)},async onInit(){const o=n(()=>e(()=>import("./FilesVersionsSidebarTab-0wNUfEkv.chunk.mjs"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36]),import.meta.url));window.customElements.define(i,m(o,{shadowRoot:!1}))}}); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=[window.OC.filePath('', '', 'dist/FilesVersionsSidebarTab-DsT8l27C.chunk.mjs'),window.OC.filePath('', '', 'dist/index-JpgrUA2Z-Rp7fa0gf.chunk.mjs'),window.OC.filePath('', '', 'dist/index-xFugdZPW.chunk.mjs'),window.OC.filePath('', '', 'dist/index-Cg5VsXN5.chunk.mjs'),window.OC.filePath('', '', 'dist/runtime-dom.esm-bundler-CU8rrbZA.chunk.mjs'),window.OC.filePath('', '', 'dist/createElementId-DhjFt1I9-CNrdQIoZ.chunk.mjs'),window.OC.filePath('', '', 'dist/translation-DoG5ZELJ-Bni_xMHF.chunk.mjs'),window.OC.filePath('', '', 'dist/index-Bndk0DrU.chunk.mjs'),window.OC.filePath('', '', 'dist/createElementId-DhjFt1I9-C_oBIsvc.chunk.css'),window.OC.filePath('', '', 'dist/logger-D3RVzcfQ-B9jnX7-s.chunk.mjs'),window.OC.filePath('', '', 'dist/logger-D3RVzcfQ-R3us1MM8.chunk.css'),window.OC.filePath('', '', 'dist/mdi-DXIZZeEd.chunk.mjs'),window.OC.filePath('', '', 'dist/mdi-BYHcrfvW.chunk.css'),window.OC.filePath('', '', 'dist/index-CySLkPBX.chunk.css'),window.OC.filePath('', '', 'dist/NcNoteCard-Cok_4Fld-BI3-Vu_l.chunk.mjs'),window.OC.filePath('', '', 'dist/NcNoteCard-Cok_4Fld-Jq77EThs.chunk.css'),window.OC.filePath('', '', 'dist/index-sQy2Ug64.chunk.mjs'),window.OC.filePath('', '', 'dist/folder-29HuacU_-CwocT1ij.chunk.mjs'),window.OC.filePath('', '', 'dist/string_decoder-BO00msnV.chunk.mjs'),window.OC.filePath('', '', 'dist/PencilOutline-a19hsj34.chunk.mjs'),window.OC.filePath('', '', 'dist/PencilOutline-DdQinVMt.chunk.css'),window.OC.filePath('', '', 'dist/NcDateTime.vue_vue_type_script_setup_true_lang-BhB8yA4U-Utjw7yHu.chunk.mjs'),window.OC.filePath('', '', 'dist/NcDateTime-DS-ziNw6.chunk.css'),window.OC.filePath('', '', 'dist/NcAvatar-C9d7Wrc8-pzWde3CT.chunk.mjs'),window.OC.filePath('', '', 'dist/index-Conii63U.chunk.mjs'),window.OC.filePath('', '', 'dist/colors-BHGKZFDI-BMbI6zNx.chunk.mjs'),window.OC.filePath('', '', 'dist/NcUserStatusIcon-XiwrgeCm-CQdLdRFx.chunk.mjs'),window.OC.filePath('', '', 'dist/NcUserStatusIcon-XiwrgeCm-Bq_6hmXG.chunk.css'),window.OC.filePath('', '', 'dist/NcAvatar-C9d7Wrc8-D_G6wUEW.chunk.css'),window.OC.filePath('', '', 'dist/TrayArrowDown-DXqUo7y4.chunk.mjs'),window.OC.filePath('', '', 'dist/TrayArrowDown-D79n0IQ6.chunk.css'),window.OC.filePath('', '', 'dist/TrashCanOutline-D95Fx13e.chunk.mjs'),window.OC.filePath('', '', 'dist/NcInputField-o5OFv3z6-DW3Gcl3I.chunk.mjs'),window.OC.filePath('', '', 'dist/NcInputField-o5OFv3z6-BYlw6Xsd.chunk.css'),window.OC.filePath('', '', 'dist/dav-CMOydKDk.chunk.mjs'),window.OC.filePath('', '', 'dist/index-JSJM6V6X.chunk.mjs'),window.OC.filePath('', '', 'dist/files_versions-FilesVersionsSidebarTab-Cjl2hr1y.chunk.css')])))=>i.map(i=>d[i]); +import{i as s,_ as e}from"./index-xFugdZPW.chunk.mjs";import{r}from"./index-sQy2Ug64.chunk.mjs";import{t}from"./translation-DoG5ZELJ-Bni_xMHF.chunk.mjs";import{d as m,a as n}from"./runtime-dom.esm-bundler-CU8rrbZA.chunk.mjs";import{F as a}from"./folder-29HuacU_-CwocT1ij.chunk.mjs";import"./index-Bndk0DrU.chunk.mjs";import"./string_decoder-BO00msnV.chunk.mjs";const d='',i="files-versions_sidebar-tab";r({id:"files_versions",tagName:i,order:90,displayName:t("files_versions","Versions"),iconSvgInline:d,enabled({node:o}){return!(s()||o.type!==a.File)},async onInit(){const o=n(()=>e(()=>import("./FilesVersionsSidebarTab-DsT8l27C.chunk.mjs"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36]),import.meta.url));window.customElements.define(i,m(o,{shadowRoot:!1}))}}); //# sourceMappingURL=files_versions-sidebar-tab.mjs.map diff --git a/dist/folder-29HuacU_-CwocT1ij.chunk.mjs b/dist/folder-29HuacU_-CwocT1ij.chunk.mjs new file mode 100644 index 0000000000000..b5b2d267fd097 --- /dev/null +++ b/dist/folder-29HuacU_-CwocT1ij.chunk.mjs @@ -0,0 +1,2 @@ +import{g as y}from"./index-Bndk0DrU.chunk.mjs";import{e as m,c as g,f as b,d,j as E}from"./index-xFugdZPW.chunk.mjs";window._nc_files_scope??={},window._nc_files_scope.v4_0??={};const I=window._nc_files_scope.v4_0,x=y().setApp("@nextcloud/files").detectUser().build(),u=Object.freeze({Folder:"folder",File:"file"}),o=Object.freeze({NONE:0,READ:1,UPDATE:2,CREATE:4,WRITE:4,DELETE:8,SHARE:16,ALL:31}),D=Object.freeze({NEW:"new",FAILED:"failed",LOADING:"loading",LOCKED:"locked"});function h(t,e){return t.match(e)!==null}function s(t,e){if(t.id&&typeof t.id!="number"&&typeof t.id!="string")throw new Error("Invalid id type of value");if(!t.source)throw new Error("Missing mandatory source");try{new URL(t.source)}catch{throw new Error("Invalid source format, source must be a valid URL")}if(!t.source.startsWith("http"))throw new Error("Invalid source format, only http(s) is supported");if(!t.root)throw new Error("Missing mandatory root");if(typeof t.root!="string")throw new Error("Invalid root type");if(!t.root.startsWith("/"))throw new Error("Root must start with a leading slash");if(!t.source.includes(t.root))throw new Error("Root must be part of the source");if(h(t.source,e)){const i=t.source.match(e)[0];if(!t.source.includes(E(i,t.root)))throw new Error("The root must be relative to the service. e.g /files/emma")}if(t.displayname&&typeof t.displayname!="string")throw new Error("Invalid displayname type");if(t.mtime&&!(t.mtime instanceof Date))throw new Error("Invalid mtime type");if(t.crtime&&!(t.crtime instanceof Date))throw new Error("Invalid crtime type");if(!t.mime||typeof t.mime!="string"||!t.mime.match(/^[-\w.]+\/[-+\w.]+$/gi))throw new Error("Missing or invalid mandatory mime");if("size"in t&&typeof t.size!="number"&&t.size!==void 0)throw new Error("Invalid size type");if("permissions"in t&&t.permissions!==void 0&&!(typeof t.permissions=="number"&&t.permissions>=o.NONE&&t.permissions<=o.ALL))throw new Error("Invalid permissions");if(t.owner&&t.owner!==null&&typeof t.owner!="string")throw new Error("Invalid owner type");if(t.attributes&&typeof t.attributes!="object")throw new Error("Invalid attributes type");if(t.status&&!Object.values(D).includes(t.status))throw new Error("Status must be a valid NodeStatus")}function S(t){t.mtime&&typeof t.mtime=="string"&&!isNaN(Date.parse(t.mtime))&&JSON.stringify(new Date(t.mtime))===JSON.stringify(t.mtime)&&(t.mtime=new Date(t.mtime)),t.crtime&&typeof t.crtime=="string"&&!isNaN(Date.parse(t.crtime))&&JSON.stringify(new Date(t.crtime))===JSON.stringify(t.crtime)&&(t.crtime=new Date(t.crtime))}function O(t){if(t instanceof RegExp)return t;const e=t.match(/(\/?)(.+)\1([a-z]*)/i);if(!e)throw new Error("Invalid regular expression format.");const i=Array.from(new Set(e[3])).filter(r=>"gimsuy".includes(r)).join("");return new RegExp(e[2],i)}class c{_attributes;_data;_knownDavService=/(remote|public)\.php\/(web)?dav/i;readonlyAttributes=Object.entries(Object.getOwnPropertyDescriptors(c.prototype)).filter(e=>typeof e[1].get=="function"&&e[0]!=="__proto__").map(e=>e[0]);handler={set:(e,i,r)=>this.readonlyAttributes.includes(i)?!1:Reflect.set(e,i,r),deleteProperty:(e,i)=>this.readonlyAttributes.includes(i)?!1:Reflect.deleteProperty(e,i)};constructor(...[e,i]){e.mime||(e.mime="application/octet-stream"),S(e),i=O(i||this._knownDavService),s(e,i),this._data={...e,attributes:{}},this._attributes=new Proxy(this._data.attributes,this.handler),this.update(e.attributes??{}),i&&(this._knownDavService=i)}get source(){return this._data.source.replace(/\/$/i,"")}get encodedSource(){const{origin:e}=new URL(this.source);return e+m(this.source.slice(e.length))}get basename(){return g(this.source)}get displayname(){return this._data.displayname||this.basename}set displayname(e){s({...this._data,displayname:e},this._knownDavService),this._data.displayname=e}get extension(){return b(this.source)}get dirname(){return d(this.path)}get mime(){return this._data.mime||"application/octet-stream"}set mime(e){e??="application/octet-stream",s({...this._data,mime:e},this._knownDavService),this._data.mime=e}get mtime(){return this._data.mtime}set mtime(e){s({...this._data,mtime:e},this._knownDavService),this._data.mtime=e}get crtime(){return this._data.crtime}get size(){return this._data.size}set size(e){s({...this._data,size:e},this._knownDavService),this.updateMtime(),this._data.size=e}get attributes(){return this._attributes}get permissions(){return this.owner===null&&!this.isDavResource?o.READ:this._data.permissions!==void 0?this._data.permissions:o.NONE}set permissions(e){s({...this._data,permissions:e},this._knownDavService),this.updateMtime(),this._data.permissions=e}get owner(){return this.isDavResource?this._data.owner:null}get isDavResource(){return h(this.source,this._knownDavService)}get root(){return this._data.root.replace(/^(.+)\/$/,"$1")}get path(){const e=this.source.indexOf("://"),i=this.source.slice(0,e),r=this.source.slice(e+3),a=r.indexOf("/"),l=r.slice(0,a),p=r.slice(a),w=`${i}://${l}${m(p)}`,f=new URL(w);let n=decodeURIComponent(f.pathname);this.isDavResource&&(n=n.split(this._knownDavService).pop());const _=n.indexOf(this.root),v=this.root.replace(/\/$/,"");return n.slice(_+v.length)||"/"}get fileid(){return typeof this._data?.id=="number"?this._data.id:void 0}get id(){if(!(typeof this._data?.id>"u"||typeof this._data.id=="number"&&this._data.id<0))return String(this._data.id)}get status(){return this._data?.status}set status(e){s({...this._data,status:e},this._knownDavService),this._data.status=e}move(e){s({...this._data,source:e},this._knownDavService);const i=this.basename;this._data.source=e,this.displayname===i&&this.basename!==i&&(this.displayname=this.basename)}rename(e){if(e.includes("/"))throw new Error("Invalid basename");this.move(d(this.source)+"/"+e)}updateMtime(){this._data.mtime&&(this._data.mtime=new Date)}update(e){for(const[i,r]of Object.entries(e))try{r===void 0?delete this.attributes[i]:this.attributes[i]=r}catch(a){if(a instanceof TypeError)continue;throw a}}clone(){return new this.constructor(structuredClone(this._data),this._knownDavService)}toJSON(){return JSON.stringify([structuredClone(this._data),this._knownDavService.toString()])}}class k extends c{constructor(...[e,i]){super(e,i)}get type(){return u.File}}class A extends c{constructor(...[e,i]){super({...e,mime:"httpd/unix-directory"},i)}get type(){return u.Folder}get extension(){return null}get mime(){return"httpd/unix-directory"}}export{u as F,D as N,o as P,k as a,A as b,x as l,I as s}; +//# sourceMappingURL=folder-29HuacU_-CwocT1ij.chunk.mjs.map diff --git a/dist/folder-D9CBQngR-CuPN_AFd.chunk.mjs.license b/dist/folder-29HuacU_-CwocT1ij.chunk.mjs.license similarity index 90% rename from dist/folder-D9CBQngR-CuPN_AFd.chunk.mjs.license rename to dist/folder-29HuacU_-CwocT1ij.chunk.mjs.license index 62b49fdbf837d..42d500e0bc625 100644 --- a/dist/folder-D9CBQngR-CuPN_AFd.chunk.mjs.license +++ b/dist/folder-29HuacU_-CwocT1ij.chunk.mjs.license @@ -3,5 +3,5 @@ SPDX-FileCopyrightText: Nextcloud GmbH and Nextcloud contributors This file is generated from multiple sources. Included packages: - @nextcloud/files - - version: 4.0.0-rc.3 + - version: 4.0.0 - license: AGPL-3.0-or-later diff --git a/dist/folder-29HuacU_-CwocT1ij.chunk.mjs.map b/dist/folder-29HuacU_-CwocT1ij.chunk.mjs.map new file mode 100644 index 0000000000000..717cd1d287e9c --- /dev/null +++ b/dist/folder-29HuacU_-CwocT1ij.chunk.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"folder-29HuacU_-CwocT1ij.chunk.mjs","sources":["../node_modules/@nextcloud/files/dist/chunks/folder-29HuacU_.mjs"],"sourcesContent":["import { getLoggerBuilder } from \"@nextcloud/logger\";\nimport { join, encodePath, basename, extname, dirname } from \"@nextcloud/paths\";\nwindow._nc_files_scope ??= {};\nwindow._nc_files_scope.v4_0 ??= {};\nconst scopedGlobals = window._nc_files_scope.v4_0;\nconst logger = getLoggerBuilder().setApp(\"@nextcloud/files\").detectUser().build();\nconst FileType = Object.freeze({\n Folder: \"folder\",\n File: \"file\"\n});\nconst Permission = Object.freeze({\n /**\n * No permissions granted\n */\n NONE: 0,\n /**\n * Can read the file content\n */\n READ: 1,\n /**\n * Can modify the file itself (move, rename, etc)\n */\n UPDATE: 2,\n /**\n * Can create new files/folders inside a folder\n */\n CREATE: 4,\n /**\n * Can change the file content\n */\n WRITE: 4,\n /**\n * Can delete the node\n */\n DELETE: 8,\n /**\n * Can share the node\n */\n SHARE: 16,\n /**\n * All permissions are granted\n */\n ALL: 31\n});\nconst NodeStatus = Object.freeze({\n /** This is a new node and it doesn't exists on the filesystem yet */\n NEW: \"new\",\n /** This node has failed and is unavailable */\n FAILED: \"failed\",\n /** This node is currently loading or have an operation in progress */\n LOADING: \"loading\",\n /** This node is locked and cannot be modified */\n LOCKED: \"locked\"\n});\nfunction isDavResource(source, davService) {\n return source.match(davService) !== null;\n}\nfunction validateData(data, davService) {\n if (data.id && typeof data.id !== \"number\" && typeof data.id !== \"string\") {\n throw new Error(\"Invalid id type of value\");\n }\n if (!data.source) {\n throw new Error(\"Missing mandatory source\");\n }\n try {\n new URL(data.source);\n } catch {\n throw new Error(\"Invalid source format, source must be a valid URL\");\n }\n if (!data.source.startsWith(\"http\")) {\n throw new Error(\"Invalid source format, only http(s) is supported\");\n }\n if (!data.root) {\n throw new Error(\"Missing mandatory root\");\n }\n if (typeof data.root !== \"string\") {\n throw new Error(\"Invalid root type\");\n }\n if (!data.root.startsWith(\"/\")) {\n throw new Error(\"Root must start with a leading slash\");\n }\n if (!data.source.includes(data.root)) {\n throw new Error(\"Root must be part of the source\");\n }\n if (isDavResource(data.source, davService)) {\n const service = data.source.match(davService)[0];\n if (!data.source.includes(join(service, data.root))) {\n throw new Error(\"The root must be relative to the service. e.g /files/emma\");\n }\n }\n if (data.displayname && typeof data.displayname !== \"string\") {\n throw new Error(\"Invalid displayname type\");\n }\n if (data.mtime && !(data.mtime instanceof Date)) {\n throw new Error(\"Invalid mtime type\");\n }\n if (data.crtime && !(data.crtime instanceof Date)) {\n throw new Error(\"Invalid crtime type\");\n }\n if (!data.mime || typeof data.mime !== \"string\" || !data.mime.match(/^[-\\w.]+\\/[-+\\w.]+$/gi)) {\n throw new Error(\"Missing or invalid mandatory mime\");\n }\n if (\"size\" in data && typeof data.size !== \"number\" && data.size !== void 0) {\n throw new Error(\"Invalid size type\");\n }\n if (\"permissions\" in data && data.permissions !== void 0 && !(typeof data.permissions === \"number\" && data.permissions >= Permission.NONE && data.permissions <= Permission.ALL)) {\n throw new Error(\"Invalid permissions\");\n }\n if (data.owner && data.owner !== null && typeof data.owner !== \"string\") {\n throw new Error(\"Invalid owner type\");\n }\n if (data.attributes && typeof data.attributes !== \"object\") {\n throw new Error(\"Invalid attributes type\");\n }\n if (data.status && !Object.values(NodeStatus).includes(data.status)) {\n throw new Error(\"Status must be a valid NodeStatus\");\n }\n}\nfunction fixDates(data) {\n if (data.mtime && typeof data.mtime === \"string\") {\n if (!isNaN(Date.parse(data.mtime)) && JSON.stringify(new Date(data.mtime)) === JSON.stringify(data.mtime)) {\n data.mtime = new Date(data.mtime);\n }\n }\n if (data.crtime && typeof data.crtime === \"string\") {\n if (!isNaN(Date.parse(data.crtime)) && JSON.stringify(new Date(data.crtime)) === JSON.stringify(data.crtime)) {\n data.crtime = new Date(data.crtime);\n }\n }\n}\nfunction fixRegExp(pattern) {\n if (pattern instanceof RegExp) {\n return pattern;\n }\n const matches = pattern.match(/(\\/?)(.+)\\1([a-z]*)/i);\n if (!matches) {\n throw new Error(\"Invalid regular expression format.\");\n }\n const validFlags = Array.from(new Set(matches[3])).filter((flag) => \"gimsuy\".includes(flag)).join(\"\");\n return new RegExp(matches[2], validFlags);\n}\nclass Node {\n _attributes;\n _data;\n _knownDavService = /(remote|public)\\.php\\/(web)?dav/i;\n readonlyAttributes = Object.entries(Object.getOwnPropertyDescriptors(Node.prototype)).filter((e) => typeof e[1].get === \"function\" && e[0] !== \"__proto__\").map((e) => e[0]);\n handler = {\n set: (target, prop, value) => {\n if (this.readonlyAttributes.includes(prop)) {\n return false;\n }\n return Reflect.set(target, prop, value);\n },\n deleteProperty: (target, prop) => {\n if (this.readonlyAttributes.includes(prop)) {\n return false;\n }\n return Reflect.deleteProperty(target, prop);\n }\n };\n constructor(...[data, davService]) {\n if (!data.mime) {\n data.mime = \"application/octet-stream\";\n }\n fixDates(data);\n davService = fixRegExp(davService || this._knownDavService);\n validateData(data, davService);\n this._data = {\n ...data,\n attributes: {}\n };\n this._attributes = new Proxy(this._data.attributes, this.handler);\n this.update(data.attributes ?? {});\n if (davService) {\n this._knownDavService = davService;\n }\n }\n /**\n * Get the source url to this object\n * There is no setter as the source is not meant to be changed manually.\n * You can use the rename or move method to change the source.\n */\n get source() {\n return this._data.source.replace(/\\/$/i, \"\");\n }\n /**\n * Get the encoded source url to this object for requests purposes\n */\n get encodedSource() {\n const { origin } = new URL(this.source);\n return origin + encodePath(this.source.slice(origin.length));\n }\n /**\n * Get this object name\n * There is no setter as the source is not meant to be changed manually.\n * You can use the rename or move method to change the source.\n */\n get basename() {\n return basename(this.source);\n }\n /**\n * The nodes displayname\n * By default the display name and the `basename` are identical,\n * but it is possible to have a different name. This happens\n * on the files app for example for shared folders.\n */\n get displayname() {\n return this._data.displayname || this.basename;\n }\n /**\n * Set the displayname\n */\n set displayname(displayname) {\n validateData({ ...this._data, displayname }, this._knownDavService);\n this._data.displayname = displayname;\n }\n /**\n * Get this object's extension\n * There is no setter as the source is not meant to be changed manually.\n * You can use the rename or move method to change the source.\n */\n get extension() {\n return extname(this.source);\n }\n /**\n * Get the directory path leading to this object\n * Will use the relative path to root if available\n *\n * There is no setter as the source is not meant to be changed manually.\n * You can use the rename or move method to change the source.\n */\n get dirname() {\n return dirname(this.path);\n }\n /**\n * Get the file mime\n */\n get mime() {\n return this._data.mime || \"application/octet-stream\";\n }\n /**\n * Set the file mime\n * Removing the mime type will set it to `application/octet-stream`\n */\n set mime(mime) {\n mime ??= \"application/octet-stream\";\n validateData({ ...this._data, mime }, this._knownDavService);\n this._data.mime = mime;\n }\n /**\n * Get the file modification time\n */\n get mtime() {\n return this._data.mtime;\n }\n /**\n * Set the file modification time\n */\n set mtime(mtime) {\n validateData({ ...this._data, mtime }, this._knownDavService);\n this._data.mtime = mtime;\n }\n /**\n * Get the file creation time\n * There is no setter as the creation time is not meant to be changed\n */\n get crtime() {\n return this._data.crtime;\n }\n /**\n * Get the file size\n */\n get size() {\n return this._data.size;\n }\n /**\n * Set the file size\n */\n set size(size) {\n validateData({ ...this._data, size }, this._knownDavService);\n this.updateMtime();\n this._data.size = size;\n }\n /**\n * Get the file attribute\n * This contains all additional attributes not provided by the Node class\n */\n get attributes() {\n return this._attributes;\n }\n /**\n * Get the file permissions\n */\n get permissions() {\n if (this.owner === null && !this.isDavResource) {\n return Permission.READ;\n }\n return this._data.permissions !== void 0 ? this._data.permissions : Permission.NONE;\n }\n /**\n * Set the file permissions\n */\n set permissions(permissions) {\n validateData({ ...this._data, permissions }, this._knownDavService);\n this.updateMtime();\n this._data.permissions = permissions;\n }\n /**\n * Get the file owner\n * There is no setter as the owner is not meant to be changed\n */\n get owner() {\n if (!this.isDavResource) {\n return null;\n }\n return this._data.owner;\n }\n /**\n * Is this a dav-related resource ?\n */\n get isDavResource() {\n return isDavResource(this.source, this._knownDavService);\n }\n /**\n * Get the dav root of this object\n * There is no setter as the root is not meant to be changed\n */\n get root() {\n return this._data.root.replace(/^(.+)\\/$/, \"$1\");\n }\n /**\n * Get the absolute path of this object relative to the root\n */\n get path() {\n const idx = this.source.indexOf(\"://\");\n const protocol = this.source.slice(0, idx);\n const remainder = this.source.slice(idx + 3);\n const slashIndex = remainder.indexOf(\"/\");\n const host = remainder.slice(0, slashIndex);\n const rawPath = remainder.slice(slashIndex);\n const safeUrl = `${protocol}://${host}${encodePath(rawPath)}`;\n const url = new URL(safeUrl);\n let source = decodeURIComponent(url.pathname);\n if (this.isDavResource) {\n source = source.split(this._knownDavService).pop();\n }\n const firstMatch = source.indexOf(this.root);\n const root = this.root.replace(/\\/$/, \"\");\n return source.slice(firstMatch + root.length) || \"/\";\n }\n /**\n * Get the nodes file id if defined.\n * There is no setter as the fileid is not meant to be changed.\n *\n * @deprecated Nextcloud is migrating to snowflake ids which are strings. Use the `id` attribute instead.\n */\n get fileid() {\n return typeof this._data?.id === \"number\" ? this._data.id : void 0;\n }\n /**\n * Get the nodes id - if defined.\n *\n * Note: As Nextcloud is migrating to snowflake ids the id has to be a string,\n * due to limitations of the JavaScript number type (snowflake ids are 64bit JavaScript numbers can only accurately represent integers up to 53 bit).\n */\n get id() {\n if (typeof this._data?.id === \"undefined\" || typeof this._data.id === \"number\" && this._data.id < 0) {\n return void 0;\n }\n return String(this._data.id);\n }\n /**\n * Get the node status.\n */\n get status() {\n return this._data?.status;\n }\n /**\n * Set the node status.\n */\n set status(status) {\n validateData({ ...this._data, status }, this._knownDavService);\n this._data.status = status;\n }\n /**\n * Move the node to a new destination\n *\n * @param destination the new source.\n * e.g. https://cloud.domain.com/remote.php/dav/files/emma/Photos/picture.jpg\n */\n move(destination) {\n validateData({ ...this._data, source: destination }, this._knownDavService);\n const oldBasename = this.basename;\n this._data.source = destination;\n if (this.displayname === oldBasename && this.basename !== oldBasename) {\n this.displayname = this.basename;\n }\n }\n /**\n * Rename the node\n * This aliases the move method for easier usage\n *\n * @param basename The new name of the node\n */\n rename(basename2) {\n if (basename2.includes(\"/\")) {\n throw new Error(\"Invalid basename\");\n }\n this.move(dirname(this.source) + \"/\" + basename2);\n }\n /**\n * Update the mtime if exists\n */\n updateMtime() {\n if (this._data.mtime) {\n this._data.mtime = /* @__PURE__ */ new Date();\n }\n }\n /**\n * Update the attributes of the node\n * Warning, updating attributes will NOT automatically update the mtime.\n *\n * @param attributes The new attributes to update on the Node attributes\n */\n update(attributes) {\n for (const [name, value] of Object.entries(attributes)) {\n try {\n if (value === void 0) {\n delete this.attributes[name];\n } else {\n this.attributes[name] = value;\n }\n } catch (e) {\n if (e instanceof TypeError) {\n continue;\n }\n throw e;\n }\n }\n }\n /**\n * Returns a clone of the node\n */\n clone() {\n return new this.constructor(structuredClone(this._data), this._knownDavService);\n }\n /**\n * JSON representation of the node\n */\n toJSON() {\n return JSON.stringify([structuredClone(this._data), this._knownDavService.toString()]);\n }\n}\nclass File extends Node {\n constructor(...[data, davService]) {\n super(data, davService);\n }\n get type() {\n return FileType.File;\n }\n}\nclass Folder extends Node {\n constructor(...[data, davService]) {\n super({\n ...data,\n mime: \"httpd/unix-directory\"\n }, davService);\n }\n get type() {\n return FileType.Folder;\n }\n get extension() {\n return null;\n }\n get mime() {\n return \"httpd/unix-directory\";\n }\n}\nexport {\n FileType as F,\n Node as N,\n Permission as P,\n File as a,\n Folder as b,\n NodeStatus as c,\n logger as l,\n scopedGlobals as s\n};\n//# sourceMappingURL=folder-29HuacU_.mjs.map\n"],"names":["scopedGlobals","logger","getLoggerBuilder","FileType","Permission","NodeStatus","isDavResource","source","davService","validateData","data","service","join","fixDates","fixRegExp","pattern","matches","validFlags","flag","Node","e","target","prop","value","origin","encodePath","basename","displayname","extname","dirname","mime","mtime","size","permissions","idx","protocol","remainder","slashIndex","host","rawPath","safeUrl","url","firstMatch","root","status","destination","oldBasename","basename2","attributes","name","File","Folder"],"mappings":"qHAEA,OAAO,kBAAoB,CAAA,EAC3B,OAAO,gBAA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S,CACP,OAAO,KAAK,UAAU,CAAC,gBAAgB,KAAK,KAAK,EAAG,KAAK,iBAAiB,SAAQ,CAAE,CAAC,CACvF,CACF,CACA,MAAM8B,UAAa/B,CAAK,CACtB,eAAe,CAACT,EAAMF,CAAU,EAAG,CACjC,MAAME,EAAMF,CAAU,CACxB,CACA,IAAI,MAAO,CACT,OAAOL,EAAS,IAClB,CACF,CACA,MAAMgD,UAAehC,CAAK,CACxB,eAAe,CAACT,EAAMF,CAAU,EAAG,CACjC,MAAM,CACJ,GAAGE,EACH,KAAM,sBACZ,EAAOF,CAAU,CACf,CACA,IAAI,MAAO,CACT,OAAOL,EAAS,MAClB,CACA,IAAI,WAAY,CACd,OAAO,IACT,CACA,IAAI,MAAO,CACT,MAAO,sBACT,CACF","x_google_ignoreList":[0]} \ No newline at end of file diff --git a/dist/folder-D9CBQngR-CuPN_AFd.chunk.mjs.map.license b/dist/folder-29HuacU_-CwocT1ij.chunk.mjs.map.license similarity index 90% rename from dist/folder-D9CBQngR-CuPN_AFd.chunk.mjs.map.license rename to dist/folder-29HuacU_-CwocT1ij.chunk.mjs.map.license index 62b49fdbf837d..42d500e0bc625 100644 --- a/dist/folder-D9CBQngR-CuPN_AFd.chunk.mjs.map.license +++ b/dist/folder-29HuacU_-CwocT1ij.chunk.mjs.map.license @@ -3,5 +3,5 @@ SPDX-FileCopyrightText: Nextcloud GmbH and Nextcloud contributors This file is generated from multiple sources. Included packages: - @nextcloud/files - - version: 4.0.0-rc.3 + - version: 4.0.0 - license: AGPL-3.0-or-later diff --git a/dist/folder-D9CBQngR-CuPN_AFd.chunk.mjs b/dist/folder-D9CBQngR-CuPN_AFd.chunk.mjs deleted file mode 100644 index b13e9fa2ebce0..0000000000000 --- a/dist/folder-D9CBQngR-CuPN_AFd.chunk.mjs +++ /dev/null @@ -1,2 +0,0 @@ -import{g as y}from"./index-Bndk0DrU.chunk.mjs";import{e as m,c as g,f as b,d as u,j as E}from"./index-xFugdZPW.chunk.mjs";window._nc_files_scope??={},window._nc_files_scope.v4_0??={};const I=window._nc_files_scope.v4_0,x=y().setApp("@nextcloud/files").detectUser().build(),d=Object.freeze({Folder:"folder",File:"file"}),a=Object.freeze({NONE:0,READ:1,UPDATE:2,CREATE:4,WRITE:4,DELETE:8,SHARE:16,ALL:31}),D=Object.freeze({NEW:"new",FAILED:"failed",LOADING:"loading",LOCKED:"locked"});function h(t,e){return t.match(e)!==null}function s(t,e){if(t.id&&typeof t.id!="number")throw new Error("Invalid id type of value");if(!t.source)throw new Error("Missing mandatory source");try{new URL(t.source)}catch{throw new Error("Invalid source format, source must be a valid URL")}if(!t.source.startsWith("http"))throw new Error("Invalid source format, only http(s) is supported");if(!t.root)throw new Error("Missing mandatory root");if(typeof t.root!="string")throw new Error("Invalid root type");if(!t.root.startsWith("/"))throw new Error("Root must start with a leading slash");if(!t.source.includes(t.root))throw new Error("Root must be part of the source");if(h(t.source,e)){const i=t.source.match(e)[0];if(!t.source.includes(E(i,t.root)))throw new Error("The root must be relative to the service. e.g /files/emma")}if(t.displayname&&typeof t.displayname!="string")throw new Error("Invalid displayname type");if(t.mtime&&!(t.mtime instanceof Date))throw new Error("Invalid mtime type");if(t.crtime&&!(t.crtime instanceof Date))throw new Error("Invalid crtime type");if(!t.mime||typeof t.mime!="string"||!t.mime.match(/^[-\w.]+\/[-+\w.]+$/gi))throw new Error("Missing or invalid mandatory mime");if("size"in t&&typeof t.size!="number"&&t.size!==void 0)throw new Error("Invalid size type");if("permissions"in t&&t.permissions!==void 0&&!(typeof t.permissions=="number"&&t.permissions>=a.NONE&&t.permissions<=a.ALL))throw new Error("Invalid permissions");if(t.owner&&t.owner!==null&&typeof t.owner!="string")throw new Error("Invalid owner type");if(t.attributes&&typeof t.attributes!="object")throw new Error("Invalid attributes type");if(t.status&&!Object.values(D).includes(t.status))throw new Error("Status must be a valid NodeStatus")}function S(t){t.mtime&&typeof t.mtime=="string"&&!isNaN(Date.parse(t.mtime))&&JSON.stringify(new Date(t.mtime))===JSON.stringify(t.mtime)&&(t.mtime=new Date(t.mtime)),t.crtime&&typeof t.crtime=="string"&&!isNaN(Date.parse(t.crtime))&&JSON.stringify(new Date(t.crtime))===JSON.stringify(t.crtime)&&(t.crtime=new Date(t.crtime))}function O(t){if(t instanceof RegExp)return t;const e=t.match(/(\/?)(.+)\1([a-z]*)/i);if(!e)throw new Error("Invalid regular expression format.");const i=Array.from(new Set(e[3])).filter(r=>"gimsuy".includes(r)).join("");return new RegExp(e[2],i)}class c{_attributes;_data;_knownDavService=/(remote|public)\.php\/(web)?dav/i;readonlyAttributes=Object.entries(Object.getOwnPropertyDescriptors(c.prototype)).filter(e=>typeof e[1].get=="function"&&e[0]!=="__proto__").map(e=>e[0]);handler={set:(e,i,r)=>this.readonlyAttributes.includes(i)?!1:Reflect.set(e,i,r),deleteProperty:(e,i)=>this.readonlyAttributes.includes(i)?!1:Reflect.deleteProperty(e,i)};constructor(...[e,i]){e.mime||(e.mime="application/octet-stream"),S(e),i=O(i||this._knownDavService),s(e,i),this._data={...e,attributes:{}},this._attributes=new Proxy(this._data.attributes,this.handler),this.update(e.attributes??{}),i&&(this._knownDavService=i)}get source(){return this._data.source.replace(/\/$/i,"")}get encodedSource(){const{origin:e}=new URL(this.source);return e+m(this.source.slice(e.length))}get basename(){return g(this.source)}get displayname(){return this._data.displayname||this.basename}set displayname(e){s({...this._data,displayname:e},this._knownDavService),this._data.displayname=e}get extension(){return b(this.source)}get dirname(){return u(this.path)}get mime(){return this._data.mime||"application/octet-stream"}set mime(e){e??="application/octet-stream",s({...this._data,mime:e},this._knownDavService),this._data.mime=e}get mtime(){return this._data.mtime}set mtime(e){s({...this._data,mtime:e},this._knownDavService),this._data.mtime=e}get crtime(){return this._data.crtime}get size(){return this._data.size}set size(e){s({...this._data,size:e},this._knownDavService),this.updateMtime(),this._data.size=e}get attributes(){return this._attributes}get permissions(){return this.owner===null&&!this.isDavResource?a.READ:this._data.permissions!==void 0?this._data.permissions:a.NONE}set permissions(e){s({...this._data,permissions:e},this._knownDavService),this.updateMtime(),this._data.permissions=e}get owner(){return this.isDavResource?this._data.owner:null}get isDavResource(){return h(this.source,this._knownDavService)}get root(){return this._data.root.replace(/^(.+)\/$/,"$1")}get path(){const e=this.source.indexOf("://"),i=this.source.slice(0,e),r=this.source.slice(e+3),n=r.indexOf("/"),l=r.slice(0,n),p=r.slice(n),w=`${i}://${l}${m(p)}`,f=new URL(w);let o=decodeURIComponent(f.pathname);this.isDavResource&&(o=o.split(this._knownDavService).pop());const _=o.indexOf(this.root),v=this.root.replace(/\/$/,"");return o.slice(_+v.length)||"/"}get fileid(){return this._data?.id}get status(){return this._data?.status}set status(e){s({...this._data,status:e},this._knownDavService),this._data.status=e}move(e){s({...this._data,source:e},this._knownDavService);const i=this.basename;this._data.source=e,this.displayname===i&&this.basename!==i&&(this.displayname=this.basename)}rename(e){if(e.includes("/"))throw new Error("Invalid basename");this.move(u(this.source)+"/"+e)}updateMtime(){this._data.mtime&&(this._data.mtime=new Date)}update(e){for(const[i,r]of Object.entries(e))try{r===void 0?delete this.attributes[i]:this.attributes[i]=r}catch(n){if(n instanceof TypeError)continue;throw n}}clone(){return new this.constructor(structuredClone(this._data),this._knownDavService)}toJSON(){return JSON.stringify([structuredClone(this._data),this._knownDavService.toString()])}}class k extends c{constructor(...[e,i]){super(e,i)}get type(){return d.File}}class A extends c{constructor(...[e,i]){super({...e,mime:"httpd/unix-directory"},i)}get type(){return d.Folder}get extension(){return null}get mime(){return"httpd/unix-directory"}}export{d as F,D as N,a as P,k as a,A as b,x as l,I as s}; -//# sourceMappingURL=folder-D9CBQngR-CuPN_AFd.chunk.mjs.map diff --git a/dist/folder-D9CBQngR-CuPN_AFd.chunk.mjs.map b/dist/folder-D9CBQngR-CuPN_AFd.chunk.mjs.map deleted file mode 100644 index 8b6c9f0e875d4..0000000000000 --- a/dist/folder-D9CBQngR-CuPN_AFd.chunk.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"folder-D9CBQngR-CuPN_AFd.chunk.mjs","sources":["../node_modules/@nextcloud/files/dist/chunks/folder-D9CBQngR.mjs"],"sourcesContent":["import { getLoggerBuilder } from \"@nextcloud/logger\";\nimport { join, encodePath, basename, extname, dirname } from \"@nextcloud/paths\";\nwindow._nc_files_scope ??= {};\nwindow._nc_files_scope.v4_0 ??= {};\nconst scopedGlobals = window._nc_files_scope.v4_0;\nconst logger = getLoggerBuilder().setApp(\"@nextcloud/files\").detectUser().build();\nconst FileType = Object.freeze({\n Folder: \"folder\",\n File: \"file\"\n});\nconst Permission = Object.freeze({\n /**\n * No permissions granted\n */\n NONE: 0,\n /**\n * Can read the file content\n */\n READ: 1,\n /**\n * Can modify the file itself (move, rename, etc)\n */\n UPDATE: 2,\n /**\n * Can create new files/folders inside a folder\n */\n CREATE: 4,\n /**\n * Can change the file content\n */\n WRITE: 4,\n /**\n * Can delete the node\n */\n DELETE: 8,\n /**\n * Can share the node\n */\n SHARE: 16,\n /**\n * All permissions are granted\n */\n ALL: 31\n});\nconst NodeStatus = Object.freeze({\n /** This is a new node and it doesn't exists on the filesystem yet */\n NEW: \"new\",\n /** This node has failed and is unavailable */\n FAILED: \"failed\",\n /** This node is currently loading or have an operation in progress */\n LOADING: \"loading\",\n /** This node is locked and cannot be modified */\n LOCKED: \"locked\"\n});\nfunction isDavResource(source, davService) {\n return source.match(davService) !== null;\n}\nfunction validateData(data, davService) {\n if (data.id && typeof data.id !== \"number\") {\n throw new Error(\"Invalid id type of value\");\n }\n if (!data.source) {\n throw new Error(\"Missing mandatory source\");\n }\n try {\n new URL(data.source);\n } catch {\n throw new Error(\"Invalid source format, source must be a valid URL\");\n }\n if (!data.source.startsWith(\"http\")) {\n throw new Error(\"Invalid source format, only http(s) is supported\");\n }\n if (!data.root) {\n throw new Error(\"Missing mandatory root\");\n }\n if (typeof data.root !== \"string\") {\n throw new Error(\"Invalid root type\");\n }\n if (!data.root.startsWith(\"/\")) {\n throw new Error(\"Root must start with a leading slash\");\n }\n if (!data.source.includes(data.root)) {\n throw new Error(\"Root must be part of the source\");\n }\n if (isDavResource(data.source, davService)) {\n const service = data.source.match(davService)[0];\n if (!data.source.includes(join(service, data.root))) {\n throw new Error(\"The root must be relative to the service. e.g /files/emma\");\n }\n }\n if (data.displayname && typeof data.displayname !== \"string\") {\n throw new Error(\"Invalid displayname type\");\n }\n if (data.mtime && !(data.mtime instanceof Date)) {\n throw new Error(\"Invalid mtime type\");\n }\n if (data.crtime && !(data.crtime instanceof Date)) {\n throw new Error(\"Invalid crtime type\");\n }\n if (!data.mime || typeof data.mime !== \"string\" || !data.mime.match(/^[-\\w.]+\\/[-+\\w.]+$/gi)) {\n throw new Error(\"Missing or invalid mandatory mime\");\n }\n if (\"size\" in data && typeof data.size !== \"number\" && data.size !== void 0) {\n throw new Error(\"Invalid size type\");\n }\n if (\"permissions\" in data && data.permissions !== void 0 && !(typeof data.permissions === \"number\" && data.permissions >= Permission.NONE && data.permissions <= Permission.ALL)) {\n throw new Error(\"Invalid permissions\");\n }\n if (data.owner && data.owner !== null && typeof data.owner !== \"string\") {\n throw new Error(\"Invalid owner type\");\n }\n if (data.attributes && typeof data.attributes !== \"object\") {\n throw new Error(\"Invalid attributes type\");\n }\n if (data.status && !Object.values(NodeStatus).includes(data.status)) {\n throw new Error(\"Status must be a valid NodeStatus\");\n }\n}\nfunction fixDates(data) {\n if (data.mtime && typeof data.mtime === \"string\") {\n if (!isNaN(Date.parse(data.mtime)) && JSON.stringify(new Date(data.mtime)) === JSON.stringify(data.mtime)) {\n data.mtime = new Date(data.mtime);\n }\n }\n if (data.crtime && typeof data.crtime === \"string\") {\n if (!isNaN(Date.parse(data.crtime)) && JSON.stringify(new Date(data.crtime)) === JSON.stringify(data.crtime)) {\n data.crtime = new Date(data.crtime);\n }\n }\n}\nfunction fixRegExp(pattern) {\n if (pattern instanceof RegExp) {\n return pattern;\n }\n const matches = pattern.match(/(\\/?)(.+)\\1([a-z]*)/i);\n if (!matches) {\n throw new Error(\"Invalid regular expression format.\");\n }\n const validFlags = Array.from(new Set(matches[3])).filter((flag) => \"gimsuy\".includes(flag)).join(\"\");\n return new RegExp(matches[2], validFlags);\n}\nclass Node {\n _attributes;\n _data;\n _knownDavService = /(remote|public)\\.php\\/(web)?dav/i;\n readonlyAttributes = Object.entries(Object.getOwnPropertyDescriptors(Node.prototype)).filter((e) => typeof e[1].get === \"function\" && e[0] !== \"__proto__\").map((e) => e[0]);\n handler = {\n set: (target, prop, value) => {\n if (this.readonlyAttributes.includes(prop)) {\n return false;\n }\n return Reflect.set(target, prop, value);\n },\n deleteProperty: (target, prop) => {\n if (this.readonlyAttributes.includes(prop)) {\n return false;\n }\n return Reflect.deleteProperty(target, prop);\n }\n };\n constructor(...[data, davService]) {\n if (!data.mime) {\n data.mime = \"application/octet-stream\";\n }\n fixDates(data);\n davService = fixRegExp(davService || this._knownDavService);\n validateData(data, davService);\n this._data = {\n ...data,\n attributes: {}\n };\n this._attributes = new Proxy(this._data.attributes, this.handler);\n this.update(data.attributes ?? {});\n if (davService) {\n this._knownDavService = davService;\n }\n }\n /**\n * Get the source url to this object\n * There is no setter as the source is not meant to be changed manually.\n * You can use the rename or move method to change the source.\n */\n get source() {\n return this._data.source.replace(/\\/$/i, \"\");\n }\n /**\n * Get the encoded source url to this object for requests purposes\n */\n get encodedSource() {\n const { origin } = new URL(this.source);\n return origin + encodePath(this.source.slice(origin.length));\n }\n /**\n * Get this object name\n * There is no setter as the source is not meant to be changed manually.\n * You can use the rename or move method to change the source.\n */\n get basename() {\n return basename(this.source);\n }\n /**\n * The nodes displayname\n * By default the display name and the `basename` are identical,\n * but it is possible to have a different name. This happens\n * on the files app for example for shared folders.\n */\n get displayname() {\n return this._data.displayname || this.basename;\n }\n /**\n * Set the displayname\n */\n set displayname(displayname) {\n validateData({ ...this._data, displayname }, this._knownDavService);\n this._data.displayname = displayname;\n }\n /**\n * Get this object's extension\n * There is no setter as the source is not meant to be changed manually.\n * You can use the rename or move method to change the source.\n */\n get extension() {\n return extname(this.source);\n }\n /**\n * Get the directory path leading to this object\n * Will use the relative path to root if available\n *\n * There is no setter as the source is not meant to be changed manually.\n * You can use the rename or move method to change the source.\n */\n get dirname() {\n return dirname(this.path);\n }\n /**\n * Get the file mime\n */\n get mime() {\n return this._data.mime || \"application/octet-stream\";\n }\n /**\n * Set the file mime\n * Removing the mime type will set it to `application/octet-stream`\n */\n set mime(mime) {\n mime ??= \"application/octet-stream\";\n validateData({ ...this._data, mime }, this._knownDavService);\n this._data.mime = mime;\n }\n /**\n * Get the file modification time\n */\n get mtime() {\n return this._data.mtime;\n }\n /**\n * Set the file modification time\n */\n set mtime(mtime) {\n validateData({ ...this._data, mtime }, this._knownDavService);\n this._data.mtime = mtime;\n }\n /**\n * Get the file creation time\n * There is no setter as the creation time is not meant to be changed\n */\n get crtime() {\n return this._data.crtime;\n }\n /**\n * Get the file size\n */\n get size() {\n return this._data.size;\n }\n /**\n * Set the file size\n */\n set size(size) {\n validateData({ ...this._data, size }, this._knownDavService);\n this.updateMtime();\n this._data.size = size;\n }\n /**\n * Get the file attribute\n * This contains all additional attributes not provided by the Node class\n */\n get attributes() {\n return this._attributes;\n }\n /**\n * Get the file permissions\n */\n get permissions() {\n if (this.owner === null && !this.isDavResource) {\n return Permission.READ;\n }\n return this._data.permissions !== void 0 ? this._data.permissions : Permission.NONE;\n }\n /**\n * Set the file permissions\n */\n set permissions(permissions) {\n validateData({ ...this._data, permissions }, this._knownDavService);\n this.updateMtime();\n this._data.permissions = permissions;\n }\n /**\n * Get the file owner\n * There is no setter as the owner is not meant to be changed\n */\n get owner() {\n if (!this.isDavResource) {\n return null;\n }\n return this._data.owner;\n }\n /**\n * Is this a dav-related resource ?\n */\n get isDavResource() {\n return isDavResource(this.source, this._knownDavService);\n }\n /**\n * Get the dav root of this object\n * There is no setter as the root is not meant to be changed\n */\n get root() {\n return this._data.root.replace(/^(.+)\\/$/, \"$1\");\n }\n /**\n * Get the absolute path of this object relative to the root\n */\n get path() {\n const idx = this.source.indexOf(\"://\");\n const protocol = this.source.slice(0, idx);\n const remainder = this.source.slice(idx + 3);\n const slashIndex = remainder.indexOf(\"/\");\n const host = remainder.slice(0, slashIndex);\n const rawPath = remainder.slice(slashIndex);\n const safeUrl = `${protocol}://${host}${encodePath(rawPath)}`;\n const url = new URL(safeUrl);\n let source = decodeURIComponent(url.pathname);\n if (this.isDavResource) {\n source = source.split(this._knownDavService).pop();\n }\n const firstMatch = source.indexOf(this.root);\n const root = this.root.replace(/\\/$/, \"\");\n return source.slice(firstMatch + root.length) || \"/\";\n }\n /**\n * Get the node id if defined.\n * There is no setter as the fileid is not meant to be changed\n */\n get fileid() {\n return this._data?.id;\n }\n /**\n * Get the node status.\n */\n get status() {\n return this._data?.status;\n }\n /**\n * Set the node status.\n */\n set status(status) {\n validateData({ ...this._data, status }, this._knownDavService);\n this._data.status = status;\n }\n /**\n * Move the node to a new destination\n *\n * @param destination the new source.\n * e.g. https://cloud.domain.com/remote.php/dav/files/emma/Photos/picture.jpg\n */\n move(destination) {\n validateData({ ...this._data, source: destination }, this._knownDavService);\n const oldBasename = this.basename;\n this._data.source = destination;\n if (this.displayname === oldBasename && this.basename !== oldBasename) {\n this.displayname = this.basename;\n }\n }\n /**\n * Rename the node\n * This aliases the move method for easier usage\n *\n * @param basename The new name of the node\n */\n rename(basename2) {\n if (basename2.includes(\"/\")) {\n throw new Error(\"Invalid basename\");\n }\n this.move(dirname(this.source) + \"/\" + basename2);\n }\n /**\n * Update the mtime if exists\n */\n updateMtime() {\n if (this._data.mtime) {\n this._data.mtime = /* @__PURE__ */ new Date();\n }\n }\n /**\n * Update the attributes of the node\n * Warning, updating attributes will NOT automatically update the mtime.\n *\n * @param attributes The new attributes to update on the Node attributes\n */\n update(attributes) {\n for (const [name, value] of Object.entries(attributes)) {\n try {\n if (value === void 0) {\n delete this.attributes[name];\n } else {\n this.attributes[name] = value;\n }\n } catch (e) {\n if (e instanceof TypeError) {\n continue;\n }\n throw e;\n }\n }\n }\n /**\n * Returns a clone of the node\n */\n clone() {\n return new this.constructor(structuredClone(this._data), this._knownDavService);\n }\n /**\n * JSON representation of the node\n */\n toJSON() {\n return JSON.stringify([structuredClone(this._data), this._knownDavService.toString()]);\n }\n}\nclass File extends Node {\n constructor(...[data, davService]) {\n super(data, davService);\n }\n get type() {\n return FileType.File;\n }\n}\nclass Folder extends Node {\n constructor(...[data, davService]) {\n super({\n ...data,\n mime: \"httpd/unix-directory\"\n }, davService);\n }\n get type() {\n return FileType.Folder;\n }\n get extension() {\n return null;\n }\n get mime() {\n return \"httpd/unix-directory\";\n }\n}\nexport {\n FileType as F,\n Node as N,\n Permission as P,\n File as a,\n Folder as b,\n NodeStatus as c,\n logger as l,\n scopedGlobals as s\n};\n//# sourceMappingURL=folder-D9CBQngR.mjs.map\n"],"names":["scopedGlobals","logger","getLoggerBuilder","FileType","Permission","NodeStatus","isDavResource","source","davService","validateData","data","service","join","fixDates","fixRegExp","pattern","matches","validFlags","flag","Node","e","target","prop","value","origin","encodePath","basename","displayname","extname","dirname","mime","mtime","size","permissions","idx","protocol","remainder","slashIndex","host","rawPath","safeUrl","url","firstMatch","root","status","destination","oldBasename","basename2","attributes","name","File","Folder"],"mappings":"0HAEA,OAAO,kBAAoB,CAAA,EAC3B,OAAO,gBAAgB,OAAS,CAAA,EAC3B,MAACA,EAAgB,OAAO,gBAAgB,KACvCC,EAASC,EAAgB,EAAG,OAAO,kBAAkB,EAAE,WAAU,EAAG,MAAK,EACzEC,EAAW,OAAO,OAAO,CAC7B,OAAQ,SACR,KAAM,MACR,CAAC,EACKC,EAAa,OAAO,OAAO,CAI/B,KAAM,EAIN,KAAM,EAIN,OAAQ,EAIR,OAAQ,EAIR,MAAO,EAIP,OAAQ,EAIR,MAAO,GAIP,IAAK,EACP,CAAC,EACKC,EAAa,OAAO,OAAO,CAE/B,IAAK,MAEL,OAAQ,SAER,QAAS,UAET,OAAQ,QACV,CAAC,EACD,SAASC,EAAcC,EAAQC,EAAY,CACzC,OAAOD,EAAO,MA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KAAK,SAE5B,CAOA,OAAOC,EAAW,CAChB,GAAIA,EAAU,SAAS,GAAG,EACxB,MAAM,IAAI,MAAM,kBAAkB,EAEpC,KAAK,KAAKlB,EAAQ,KAAK,MAAM,EAAI,IAAMkB,CAAS,CAClD,CAIA,aAAc,CACR,KAAK,MAAM,QACb,KAAK,MAAM,MAAwB,IAAI,KAE3C,CAOA,OAAOC,EAAY,CACjB,SAAW,CAACC,EAAM1B,CAAK,IAAK,OAAO,QAAQyB,CAAU,EACnD,GAAI,CACEzB,IAAU,OACZ,OAAO,KAAK,WAAW0B,CAAI,EAE3B,KAAK,WAAWA,CAAI,EAAI1B,CAE5B,OAASH,EAAG,CACV,GAAIA,aAAa,UACf,SAEF,MAAMA,CACR,CAEJ,CAIA,OAAQ,CACN,OAAO,IAAI,KAAK,YAAY,gBAAgB,KAAK,KAAK,EAAG,KAAK,gBAAgB,CAChF,CAIA,QAAS,CACP,OAAO,KAAK,UAAU,CAAC,gBAAgB,KAAK,KAAK,EAAG,KAAK,iBAAiB,SAAQ,CAAE,CAAC,CACvF,CACF,CACA,MAAM8B,UAAa/B,CAAK,CACtB,eAAe,CAACT,EAAMF,CAAU,EAAG,CACjC,MAAME,EAAMF,CAAU,CACxB,CACA,IAAI,MAAO,CACT,OAAOL,EAAS,IAClB,CACF,CACA,MAAMgD,UAAehC,CAAK,CACxB,eAAe,CAACT,EAAMF,CAAU,EAAG,CACjC,MAAM,CACJ,GAAGE,EACH,KAAM,sBACZ,EAAOF,CAAU,CACf,CACA,IAAI,MAAO,CACT,OAAOL,EAAS,MAClB,CACA,IAAI,WAAY,CACd,OAAO,IACT,CACA,IAAI,MAAO,CACT,MAAO,sBACT,CACF","x_google_ignoreList":[0]} \ No newline at end of file diff --git a/dist/index-DNfSxz5H.chunk.mjs b/dist/index-sQy2Ug64.chunk.mjs similarity index 99% rename from dist/index-DNfSxz5H.chunk.mjs rename to dist/index-sQy2Ug64.chunk.mjs index 3e340f5db9f8f..e3d99c0b9a4d2 100644 --- a/dist/index-DNfSxz5H.chunk.mjs +++ b/dist/index-sQy2Ug64.chunk.mjs @@ -1,4 +1,4 @@ -import{s as ie,l as de}from"./folder-D9CBQngR-CuPN_AFd.chunk.mjs";import{h as ce,p as Y,f as Gn}from"./index-Bndk0DrU.chunk.mjs";import{a as wt,r as vt,B as Re}from"./string_decoder-BO00msnV.chunk.mjs";import{a as Hn}from"./translation-DoG5ZELJ-Bni_xMHF.chunk.mjs";var Tn=class extends EventTarget{dispatchTypedEvent(t,c){return super.dispatchEvent(c)}},Nt={},_e={exports:{}},Ot;function _t(){if(Ot)return _e.exports;Ot=1;var t=typeof Reflect=="object"?Reflect:null,c=t&&typeof t.apply=="function"?t.apply:function(f,w,S){return Function.prototype.apply.call(f,w,S)},h;t&&typeof t.ownKeys=="function"?h=t.ownKeys:Object.getOwnPropertySymbols?h=function(f){return Object.getOwnPropertyNames(f).concat(Object.getOwnPropertySymbols(f))}:h=function(f){return Object.getOwnPropertyNames(f)};function g(f){console&&console.warn&&console.warn(f)}var O=Number.isNaN||function(f){return f!==f};function p(){p.init.call(this)}_e.exports=p,_e.exports.once=D,p.EventEmitter=p,p.prototype._events=void 0,p.prototype._eventsCount=0,p.prototype._maxListeners=void 0;var b=10;function s(f){if(typeof f!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof f)}Object.defineProperty(p,"defaultMaxListeners",{enumerable:!0,get:function(){return b},set:function(f){if(typeof f!="number"||f<0||O(f))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+f+".");b=f}}),p.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},p.prototype.setMaxListeners=function(f){if(typeof f!="number"||f<0||O(f))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+f+".");return this._maxListeners=f,this};function d(f){return f._maxListeners===void 0?p.defaultMaxListeners:f._maxListeners}p.prototype.getMaxListeners=function(){return d(this)},p.prototype.emit=function(f){for(var w=[],S=1;S0&&(a=w[0]),a instanceof Error)throw a;var q=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw q.context=a,q}var H=k[f];if(H===void 0)return!1;if(typeof H=="function")c(H,this,w);else for(var W=H.length,z=j(H,W),S=0;S0&&q.length>k&&!q.warned){q.warned=!0;var H=new Error("Possible EventEmitter memory leak detected. "+q.length+" "+String(w)+" listeners added. Use emitter.setMaxListeners() to increase limit");H.name="MaxListenersExceededWarning",H.emitter=f,H.type=w,H.count=q.length,g(H)}return f}p.prototype.addListener=function(f,w){return v(this,f,w,!1)},p.prototype.on=p.prototype.addListener,p.prototype.prependListener=function(f,w){return v(this,f,w,!0)};function m(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function E(f,w,S){var M={fired:!1,wrapFn:void 0,target:f,type:w,listener:S},k=m.bind(M);return k.listener=S,M.wrapFn=k,k}p.prototype.once=function(f,w){return s(w),this.on(f,E(this,f,w)),this},p.prototype.prependOnceListener=function(f,w){return s(w),this.prependListener(f,E(this,f,w)),this},p.prototype.removeListener=function(f,w){var S,M,k,a,q;if(s(w),M=this._events,M===void 0)return this;if(S=M[f],S===void 0)return this;if(S===w||S.listener===w)--this._eventsCount===0?this._events=Object.create(null):(delete M[f],M.removeListener&&this.emit("removeListener",f,S.listener||w));else if(typeof S!="function"){for(k=-1,a=S.length-1;a>=0;a--)if(S[a]===w||S[a].listener===w){q=S[a].listener,k=a;break}if(k<0)return this;k===0?S.shift():R(S,k),S.length===1&&(M[f]=S[0]),M.removeListener!==void 0&&this.emit("removeListener",f,q||w)}return this},p.prototype.off=p.prototype.removeListener,p.prototype.removeAllListeners=function(f){var w,S,M;if(S=this._events,S===void 0)return this;if(S.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):S[f]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete S[f]),this;if(arguments.length===0){var k=Object.keys(S),a;for(M=0;M=0;M--)this.removeListener(f,w[M]);return this};function I(f,w,S){var M=f._events;if(M===void 0)return[];var k=M[w];return k===void 0?[]:typeof k=="function"?S?[k.listener||k]:[k]:S?A(k):j(k,k.length)}p.prototype.listeners=function(f){return I(this,f,!0)},p.prototype.rawListeners=function(f){return I(this,f,!1)},p.listenerCount=function(f,w){return typeof f.listenerCount=="function"?f.listenerCount(w):F.call(f,w)},p.prototype.listenerCount=F;function F(f){var w=this._events;if(w!==void 0){var S=w[f];if(typeof S=="function")return 1;if(S!==void 0)return S.length}return 0}p.prototype.eventNames=function(){return this._eventsCount>0?h(this._events):[]};function j(f,w){for(var S=new Array(w),M=0;M"u"||!M?t:M(Uint8Array),$={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?t:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?t:ArrayBuffer,"%ArrayIteratorPrototype%":S&&M?M([][Symbol.iterator]()):t,"%AsyncFromSyncIteratorPrototype%":t,"%AsyncFunction%":W,"%AsyncGenerator%":W,"%AsyncGeneratorFunction%":W,"%AsyncIteratorPrototype%":W,"%Atomics%":typeof Atomics>"u"?t:Atomics,"%BigInt%":typeof BigInt>"u"?t:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?t:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?t:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?t:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":h,"%eval%":eval,"%EvalError%":g,"%Float16Array%":typeof Float16Array>"u"?t:Float16Array,"%Float32Array%":typeof Float32Array>"u"?t:Float32Array,"%Float64Array%":typeof Float64Array>"u"?t:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?t:FinalizationRegistry,"%Function%":A,"%GeneratorFunction%":W,"%Int8Array%":typeof Int8Array>"u"?t:Int8Array,"%Int16Array%":typeof Int16Array>"u"?t:Int16Array,"%Int32Array%":typeof Int32Array>"u"?t:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":S&&M?M(M([][Symbol.iterator]())):t,"%JSON%":typeof JSON=="object"?JSON:t,"%Map%":typeof Map>"u"?t:Map,"%MapIteratorPrototype%":typeof Map>"u"||!S||!M?t:M(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":c,"%Object.getOwnPropertyDescriptor%":P,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?t:Promise,"%Proxy%":typeof Proxy>"u"?t:Proxy,"%RangeError%":O,"%ReferenceError%":p,"%Reflect%":typeof Reflect>"u"?t:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?t:Set,"%SetIteratorPrototype%":typeof Set>"u"||!S||!M?t:M(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?t:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":S&&M?M(""[Symbol.iterator]()):t,"%Symbol%":S?Symbol:t,"%SyntaxError%":b,"%ThrowTypeError%":w,"%TypedArray%":z,"%TypeError%":s,"%Uint8Array%":typeof Uint8Array>"u"?t:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?t:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?t:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?t:Uint32Array,"%URIError%":d,"%WeakMap%":typeof WeakMap>"u"?t:WeakMap,"%WeakRef%":typeof WeakRef>"u"?t:WeakRef,"%WeakSet%":typeof WeakSet>"u"?t:WeakSet,"%Function.prototype.call%":H,"%Function.prototype.apply%":q,"%Object.defineProperty%":L,"%Object.getPrototypeOf%":k,"%Math.abs%":v,"%Math.floor%":m,"%Math.max%":E,"%Math.min%":I,"%Math.pow%":F,"%Math.round%":j,"%Math.sign%":R,"%Reflect.getPrototypeOf%":a};if(M)try{null.error}catch(u){var K=M(M(u));$["%Error.prototype%"]=K}var re=function u(o){var n;if(o==="%AsyncFunction%")n=D("async function () {}");else if(o==="%GeneratorFunction%")n=D("function* () {}");else if(o==="%AsyncGeneratorFunction%")n=D("async function* () {}");else if(o==="%AsyncGenerator%"){var i=u("%AsyncGeneratorFunction%");i&&(n=i.prototype)}else if(o==="%AsyncIteratorPrototype%"){var _=u("%AsyncGenerator%");_&&M&&(n=M(_.prototype))}return $[o]=n,n},G={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Z=ve(),J=jn(),X=Z.call(H,Array.prototype.concat),ee=Z.call(q,Array.prototype.splice),te=Z.call(H,String.prototype.replace),y=Z.call(H,String.prototype.slice),T=Z.call(H,RegExp.prototype.exec),C=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,l=/\\(\\)?/g,r=function(u){var o=y(u,0,1),n=y(u,-1);if(o==="%"&&n!=="%")throw new b("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&o!=="%")throw new b("invalid intrinsic syntax, expected opening `%`");var i=[];return te(u,C,function(_,x,B,U){i[i.length]=B?te(U,l,"$1"):x||_}),i},e=function(u,o){var n=u,i;if(J(G,n)&&(i=G[n],n="%"+i[0]+"%"),J($,n)){var _=$[n];if(_===W&&(_=re(n)),typeof _>"u"&&!o)throw new s("intrinsic "+u+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:_}}throw new b("intrinsic "+u+" does not exist!")};return Ve=function(u,o){if(typeof u!="string"||u.length===0)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof o!="boolean")throw new s('"allowMissing" argument must be a boolean');if(T(/^%?[^%]*%?$/,u)===null)throw new b("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=r(u),i=n.length>0?n[0]:"",_=e("%"+i+"%",o),x=_.name,B=_.value,U=!1,V=_.alias;V&&(i=V[0],ee(n,X([0,1],V)));for(var Q=1,N=!0;Q=n.length){var se=P(B,ne);N=!!se,N&&"get"in se&&!("originalValue"in se.get)?B=se.get:B=B[ne]}else N=J(B,ne),B=B[ne];N&&!U&&($[x]=B)}}return B},Ve}var We,Lr;function we(){if(Lr)return We;Lr=1;var t=Pn(),c=St(),h=c([t("%String.prototype.indexOf%")]);return We=function(g,O){var p=t(g,!!O);return typeof p=="function"&&h(g,".prototype.")>-1?c([p]):p},We}var qe,kr;function li(){if(kr)return qe;kr=1;var t=Ee()(),c=we(),h=c("Object.prototype.toString"),g=function(b){return t&&b&&typeof b=="object"&&Symbol.toStringTag in b?!1:h(b)==="[object Arguments]"},O=function(b){return g(b)?!0:b!==null&&typeof b=="object"&&"length"in b&&typeof b.length=="number"&&b.length>=0&&h(b)!=="[object Array]"&&"callee"in b&&h(b.callee)==="[object Function]"},p=(function(){return g(arguments)})();return g.isLegacyArguments=O,qe=p?g:O,qe}var Ge,Fr;function fi(){if(Fr)return Ge;Fr=1;var t=we(),c=Ee()(),h=jn(),g=ye(),O;if(c){var p=t("RegExp.prototype.exec"),b={},s=function(){throw b},d={toString:s,valueOf:s};typeof Symbol.toPrimitive=="symbol"&&(d[Symbol.toPrimitive]=s),O=function(E){if(!E||typeof E!="object")return!1;var I=g(E,"lastIndex"),F=I&&h(I,"value");if(!F)return!1;try{p(E,d)}catch(j){return j===b}}}else{var v=t("Object.prototype.toString"),m="[object RegExp]";O=function(E){return!E||typeof E!="object"&&typeof E!="function"?!1:v(E)===m}}return Ge=O,Ge}var He,Br;function pi(){if(Br)return He;Br=1;var t=we(),c=fi(),h=t("RegExp.prototype.exec"),g=me();return He=function(O){if(!c(O))throw new g("`regex` must be a RegExp");return function(p){return h(O,p)!==null}},He}var Ye,Ur;function di(){if(Ur)return Ye;Ur=1;const t=function*(){}.constructor;return Ye=()=>t,Ye}var ze,Vr;function hi(){if(Vr)return ze;Vr=1;var t=we(),c=pi(),h=c(/^\s*(?:function)?\*/),g=Ee()(),O=At(),p=t("Object.prototype.toString"),b=t("Function.prototype.toString"),s=di();return ze=function(d){if(typeof d!="function")return!1;if(h(b(d)))return!0;if(!g){var v=p(d);return v==="[object GeneratorFunction]"}if(!O)return!1;var m=s();return m&&O(d)===m.prototype},ze}var Xe,Wr;function yi(){if(Wr)return Xe;Wr=1;var t=Function.prototype.toString,c=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,h,g;if(typeof c=="function"&&typeof Object.defineProperty=="function")try{h=Object.defineProperty({},"length",{get:function(){throw g}}),g={},c(function(){throw 42},null,h)}catch(P){P!==g&&(c=null)}else c=null;var O=/^\s*class\b/,p=function(P){try{var L=t.call(P);return O.test(L)}catch{return!1}},b=function(P){try{return p(P)?!1:(t.call(P),!0)}catch{return!1}},s=Object.prototype.toString,d="[object Object]",v="[object Function]",m="[object GeneratorFunction]",E="[object HTMLAllCollection]",I="[object HTML document.all class]",F="[object HTMLCollection]",j=typeof Symbol=="function"&&!!Symbol.toStringTag,R=!(0 in[,]),A=function(){return!1};if(typeof document=="object"){var D=document.all;s.call(D)===s.call(document.all)&&(A=function(P){if((R||!P)&&(typeof P>"u"||typeof P=="object"))try{var L=s.call(P);return(L===E||L===I||L===F||L===d)&&P("")==null}catch{}return!1})}return Xe=c?function(P){if(A(P))return!0;if(!P||typeof P!="function"&&typeof P!="object")return!1;try{c(P,null,h)}catch(L){if(L!==g)return!1}return!p(P)&&b(P)}:function(P){if(A(P))return!0;if(!P||typeof P!="function"&&typeof P!="object")return!1;if(j)return b(P);if(p(P))return!1;var L=s.call(P);return L!==v&&L!==m&&!/^\[object HTML/.test(L)?!1:b(P)},Xe}var $e,qr;function gi(){if(qr)return $e;qr=1;var t=yi(),c=Object.prototype.toString,h=Object.prototype.hasOwnProperty,g=function(s,d,v){for(var m=0,E=s.length;m=3&&(m=v),b(s)?g(s,d,m):typeof s=="string"?O(s,d,m):p(s,d,m)},$e}var Gr,Hr;function bi(){return Hr||(Hr=1,Gr=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),Gr}var Qe,Yr;function mi(){if(Yr)return Qe;Yr=1;var t=bi(),c=typeof globalThis>"u"?ce:globalThis;return Qe=function(){for(var h=[],g=0;g3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new h("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new h("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new h("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new h("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,d=arguments.length>4?arguments[4]:null,v=arguments.length>5?arguments[5]:null,m=arguments.length>6?arguments[6]:!1,E=!!g&&g(O,p);if(t)t(O,p,{configurable:v===null&&E?E.configurable:!v,enumerable:s===null&&E?E.enumerable:!s,value:b,writable:d===null&&E?E.writable:!d});else if(m||!s&&!d&&!v)O[p]=b;else throw new c("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Je}var Ke,$r;function wi(){if($r)return Ke;$r=1;var t=Te(),c=function(){return!!t};return c.hasArrayLengthDefineBug=function(){if(!t)return null;try{return t([],"length",{value:1}).length!==1}catch{return!0}},Ke=c,Ke}var Ze,Qr;function _i(){if(Qr)return Ze;Qr=1;var t=Pn(),c=vi(),h=wi()(),g=ye(),O=me(),p=t("%Math.floor%");return Ze=function(b,s){if(typeof b!="function")throw new O("`fn` is not a function");if(typeof s!="number"||s<0||s>4294967295||p(s)!==s)throw new O("`length` must be a positive 32-bit integer");var d=arguments.length>2&&!!arguments[2],v=!0,m=!0;if("length"in b&&g){var E=g(b,"length");E&&!E.configurable&&(v=!1),E&&!E.writable&&(m=!1)}return(v||m||!d)&&(h?c(b,"length",s,!0,!0):c(b,"length",s)),b},Ze}var et,Jr;function Ei(){if(Jr)return et;Jr=1;var t=ve(),c=Tt(),h=Dn();return et=function(){return h(t,c,arguments)},et}var Kr;function Ti(){return Kr||(Kr=1,(function(t){var c=_i(),h=Te(),g=St(),O=Ei();t.exports=function(p){var b=g(arguments),s=p.length-(arguments.length-1);return c(b,1+(s>0?s:0),!0)},h?h(t.exports,"apply",{value:O}):t.exports.apply=O})(zr)),zr.exports}var tt,Zr;function xn(){if(Zr)return tt;Zr=1;var t=gi(),c=mi(),h=Ti(),g=we(),O=ye(),p=At(),b=g("Object.prototype.toString"),s=Ee()(),d=typeof globalThis>"u"?ce:globalThis,v=c(),m=g("String.prototype.slice"),E=g("Array.prototype.indexOf",!0)||function(R,A){for(var D=0;D-1?A:A!=="Object"?!1:j(R)}return O?F(R):null},tt}var rt,en;function Si(){if(en)return rt;en=1;var t=xn();return rt=function(c){return!!t(c)},rt}var tn;function Ai(){return tn||(tn=1,(function(t){var c=li(),h=hi(),g=xn(),O=Si();function p(N){return N.call.bind(N)}var b=typeof BigInt<"u",s=typeof Symbol<"u",d=p(Object.prototype.toString),v=p(Number.prototype.valueOf),m=p(String.prototype.valueOf),E=p(Boolean.prototype.valueOf);if(b)var I=p(BigInt.prototype.valueOf);if(s)var F=p(Symbol.prototype.valueOf);function j(N,ne){if(typeof N!="object")return!1;try{return ne(N),!0}catch{return!1}}t.isArgumentsObject=c,t.isGeneratorFunction=h,t.isTypedArray=O;function R(N){return typeof Promise<"u"&&N instanceof Promise||N!==null&&typeof N=="object"&&typeof N.then=="function"&&typeof N.catch=="function"}t.isPromise=R;function A(N){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(N):O(N)||y(N)}t.isArrayBufferView=A;function D(N){return g(N)==="Uint8Array"}t.isUint8Array=D;function P(N){return g(N)==="Uint8ClampedArray"}t.isUint8ClampedArray=P;function L(N){return g(N)==="Uint16Array"}t.isUint16Array=L;function f(N){return g(N)==="Uint32Array"}t.isUint32Array=f;function w(N){return g(N)==="Int8Array"}t.isInt8Array=w;function S(N){return g(N)==="Int16Array"}t.isInt16Array=S;function M(N){return g(N)==="Int32Array"}t.isInt32Array=M;function k(N){return g(N)==="Float32Array"}t.isFloat32Array=k;function a(N){return g(N)==="Float64Array"}t.isFloat64Array=a;function q(N){return g(N)==="BigInt64Array"}t.isBigInt64Array=q;function H(N){return g(N)==="BigUint64Array"}t.isBigUint64Array=H;function W(N){return d(N)==="[object Map]"}W.working=typeof Map<"u"&&W(new Map);function z(N){return typeof Map>"u"?!1:W.working?W(N):N instanceof Map}t.isMap=z;function $(N){return d(N)==="[object Set]"}$.working=typeof Set<"u"&&$(new Set);function K(N){return typeof Set>"u"?!1:$.working?$(N):N instanceof Set}t.isSet=K;function re(N){return d(N)==="[object WeakMap]"}re.working=typeof WeakMap<"u"&&re(new WeakMap);function G(N){return typeof WeakMap>"u"?!1:re.working?re(N):N instanceof WeakMap}t.isWeakMap=G;function Z(N){return d(N)==="[object WeakSet]"}Z.working=typeof WeakSet<"u"&&Z(new WeakSet);function J(N){return Z(N)}t.isWeakSet=J;function X(N){return d(N)==="[object ArrayBuffer]"}X.working=typeof ArrayBuffer<"u"&&X(new ArrayBuffer);function ee(N){return typeof ArrayBuffer>"u"?!1:X.working?X(N):N instanceof ArrayBuffer}t.isArrayBuffer=ee;function te(N){return d(N)==="[object DataView]"}te.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&te(new DataView(new ArrayBuffer(1),0,1));function y(N){return typeof DataView>"u"?!1:te.working?te(N):N instanceof DataView}t.isDataView=y;var T=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function C(N){return d(N)==="[object SharedArrayBuffer]"}function l(N){return typeof T>"u"?!1:(typeof C.working>"u"&&(C.working=C(new T)),C.working?C(N):N instanceof T)}t.isSharedArrayBuffer=l;function r(N){return d(N)==="[object AsyncFunction]"}t.isAsyncFunction=r;function e(N){return d(N)==="[object Map Iterator]"}t.isMapIterator=e;function u(N){return d(N)==="[object Set Iterator]"}t.isSetIterator=u;function o(N){return d(N)==="[object Generator]"}t.isGeneratorObject=o;function n(N){return d(N)==="[object WebAssembly.Module]"}t.isWebAssemblyCompiledModule=n;function i(N){return j(N,v)}t.isNumberObject=i;function _(N){return j(N,m)}t.isStringObject=_;function x(N){return j(N,E)}t.isBooleanObject=x;function B(N){return b&&j(N,I)}t.isBigIntObject=B;function U(N){return s&&j(N,F)}t.isSymbolObject=U;function V(N){return i(N)||_(N)||x(N)||B(N)||U(N)}t.isBoxedPrimitive=V;function Q(N){return typeof Uint8Array<"u"&&(ee(N)||l(N))}t.isAnyArrayBuffer=Q,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(N){Object.defineProperty(t,N,{enumerable:!1,value:function(){throw new Error(N+" is not supported in userland")}})})})(xt)),xt}var rn,nn;function Ri(){return nn||(nn=1,rn=function(t){return t&&typeof t=="object"&&typeof t.copy=="function"&&typeof t.fill=="function"&&typeof t.readUInt8=="function"}),rn}var on;function Cn(){return on||(on=1,(function(t){var c={},h=Object.getOwnPropertyDescriptors||function(y){for(var T=Object.keys(y),C={},l=0;l=r)return n;switch(n){case"%s":return String(l[C++]);case"%d":return Number(l[C++]);case"%j":try{return JSON.stringify(l[C++])}catch{return"[Circular]"}default:return n}}),u=l[C];C"u")return function(){return t.deprecate(y,T).apply(this,arguments)};var C=!1;function l(){if(!C){if(Y.throwDeprecation)throw new Error(T);Y.traceDeprecation?console.trace(T):console.error(T),C=!0}return y.apply(this,arguments)}return l};var O={},p=/^$/;if(c.NODE_DEBUG){var b=c.NODE_DEBUG;b=b.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),p=new RegExp("^"+b+"$","i")}t.debuglog=function(y){if(y=y.toUpperCase(),!O[y])if(p.test(y)){var T=Y.pid;O[y]=function(){var C=t.format.apply(t,arguments);console.error("%s %d: %s",y,T,C)}}else O[y]=function(){};return O[y]};function s(y,T){var C={seen:[],stylize:v};return arguments.length>=3&&(C.depth=arguments[2]),arguments.length>=4&&(C.colors=arguments[3]),P(T)?C.showHidden=T:T&&t._extend(C,T),k(C.showHidden)&&(C.showHidden=!1),k(C.depth)&&(C.depth=2),k(C.colors)&&(C.colors=!1),k(C.customInspect)&&(C.customInspect=!0),C.colors&&(C.stylize=d),E(C,y,C.depth)}t.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function d(y,T){var C=s.styles[T];return C?"\x1B["+s.colors[C][0]+"m"+y+"\x1B["+s.colors[C][1]+"m":y}function v(y,T){return y}function m(y){var T={};return y.forEach(function(C,l){T[C]=!0}),T}function E(y,T,C){if(y.customInspect&&T&&z(T.inspect)&&T.inspect!==t.inspect&&!(T.constructor&&T.constructor.prototype===T)){var l=T.inspect(C,y);return S(l)||(l=E(y,l,C)),l}var r=I(y,T);if(r)return r;var e=Object.keys(T),u=m(e);if(y.showHidden&&(e=Object.getOwnPropertyNames(T)),W(T)&&(e.indexOf("message")>=0||e.indexOf("description")>=0))return F(T);if(e.length===0){if(z(T)){var o=T.name?": "+T.name:"";return y.stylize("[Function"+o+"]","special")}if(a(T))return y.stylize(RegExp.prototype.toString.call(T),"regexp");if(H(T))return y.stylize(Date.prototype.toString.call(T),"date");if(W(T))return F(T)}var n="",i=!1,_=["{","}"];if(D(T)&&(i=!0,_=["[","]"]),z(T)){var x=T.name?": "+T.name:"";n=" [Function"+x+"]"}if(a(T)&&(n=" "+RegExp.prototype.toString.call(T)),H(T)&&(n=" "+Date.prototype.toUTCString.call(T)),W(T)&&(n=" "+F(T)),e.length===0&&(!i||T.length==0))return _[0]+n+_[1];if(C<0)return a(T)?y.stylize(RegExp.prototype.toString.call(T),"regexp"):y.stylize("[Object]","special");y.seen.push(T);var B;return i?B=j(y,T,C,u,e):B=e.map(function(U){return R(y,T,C,u,U,i)}),y.seen.pop(),A(B,n,_)}function I(y,T){if(k(T))return y.stylize("undefined","undefined");if(S(T)){var C="'"+JSON.stringify(T).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return y.stylize(C,"string")}if(w(T))return y.stylize(""+T,"number");if(P(T))return y.stylize(""+T,"boolean");if(L(T))return y.stylize("null","null")}function F(y){return"["+Error.prototype.toString.call(y)+"]"}function j(y,T,C,l,r){for(var e=[],u=0,o=T.length;u0&&(a=w[0]),a instanceof Error)throw a;var q=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw q.context=a,q}var H=k[f];if(H===void 0)return!1;if(typeof H=="function")c(H,this,w);else for(var W=H.length,z=j(H,W),S=0;S0&&q.length>k&&!q.warned){q.warned=!0;var H=new Error("Possible EventEmitter memory leak detected. "+q.length+" "+String(w)+" listeners added. Use emitter.setMaxListeners() to increase limit");H.name="MaxListenersExceededWarning",H.emitter=f,H.type=w,H.count=q.length,g(H)}return f}p.prototype.addListener=function(f,w){return v(this,f,w,!1)},p.prototype.on=p.prototype.addListener,p.prototype.prependListener=function(f,w){return v(this,f,w,!0)};function m(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function E(f,w,S){var M={fired:!1,wrapFn:void 0,target:f,type:w,listener:S},k=m.bind(M);return k.listener=S,M.wrapFn=k,k}p.prototype.once=function(f,w){return s(w),this.on(f,E(this,f,w)),this},p.prototype.prependOnceListener=function(f,w){return s(w),this.prependListener(f,E(this,f,w)),this},p.prototype.removeListener=function(f,w){var S,M,k,a,q;if(s(w),M=this._events,M===void 0)return this;if(S=M[f],S===void 0)return this;if(S===w||S.listener===w)--this._eventsCount===0?this._events=Object.create(null):(delete M[f],M.removeListener&&this.emit("removeListener",f,S.listener||w));else if(typeof S!="function"){for(k=-1,a=S.length-1;a>=0;a--)if(S[a]===w||S[a].listener===w){q=S[a].listener,k=a;break}if(k<0)return this;k===0?S.shift():R(S,k),S.length===1&&(M[f]=S[0]),M.removeListener!==void 0&&this.emit("removeListener",f,q||w)}return this},p.prototype.off=p.prototype.removeListener,p.prototype.removeAllListeners=function(f){var w,S,M;if(S=this._events,S===void 0)return this;if(S.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):S[f]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete S[f]),this;if(arguments.length===0){var k=Object.keys(S),a;for(M=0;M=0;M--)this.removeListener(f,w[M]);return this};function I(f,w,S){var M=f._events;if(M===void 0)return[];var k=M[w];return k===void 0?[]:typeof k=="function"?S?[k.listener||k]:[k]:S?A(k):j(k,k.length)}p.prototype.listeners=function(f){return I(this,f,!0)},p.prototype.rawListeners=function(f){return I(this,f,!1)},p.listenerCount=function(f,w){return typeof f.listenerCount=="function"?f.listenerCount(w):F.call(f,w)},p.prototype.listenerCount=F;function F(f){var w=this._events;if(w!==void 0){var S=w[f];if(typeof S=="function")return 1;if(S!==void 0)return S.length}return 0}p.prototype.eventNames=function(){return this._eventsCount>0?h(this._events):[]};function j(f,w){for(var S=new Array(w),M=0;M"u"||!M?t:M(Uint8Array),$={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?t:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?t:ArrayBuffer,"%ArrayIteratorPrototype%":S&&M?M([][Symbol.iterator]()):t,"%AsyncFromSyncIteratorPrototype%":t,"%AsyncFunction%":W,"%AsyncGenerator%":W,"%AsyncGeneratorFunction%":W,"%AsyncIteratorPrototype%":W,"%Atomics%":typeof Atomics>"u"?t:Atomics,"%BigInt%":typeof BigInt>"u"?t:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?t:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?t:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?t:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":h,"%eval%":eval,"%EvalError%":g,"%Float16Array%":typeof Float16Array>"u"?t:Float16Array,"%Float32Array%":typeof Float32Array>"u"?t:Float32Array,"%Float64Array%":typeof Float64Array>"u"?t:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?t:FinalizationRegistry,"%Function%":A,"%GeneratorFunction%":W,"%Int8Array%":typeof Int8Array>"u"?t:Int8Array,"%Int16Array%":typeof Int16Array>"u"?t:Int16Array,"%Int32Array%":typeof Int32Array>"u"?t:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":S&&M?M(M([][Symbol.iterator]())):t,"%JSON%":typeof JSON=="object"?JSON:t,"%Map%":typeof Map>"u"?t:Map,"%MapIteratorPrototype%":typeof Map>"u"||!S||!M?t:M(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":c,"%Object.getOwnPropertyDescriptor%":P,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?t:Promise,"%Proxy%":typeof Proxy>"u"?t:Proxy,"%RangeError%":O,"%ReferenceError%":p,"%Reflect%":typeof Reflect>"u"?t:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?t:Set,"%SetIteratorPrototype%":typeof Set>"u"||!S||!M?t:M(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?t:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":S&&M?M(""[Symbol.iterator]()):t,"%Symbol%":S?Symbol:t,"%SyntaxError%":b,"%ThrowTypeError%":w,"%TypedArray%":z,"%TypeError%":s,"%Uint8Array%":typeof Uint8Array>"u"?t:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?t:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?t:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?t:Uint32Array,"%URIError%":d,"%WeakMap%":typeof WeakMap>"u"?t:WeakMap,"%WeakRef%":typeof WeakRef>"u"?t:WeakRef,"%WeakSet%":typeof WeakSet>"u"?t:WeakSet,"%Function.prototype.call%":H,"%Function.prototype.apply%":q,"%Object.defineProperty%":L,"%Object.getPrototypeOf%":k,"%Math.abs%":v,"%Math.floor%":m,"%Math.max%":E,"%Math.min%":I,"%Math.pow%":F,"%Math.round%":j,"%Math.sign%":R,"%Reflect.getPrototypeOf%":a};if(M)try{null.error}catch(u){var K=M(M(u));$["%Error.prototype%"]=K}var re=function u(o){var n;if(o==="%AsyncFunction%")n=D("async function () {}");else if(o==="%GeneratorFunction%")n=D("function* () {}");else if(o==="%AsyncGeneratorFunction%")n=D("async function* () {}");else if(o==="%AsyncGenerator%"){var i=u("%AsyncGeneratorFunction%");i&&(n=i.prototype)}else if(o==="%AsyncIteratorPrototype%"){var _=u("%AsyncGenerator%");_&&M&&(n=M(_.prototype))}return $[o]=n,n},G={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Z=ve(),J=jn(),X=Z.call(H,Array.prototype.concat),ee=Z.call(q,Array.prototype.splice),te=Z.call(H,String.prototype.replace),y=Z.call(H,String.prototype.slice),T=Z.call(H,RegExp.prototype.exec),C=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,l=/\\(\\)?/g,r=function(u){var o=y(u,0,1),n=y(u,-1);if(o==="%"&&n!=="%")throw new b("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&o!=="%")throw new b("invalid intrinsic syntax, expected opening `%`");var i=[];return te(u,C,function(_,x,B,U){i[i.length]=B?te(U,l,"$1"):x||_}),i},e=function(u,o){var n=u,i;if(J(G,n)&&(i=G[n],n="%"+i[0]+"%"),J($,n)){var _=$[n];if(_===W&&(_=re(n)),typeof _>"u"&&!o)throw new s("intrinsic "+u+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:_}}throw new b("intrinsic "+u+" does not exist!")};return Ve=function(u,o){if(typeof u!="string"||u.length===0)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof o!="boolean")throw new s('"allowMissing" argument must be a boolean');if(T(/^%?[^%]*%?$/,u)===null)throw new b("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=r(u),i=n.length>0?n[0]:"",_=e("%"+i+"%",o),x=_.name,B=_.value,U=!1,V=_.alias;V&&(i=V[0],ee(n,X([0,1],V)));for(var Q=1,N=!0;Q=n.length){var se=P(B,ne);N=!!se,N&&"get"in se&&!("originalValue"in se.get)?B=se.get:B=B[ne]}else N=J(B,ne),B=B[ne];N&&!U&&($[x]=B)}}return B},Ve}var We,Lr;function we(){if(Lr)return We;Lr=1;var t=Pn(),c=St(),h=c([t("%String.prototype.indexOf%")]);return We=function(g,O){var p=t(g,!!O);return typeof p=="function"&&h(g,".prototype.")>-1?c([p]):p},We}var qe,kr;function li(){if(kr)return qe;kr=1;var t=Ee()(),c=we(),h=c("Object.prototype.toString"),g=function(b){return t&&b&&typeof b=="object"&&Symbol.toStringTag in b?!1:h(b)==="[object Arguments]"},O=function(b){return g(b)?!0:b!==null&&typeof b=="object"&&"length"in b&&typeof b.length=="number"&&b.length>=0&&h(b)!=="[object Array]"&&"callee"in b&&h(b.callee)==="[object Function]"},p=(function(){return g(arguments)})();return g.isLegacyArguments=O,qe=p?g:O,qe}var Ge,Fr;function fi(){if(Fr)return Ge;Fr=1;var t=we(),c=Ee()(),h=jn(),g=ye(),O;if(c){var p=t("RegExp.prototype.exec"),b={},s=function(){throw b},d={toString:s,valueOf:s};typeof Symbol.toPrimitive=="symbol"&&(d[Symbol.toPrimitive]=s),O=function(E){if(!E||typeof E!="object")return!1;var I=g(E,"lastIndex"),F=I&&h(I,"value");if(!F)return!1;try{p(E,d)}catch(j){return j===b}}}else{var v=t("Object.prototype.toString"),m="[object RegExp]";O=function(E){return!E||typeof E!="object"&&typeof E!="function"?!1:v(E)===m}}return Ge=O,Ge}var He,Br;function pi(){if(Br)return He;Br=1;var t=we(),c=fi(),h=t("RegExp.prototype.exec"),g=me();return He=function(O){if(!c(O))throw new g("`regex` must be a RegExp");return function(p){return h(O,p)!==null}},He}var Ye,Ur;function di(){if(Ur)return Ye;Ur=1;const t=function*(){}.constructor;return Ye=()=>t,Ye}var ze,Vr;function hi(){if(Vr)return ze;Vr=1;var t=we(),c=pi(),h=c(/^\s*(?:function)?\*/),g=Ee()(),O=At(),p=t("Object.prototype.toString"),b=t("Function.prototype.toString"),s=di();return ze=function(d){if(typeof d!="function")return!1;if(h(b(d)))return!0;if(!g){var v=p(d);return v==="[object GeneratorFunction]"}if(!O)return!1;var m=s();return m&&O(d)===m.prototype},ze}var Xe,Wr;function yi(){if(Wr)return Xe;Wr=1;var t=Function.prototype.toString,c=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,h,g;if(typeof c=="function"&&typeof Object.defineProperty=="function")try{h=Object.defineProperty({},"length",{get:function(){throw g}}),g={},c(function(){throw 42},null,h)}catch(P){P!==g&&(c=null)}else c=null;var O=/^\s*class\b/,p=function(P){try{var L=t.call(P);return O.test(L)}catch{return!1}},b=function(P){try{return p(P)?!1:(t.call(P),!0)}catch{return!1}},s=Object.prototype.toString,d="[object Object]",v="[object Function]",m="[object GeneratorFunction]",E="[object HTMLAllCollection]",I="[object HTML document.all class]",F="[object HTMLCollection]",j=typeof Symbol=="function"&&!!Symbol.toStringTag,R=!(0 in[,]),A=function(){return!1};if(typeof document=="object"){var D=document.all;s.call(D)===s.call(document.all)&&(A=function(P){if((R||!P)&&(typeof P>"u"||typeof P=="object"))try{var L=s.call(P);return(L===E||L===I||L===F||L===d)&&P("")==null}catch{}return!1})}return Xe=c?function(P){if(A(P))return!0;if(!P||typeof P!="function"&&typeof P!="object")return!1;try{c(P,null,h)}catch(L){if(L!==g)return!1}return!p(P)&&b(P)}:function(P){if(A(P))return!0;if(!P||typeof P!="function"&&typeof P!="object")return!1;if(j)return b(P);if(p(P))return!1;var L=s.call(P);return L!==v&&L!==m&&!/^\[object HTML/.test(L)?!1:b(P)},Xe}var $e,qr;function gi(){if(qr)return $e;qr=1;var t=yi(),c=Object.prototype.toString,h=Object.prototype.hasOwnProperty,g=function(s,d,v){for(var m=0,E=s.length;m=3&&(m=v),b(s)?g(s,d,m):typeof s=="string"?O(s,d,m):p(s,d,m)},$e}var Gr,Hr;function bi(){return Hr||(Hr=1,Gr=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),Gr}var Qe,Yr;function mi(){if(Yr)return Qe;Yr=1;var t=bi(),c=typeof globalThis>"u"?ce:globalThis;return Qe=function(){for(var h=[],g=0;g3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new h("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new h("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new h("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new h("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,d=arguments.length>4?arguments[4]:null,v=arguments.length>5?arguments[5]:null,m=arguments.length>6?arguments[6]:!1,E=!!g&&g(O,p);if(t)t(O,p,{configurable:v===null&&E?E.configurable:!v,enumerable:s===null&&E?E.enumerable:!s,value:b,writable:d===null&&E?E.writable:!d});else if(m||!s&&!d&&!v)O[p]=b;else throw new c("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Je}var Ke,$r;function wi(){if($r)return Ke;$r=1;var t=Te(),c=function(){return!!t};return c.hasArrayLengthDefineBug=function(){if(!t)return null;try{return t([],"length",{value:1}).length!==1}catch{return!0}},Ke=c,Ke}var Ze,Qr;function _i(){if(Qr)return Ze;Qr=1;var t=Pn(),c=vi(),h=wi()(),g=ye(),O=me(),p=t("%Math.floor%");return Ze=function(b,s){if(typeof b!="function")throw new O("`fn` is not a function");if(typeof s!="number"||s<0||s>4294967295||p(s)!==s)throw new O("`length` must be a positive 32-bit integer");var d=arguments.length>2&&!!arguments[2],v=!0,m=!0;if("length"in b&&g){var E=g(b,"length");E&&!E.configurable&&(v=!1),E&&!E.writable&&(m=!1)}return(v||m||!d)&&(h?c(b,"length",s,!0,!0):c(b,"length",s)),b},Ze}var et,Jr;function Ei(){if(Jr)return et;Jr=1;var t=ve(),c=Tt(),h=Dn();return et=function(){return h(t,c,arguments)},et}var Kr;function Ti(){return Kr||(Kr=1,(function(t){var c=_i(),h=Te(),g=St(),O=Ei();t.exports=function(p){var b=g(arguments),s=p.length-(arguments.length-1);return c(b,1+(s>0?s:0),!0)},h?h(t.exports,"apply",{value:O}):t.exports.apply=O})(zr)),zr.exports}var tt,Zr;function xn(){if(Zr)return tt;Zr=1;var t=gi(),c=mi(),h=Ti(),g=we(),O=ye(),p=At(),b=g("Object.prototype.toString"),s=Ee()(),d=typeof globalThis>"u"?ce:globalThis,v=c(),m=g("String.prototype.slice"),E=g("Array.prototype.indexOf",!0)||function(R,A){for(var D=0;D-1?A:A!=="Object"?!1:j(R)}return O?F(R):null},tt}var rt,en;function Si(){if(en)return rt;en=1;var t=xn();return rt=function(c){return!!t(c)},rt}var tn;function Ai(){return tn||(tn=1,(function(t){var c=li(),h=hi(),g=xn(),O=Si();function p(N){return N.call.bind(N)}var b=typeof BigInt<"u",s=typeof Symbol<"u",d=p(Object.prototype.toString),v=p(Number.prototype.valueOf),m=p(String.prototype.valueOf),E=p(Boolean.prototype.valueOf);if(b)var I=p(BigInt.prototype.valueOf);if(s)var F=p(Symbol.prototype.valueOf);function j(N,ne){if(typeof N!="object")return!1;try{return ne(N),!0}catch{return!1}}t.isArgumentsObject=c,t.isGeneratorFunction=h,t.isTypedArray=O;function R(N){return typeof Promise<"u"&&N instanceof Promise||N!==null&&typeof N=="object"&&typeof N.then=="function"&&typeof N.catch=="function"}t.isPromise=R;function A(N){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(N):O(N)||y(N)}t.isArrayBufferView=A;function D(N){return g(N)==="Uint8Array"}t.isUint8Array=D;function P(N){return g(N)==="Uint8ClampedArray"}t.isUint8ClampedArray=P;function L(N){return g(N)==="Uint16Array"}t.isUint16Array=L;function f(N){return g(N)==="Uint32Array"}t.isUint32Array=f;function w(N){return g(N)==="Int8Array"}t.isInt8Array=w;function S(N){return g(N)==="Int16Array"}t.isInt16Array=S;function M(N){return g(N)==="Int32Array"}t.isInt32Array=M;function k(N){return g(N)==="Float32Array"}t.isFloat32Array=k;function a(N){return g(N)==="Float64Array"}t.isFloat64Array=a;function q(N){return g(N)==="BigInt64Array"}t.isBigInt64Array=q;function H(N){return g(N)==="BigUint64Array"}t.isBigUint64Array=H;function W(N){return d(N)==="[object Map]"}W.working=typeof Map<"u"&&W(new Map);function z(N){return typeof Map>"u"?!1:W.working?W(N):N instanceof Map}t.isMap=z;function $(N){return d(N)==="[object Set]"}$.working=typeof Set<"u"&&$(new Set);function K(N){return typeof Set>"u"?!1:$.working?$(N):N instanceof Set}t.isSet=K;function re(N){return d(N)==="[object WeakMap]"}re.working=typeof WeakMap<"u"&&re(new WeakMap);function G(N){return typeof WeakMap>"u"?!1:re.working?re(N):N instanceof WeakMap}t.isWeakMap=G;function Z(N){return d(N)==="[object WeakSet]"}Z.working=typeof WeakSet<"u"&&Z(new WeakSet);function J(N){return Z(N)}t.isWeakSet=J;function X(N){return d(N)==="[object ArrayBuffer]"}X.working=typeof ArrayBuffer<"u"&&X(new ArrayBuffer);function ee(N){return typeof ArrayBuffer>"u"?!1:X.working?X(N):N instanceof ArrayBuffer}t.isArrayBuffer=ee;function te(N){return d(N)==="[object DataView]"}te.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&te(new DataView(new ArrayBuffer(1),0,1));function y(N){return typeof DataView>"u"?!1:te.working?te(N):N instanceof DataView}t.isDataView=y;var T=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function C(N){return d(N)==="[object SharedArrayBuffer]"}function l(N){return typeof T>"u"?!1:(typeof C.working>"u"&&(C.working=C(new T)),C.working?C(N):N instanceof T)}t.isSharedArrayBuffer=l;function r(N){return d(N)==="[object AsyncFunction]"}t.isAsyncFunction=r;function e(N){return d(N)==="[object Map Iterator]"}t.isMapIterator=e;function u(N){return d(N)==="[object Set Iterator]"}t.isSetIterator=u;function o(N){return d(N)==="[object Generator]"}t.isGeneratorObject=o;function n(N){return d(N)==="[object WebAssembly.Module]"}t.isWebAssemblyCompiledModule=n;function i(N){return j(N,v)}t.isNumberObject=i;function _(N){return j(N,m)}t.isStringObject=_;function x(N){return j(N,E)}t.isBooleanObject=x;function B(N){return b&&j(N,I)}t.isBigIntObject=B;function U(N){return s&&j(N,F)}t.isSymbolObject=U;function V(N){return i(N)||_(N)||x(N)||B(N)||U(N)}t.isBoxedPrimitive=V;function Q(N){return typeof Uint8Array<"u"&&(ee(N)||l(N))}t.isAnyArrayBuffer=Q,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(N){Object.defineProperty(t,N,{enumerable:!1,value:function(){throw new Error(N+" is not supported in userland")}})})})(xt)),xt}var rn,nn;function Ri(){return nn||(nn=1,rn=function(t){return t&&typeof t=="object"&&typeof t.copy=="function"&&typeof t.fill=="function"&&typeof t.readUInt8=="function"}),rn}var on;function Cn(){return on||(on=1,(function(t){var c={},h=Object.getOwnPropertyDescriptors||function(y){for(var T=Object.keys(y),C={},l=0;l=r)return n;switch(n){case"%s":return String(l[C++]);case"%d":return Number(l[C++]);case"%j":try{return JSON.stringify(l[C++])}catch{return"[Circular]"}default:return n}}),u=l[C];C"u")return function(){return t.deprecate(y,T).apply(this,arguments)};var C=!1;function l(){if(!C){if(Y.throwDeprecation)throw new Error(T);Y.traceDeprecation?console.trace(T):console.error(T),C=!0}return y.apply(this,arguments)}return l};var O={},p=/^$/;if(c.NODE_DEBUG){var b=c.NODE_DEBUG;b=b.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),p=new RegExp("^"+b+"$","i")}t.debuglog=function(y){if(y=y.toUpperCase(),!O[y])if(p.test(y)){var T=Y.pid;O[y]=function(){var C=t.format.apply(t,arguments);console.error("%s %d: %s",y,T,C)}}else O[y]=function(){};return O[y]};function s(y,T){var C={seen:[],stylize:v};return arguments.length>=3&&(C.depth=arguments[2]),arguments.length>=4&&(C.colors=arguments[3]),P(T)?C.showHidden=T:T&&t._extend(C,T),k(C.showHidden)&&(C.showHidden=!1),k(C.depth)&&(C.depth=2),k(C.colors)&&(C.colors=!1),k(C.customInspect)&&(C.customInspect=!0),C.colors&&(C.stylize=d),E(C,y,C.depth)}t.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function d(y,T){var C=s.styles[T];return C?"\x1B["+s.colors[C][0]+"m"+y+"\x1B["+s.colors[C][1]+"m":y}function v(y,T){return y}function m(y){var T={};return y.forEach(function(C,l){T[C]=!0}),T}function E(y,T,C){if(y.customInspect&&T&&z(T.inspect)&&T.inspect!==t.inspect&&!(T.constructor&&T.constructor.prototype===T)){var l=T.inspect(C,y);return S(l)||(l=E(y,l,C)),l}var r=I(y,T);if(r)return r;var e=Object.keys(T),u=m(e);if(y.showHidden&&(e=Object.getOwnPropertyNames(T)),W(T)&&(e.indexOf("message")>=0||e.indexOf("description")>=0))return F(T);if(e.length===0){if(z(T)){var o=T.name?": "+T.name:"";return y.stylize("[Function"+o+"]","special")}if(a(T))return y.stylize(RegExp.prototype.toString.call(T),"regexp");if(H(T))return y.stylize(Date.prototype.toString.call(T),"date");if(W(T))return F(T)}var n="",i=!1,_=["{","}"];if(D(T)&&(i=!0,_=["[","]"]),z(T)){var x=T.name?": "+T.name:"";n=" [Function"+x+"]"}if(a(T)&&(n=" "+RegExp.prototype.toString.call(T)),H(T)&&(n=" "+Date.prototype.toUTCString.call(T)),W(T)&&(n=" "+F(T)),e.length===0&&(!i||T.length==0))return _[0]+n+_[1];if(C<0)return a(T)?y.stylize(RegExp.prototype.toString.call(T),"regexp"):y.stylize("[Object]","special");y.seen.push(T);var B;return i?B=j(y,T,C,u,e):B=e.map(function(U){return R(y,T,C,u,U,i)}),y.seen.pop(),A(B,n,_)}function I(y,T){if(k(T))return y.stylize("undefined","undefined");if(S(T)){var C="'"+JSON.stringify(T).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return y.stylize(C,"string")}if(w(T))return y.stylize(""+T,"number");if(P(T))return y.stylize(""+T,"boolean");if(L(T))return y.stylize("null","null")}function F(y){return"["+Error.prototype.toString.call(y)+"]"}function j(y,T,C,l,r){for(var e=[],u=0,o=T.length;u-1&&(e?o=o.split(` `).map(function(i){return" "+i}).join(` `).slice(2):o=` @@ -16,4 +16,4 @@ Actual: `+r.attribValue);else if(o==="xmlns"&&r.attribValue!==j)G(r,"xmlns: pref Actual: `+r.attribValue);else{var n=r.tag,i=r.tags[r.tags.length-1]||r;n.ns===i.ns&&(n.ns=Object.create(i.ns)),n.ns[o]=r.attribValue}r.attribList.push([r.attribName,r.attribValue])}else r.tag.attributes[r.attribName]=r.attribValue,W(r,"onattribute",{name:r.attribName,value:r.attribValue});r.attribName=r.attribValue=""}function ee(r,e){if(r.opt.xmlns){var u=r.tag,o=J(r.tagName);u.prefix=o.prefix,u.local=o.local,u.uri=u.ns[o.prefix]||"",u.prefix&&!u.uri&&(G(r,"Unbound namespace prefix: "+JSON.stringify(r.tagName)),u.uri=o.prefix);var n=r.tags[r.tags.length-1]||r;u.ns&&n.ns!==u.ns&&Object.keys(u.ns).forEach(function(ue){W(r,"onopennamespace",{prefix:ue,uri:u.ns[ue]})});for(var i=0,_=r.attribList.length;i<_;i++){var x=r.attribList[i],B=x[0],U=x[1],V=J(B,!0),Q=V.prefix,N=V.local,ne=Q===""?"":u.ns[Q]||"",ae={name:B,value:U,prefix:Q,local:N,uri:ne};Q&&Q!=="xmlns"&&!ne&&(G(r,"Unbound namespace prefix: "+JSON.stringify(Q)),ae.uri=Q),r.tag.attributes[B]=ae,W(r,"onattribute",ae)}r.attribList.length=0}r.tag.isSelfClosing=!!e,r.sawRoot=!0,r.tags.push(r.tag),W(r,"onopentag",r.tag),e||(!r.noscript&&r.tagName.toLowerCase()==="script"?r.state=a.SCRIPT:r.state=a.TEXT,r.tag=null,r.tagName=""),r.attribName=r.attribValue="",r.attribList.length=0}function te(r){if(!r.tagName){G(r,"Weird empty close tag."),r.textNode+="",r.state=a.TEXT;return}if(r.script){if(r.tagName!=="script"){r.script+="",r.tagName="",r.state=a.SCRIPT;return}W(r,"onscript",r.script),r.script=""}var e=r.tags.length,u=r.tagName;r.strict||(u=u[r.looseCase]());for(var o=u;e--;){var n=r.tags[e];if(n.name!==o)G(r,"Unexpected close tag");else break}if(e<0){G(r,"Unmatched closing tag: "+r.tagName),r.textNode+="",r.state=a.TEXT;return}r.tagName=u;for(var i=r.tags.length;i-- >e;){var _=r.tag=r.tags.pop();r.tagName=r.tag.name,W(r,"onclosetag",r.tagName);var x={};for(var B in _.ns)x[B]=_.ns[B];var U=r.tags[r.tags.length-1]||r;r.opt.xmlns&&_.ns!==U.ns&&Object.keys(_.ns).forEach(function(V){var Q=_.ns[V];W(r,"onclosenamespace",{prefix:V,uri:Q})})}e===0&&(r.closedRoot=!0),r.tagName=r.attribValue=r.attribName="",r.attribList.length=0,r.state=a.TEXT}function y(r){var e=r.entity,u=e.toLowerCase(),o,n="";return r.ENTITIES[e]?r.ENTITIES[e]:r.ENTITIES[u]?r.ENTITIES[u]:(e=u,e.charAt(0)==="#"&&(e.charAt(1)==="x"?(e=e.slice(2),o=parseInt(e,16),n=o.toString(16)):(e=e.slice(1),o=parseInt(e,10),n=o.toString(10))),e=e.replace(/^0+/,""),isNaN(o)||n.toLowerCase()!==e?(G(r,"Invalid character entity"),"&"+r.entity+";"):String.fromCodePoint(o))}function T(r,e){e==="<"?(r.state=a.OPEN_WAKA,r.startTagPosition=r.position):f(e)||(G(r,"Non-whitespace before first tag."),r.textNode=e,r.state=a.TEXT)}function C(r,e){var u="";return e"?(W(e,"onsgmldeclaration",e.sgmlDecl),e.sgmlDecl="",e.state=a.TEXT):(w(o)&&(e.state=a.SGML_DECL_QUOTED),e.sgmlDecl+=o);continue;case a.SGML_DECL_QUOTED:o===e.q&&(e.state=a.SGML_DECL,e.q=""),e.sgmlDecl+=o;continue;case a.DOCTYPE:o===">"?(e.state=a.TEXT,W(e,"ondoctype",e.doctype),e.doctype=!0):(e.doctype+=o,o==="["?e.state=a.DOCTYPE_DTD:w(o)&&(e.state=a.DOCTYPE_QUOTED,e.q=o));continue;case a.DOCTYPE_QUOTED:e.doctype+=o,o===e.q&&(e.q="",e.state=a.DOCTYPE);continue;case a.DOCTYPE_DTD:o==="]"?(e.doctype+=o,e.state=a.DOCTYPE):o==="<"?(e.state=a.OPEN_WAKA,e.startTagPosition=e.position):w(o)?(e.doctype+=o,e.state=a.DOCTYPE_DTD_QUOTED,e.q=o):e.doctype+=o;continue;case a.DOCTYPE_DTD_QUOTED:e.doctype+=o,o===e.q&&(e.state=a.DOCTYPE_DTD,e.q="");continue;case a.COMMENT:o==="-"?e.state=a.COMMENT_ENDING:e.comment+=o;continue;case a.COMMENT_ENDING:o==="-"?(e.state=a.COMMENT_ENDED,e.comment=$(e.opt,e.comment),e.comment&&W(e,"oncomment",e.comment),e.comment=""):(e.comment+="-"+o,e.state=a.COMMENT);continue;case a.COMMENT_ENDED:o!==">"?(G(e,"Malformed comment"),e.comment+="--"+o,e.state=a.COMMENT):e.doctype&&e.doctype!==!0?e.state=a.DOCTYPE_DTD:e.state=a.TEXT;continue;case a.CDATA:o==="]"?e.state=a.CDATA_ENDING:e.cdata+=o;continue;case a.CDATA_ENDING:o==="]"?e.state=a.CDATA_ENDING_2:(e.cdata+="]"+o,e.state=a.CDATA);continue;case a.CDATA_ENDING_2:o===">"?(e.cdata&&W(e,"oncdata",e.cdata),W(e,"onclosecdata"),e.cdata="",e.state=a.TEXT):o==="]"?e.cdata+="]":(e.cdata+="]]"+o,e.state=a.CDATA);continue;case a.PROC_INST:o==="?"?e.state=a.PROC_INST_ENDING:f(o)?e.state=a.PROC_INST_BODY:e.procInstName+=o;continue;case a.PROC_INST_BODY:if(!e.procInstBody&&f(o))continue;o==="?"?e.state=a.PROC_INST_ENDING:e.procInstBody+=o;continue;case a.PROC_INST_ENDING:o===">"?(W(e,"onprocessinginstruction",{name:e.procInstName,body:e.procInstBody}),e.procInstName=e.procInstBody="",e.state=a.TEXT):(e.procInstBody+="?"+o,e.state=a.PROC_INST_BODY);continue;case a.OPEN_TAG:M(D,o)?e.tagName+=o:(Z(e),o===">"?ee(e):o==="/"?e.state=a.OPEN_TAG_SLASH:(f(o)||G(e,"Invalid character in tag name"),e.state=a.ATTRIB));continue;case a.OPEN_TAG_SLASH:o===">"?(ee(e,!0),te(e)):(G(e,"Forward-slash in opening tag not followed by >"),e.state=a.ATTRIB);continue;case a.ATTRIB:if(f(o))continue;o===">"?ee(e):o==="/"?e.state=a.OPEN_TAG_SLASH:M(A,o)?(e.attribName=o,e.attribValue="",e.state=a.ATTRIB_NAME):G(e,"Invalid attribute name");continue;case a.ATTRIB_NAME:o==="="?e.state=a.ATTRIB_VALUE:o===">"?(G(e,"Attribute without value"),e.attribValue=e.attribName,X(e),ee(e)):f(o)?e.state=a.ATTRIB_NAME_SAW_WHITE:M(D,o)?e.attribName+=o:G(e,"Invalid attribute name");continue;case a.ATTRIB_NAME_SAW_WHITE:if(o==="=")e.state=a.ATTRIB_VALUE;else{if(f(o))continue;G(e,"Attribute without value"),e.tag.attributes[e.attribName]="",e.attribValue="",W(e,"onattribute",{name:e.attribName,value:""}),e.attribName="",o===">"?ee(e):M(A,o)?(e.attribName=o,e.state=a.ATTRIB_NAME):(G(e,"Invalid attribute name"),e.state=a.ATTRIB)}continue;case a.ATTRIB_VALUE:if(f(o))continue;w(o)?(e.q=o,e.state=a.ATTRIB_VALUE_QUOTED):(e.opt.unquotedAttributeValues||K(e,"Unquoted attribute value"),e.state=a.ATTRIB_VALUE_UNQUOTED,e.attribValue=o);continue;case a.ATTRIB_VALUE_QUOTED:if(o!==e.q){o==="&"?e.state=a.ATTRIB_VALUE_ENTITY_Q:e.attribValue+=o;continue}X(e),e.q="",e.state=a.ATTRIB_VALUE_CLOSED;continue;case a.ATTRIB_VALUE_CLOSED:f(o)?e.state=a.ATTRIB:o===">"?ee(e):o==="/"?e.state=a.OPEN_TAG_SLASH:M(A,o)?(G(e,"No whitespace between attributes"),e.attribName=o,e.attribValue="",e.state=a.ATTRIB_NAME):G(e,"Invalid attribute name");continue;case a.ATTRIB_VALUE_UNQUOTED:if(!S(o)){o==="&"?e.state=a.ATTRIB_VALUE_ENTITY_U:e.attribValue+=o;continue}X(e),o===">"?ee(e):e.state=a.ATTRIB;continue;case a.CLOSE_TAG:if(e.tagName)o===">"?te(e):M(D,o)?e.tagName+=o:e.script?(e.script+=""?te(e):G(e,"Invalid characters in closing tag");continue;case a.TEXT_ENTITY:case a.ATTRIB_VALUE_ENTITY_Q:case a.ATTRIB_VALUE_ENTITY_U:var _,x;switch(e.state){case a.TEXT_ENTITY:_=a.TEXT,x="textNode";break;case a.ATTRIB_VALUE_ENTITY_Q:_=a.ATTRIB_VALUE_QUOTED,x="attribValue";break;case a.ATTRIB_VALUE_ENTITY_U:_=a.ATTRIB_VALUE_UNQUOTED,x="attribValue";break}if(o===";"){var B=y(e);e.opt.unparsedEntities&&!Object.values(c.XML_ENTITIES).includes(B)?(e.entity="",e.state=_,e.write(B)):(e[x]+=B,e.entity="",e.state=_)}else M(e.entity.length?L:P,o)?e.entity+=o:(G(e,"Invalid character in entity name"),e[x]+="&"+e.entity+o,e.entity="",e.state=_);continue;default:throw new Error(e,"Unknown state: "+e.state)}return e.position>=e.bufferCheckPosition&&O(e),e}String.fromCodePoint||(function(){var r=String.fromCharCode,e=Math.floor,u=function(){var o=16384,n=[],i,_,x=-1,B=arguments.length;if(!B)return"";for(var U="";++x1114111||e(V)!==V)throw RangeError("Invalid code point: "+V);V<=65535?n.push(V):(V-=65536,i=(V>>10)+55296,_=V%1024+56320,n.push(i,_)),(x+1===B||n.length>o)&&(U+=r.apply(null,n),n.length=0)}return U};Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:u,configurable:!0,writable:!0}):String.fromCodePoint=u})()})(t)})(Nt)),Nt}var Mi=Ci();const Li=Gn(Mi),ki={"http://www.w3.org/2000/svg":{ext:"svg",mime:"image/svg+xml"},"http://www.w3.org/1999/xhtml":{ext:"xhtml",mime:"application/xhtml+xml"},"http://www.opengis.net/kml/2.2":{ext:"kml",mime:"application/vnd.google-earth.kml+xml"},"http://www.opengis.net/gml":{ext:"gml",mime:"application/gml+xml"}},Fi={rss:{ext:"rss",mime:"application/rss+xml"},"score-partwise":{ext:"musicxml",mime:"application/vnd.recordare.musicxml+xml"},svg:{ext:"svg",mime:"image/svg+xml"}};class Bi{constructor(c){this.options=c??{},this.firstTag=!0,this.onEnd=!1,this.parser=Li.parser(!0,{xmlns:!0}),this.nesting=0,this.parser.onerror=h=>{h.message.startsWith("Invalid character entity")||(this.fileType=void 0,this.onEnd=!0)},this.parser.onopentag=h=>{++this.nesting,!(!this.firstTag||this.onEnd)&&(this.firstTag=!1,h.uri?this.fileType=ki[h.uri]:h.name&&(this.fileType=Fi[h.name.toLowerCase()]),this.fileType&&!this.options.fullScan&&(this.onEnd=!0))},this.parser.onclosetag=()=>{--this.nesting}}write(c){this.parser.write(c)}close(){this.parser.close(),this.onEnd=!0}isValid(){return this.nesting===0}}function Un(t,{validate:c=!0}={}){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);if(t=t.trim(),t.length===0)return!1;const h=new Bi({fullScan:c});if(c){if(h.write(t),!h.isValid())return!1}else{let g=0;for(;t.length>g&&!h.onEnd;)h.write(t.slice(g,Math.min(g+128,t.length))),g+=128}return h.fileType?.ext==="svg"}class Ui extends Tn{}function Vn(){return ie.registry??=new Ui,ie.registry}const Vi=Object.freeze({DEFAULT:"default",HIDDEN:"hidden"});function Ji(t){if(Wi(t),ie.fileActions??=new Map,ie.fileActions.has(t.id)){de.error(`FileAction ${t.id} already registered`,{action:t});return}ie.fileActions.set(t.id,t),Vn().dispatchTypedEvent("register:action",new CustomEvent("register:action",{detail:t}))}function Wi(t){if(!t.id||typeof t.id!="string")throw new Error("Invalid id");if(!t.displayName||typeof t.displayName!="function")throw new Error("Invalid displayName function");if("title"in t&&typeof t.title!="function")throw new Error("Invalid title function");if(!t.iconSvgInline||typeof t.iconSvgInline!="function")throw new Error("Invalid iconSvgInline function");if(!t.exec||typeof t.exec!="function")throw new Error("Invalid exec function");if("enabled"in t&&typeof t.enabled!="function")throw new Error("Invalid enabled function");if("execBatch"in t&&typeof t.execBatch!="function")throw new Error("Invalid execBatch function");if("order"in t&&typeof t.order!="number")throw new Error("Invalid order");if(t.destructive!==void 0&&typeof t.destructive!="boolean")throw new Error("Invalid destructive flag");if("parent"in t&&typeof t.parent!="string")throw new Error("Invalid parent");if(t.default&&!Object.values(Vi).includes(t.default))throw new Error("Invalid default");if("inline"in t&&typeof t.inline!="function")throw new Error("Invalid inline function");if("renderInline"in t&&typeof t.renderInline!="function")throw new Error("Invalid renderInline function");if("hotkey"in t&&t.hotkey!==void 0){if(typeof t.hotkey!="object")throw new Error("Invalid hotkey configuration");if(typeof t.hotkey.key!="string"||!t.hotkey.key)throw new Error("Missing or invalid hotkey key");if(typeof t.hotkey.description!="string"||!t.hotkey.description)throw new Error("Missing or invalid hotkey description")}}function Ki(t){if(qi(t),ie.fileListActions??=new Map,ie.fileListActions.has(t.id)){de.error(`FileListAction with id "${t.id}" is already registered`,{action:t});return}ie.fileListActions.set(t.id,t),Vn().dispatchTypedEvent("register:listAction",new CustomEvent("register:listAction",{detail:t}))}function qi(t){if(!t.id||typeof t.id!="string")throw new Error("Invalid id");if(!t.displayName||typeof t.displayName!="function")throw new Error("Invalid displayName function");if("iconSvgInline"in t&&typeof t.iconSvgInline!="function")throw new Error("Invalid iconSvgInline function");if("order"in t&&typeof t.order!="number")throw new Error("Invalid order");if("enabled"in t&&typeof t.enabled!="function")throw new Error("Invalid enabled function");if(!t.exec||typeof t.exec!="function")throw new Error("Invalid exec function")}function oe(t,c,h){if(typeof t[c]<"u")if(h==="array"){if(!Array.isArray(t[c]))throw new Error(`View ${c} must be an array`)}else{if(typeof t[c]!==h)throw new Error(`View ${c} must be a ${h}`);if(h==="object"&&(t[c]===null||Array.isArray(t[c])))throw new Error(`View ${c} must be an object`)}}class Zi{_column;constructor(c){Wn(c),this._column=c}get id(){return this._column.id}get title(){return this._column.title}get render(){return this._column.render}get sort(){return this._column.sort}get summary(){return this._column.summary}}function Wn(t){if(typeof t!="object"||t===null)throw new Error("View column must be an object");if(!t.id||typeof t.id!="string")throw new Error("A column id is required");if(!t.title||typeof t.title!="string")throw new Error("A column title is required");if(!t.render||typeof t.render!="function")throw new Error("A render function is required");oe(t,"sort","function"),oe(t,"summary","function")}class eo{_view;constructor(c){qn(c),this._view=c}get id(){return this._view.id}get name(){return this._view.name}get caption(){return this._view.caption}get emptyTitle(){return this._view.emptyTitle}get emptyCaption(){return this._view.emptyCaption}get getContents(){return this._view.getContents}get hidden(){return this._view.hidden}get icon(){return this._view.icon}set icon(c){this._view.icon=c}get order(){return this._view.order}set order(c){this._view.order=c}get params(){return this._view.params}set params(c){this._view.params=c}get columns(){return this._view.columns}get emptyView(){return this._view.emptyView}get parent(){return this._view.parent}get sticky(){return this._view.sticky}get expanded(){return this._view.expanded}set expanded(c){this._view.expanded=c}get defaultSortKey(){return this._view.defaultSortKey}get loadChildViews(){return this._view.loadChildViews}}function qn(t){if(!t.icon||typeof t.icon!="string"||!Un(t.icon))throw new Error("View icon is required and must be a valid svg string");if(!t.id||typeof t.id!="string")throw new Error("View id is required and must be a string");if(!t.getContents||typeof t.getContents!="function")throw new Error("View getContents is required and must be a function");if(!t.name||typeof t.name!="string")throw new Error("View name is required and must be a string");if(oe(t,"caption","string"),oe(t,"columns","array"),oe(t,"defaultSortKey","string"),oe(t,"emptyCaption","string"),oe(t,"emptyTitle","string"),oe(t,"emptyView","function"),oe(t,"expanded","boolean"),oe(t,"hidden","boolean"),oe(t,"loadChildViews","function"),oe(t,"order","number"),oe(t,"params","object"),oe(t,"parent","string"),oe(t,"sticky","boolean"),t.columns&&(t.columns.forEach(Wn),t.columns.reduce((c,h)=>c.add(h.id),new Set).size!==t.columns.length))throw new Error("View columns must have unique ids")}class Gi extends Tn{_views=[];_currentView=null;register(...c){for(const h of c){if(this._views.find(g=>g.id===h.id))throw new Error(`IView id ${h.id} is already registered`);qn(h)}this._views.push(...c),this.dispatchTypedEvent("update",new CustomEvent("update"))}remove(c){const h=this._views.findIndex(g=>g.id===c);h!==-1&&(this._views.splice(h,1),this.dispatchTypedEvent("update",new CustomEvent("update")))}setActive(c){if(c===null)this._currentView=null;else{const g=this._views.find(({id:O})=>O===c);if(!g)throw new Error(`No view with ${c} registered`);this._currentView=g}const h=new CustomEvent("updateActive",{detail:this._currentView});this.dispatchTypedEvent("updateActive",h)}get active(){return this._currentView}get views(){return this._views}}function to(){return ie.navigation??=new Gi,ie.navigation}function ro(t){if(Hi(t),ie.filesSidebarActions??=new Map,ie.filesSidebarActions.has(t.id)){de.warn(`Sidebar action with id "${t.id}" already registered. Skipping.`);return}ie.filesSidebarActions.set(t.id,t),de.debug(`New sidebar action with id "${t.id}" registered.`)}function Hi(t){if(typeof t!="object")throw new Error("Sidebar action is not an object");if(!t.id||typeof t.id!="string"||t.id!==CSS.escape(t.id))throw new Error("Sidebar actions need to have an id conforming to the HTML id attribute specifications");if(!t.displayName||typeof t.displayName!="function")throw new Error("Sidebar actions need to have a displayName function");if(!t.iconSvgInline||typeof t.iconSvgInline!="function")throw new Error("Sidebar actions need to have a iconSvgInline function");if(!t.enabled||typeof t.enabled!="function")throw new Error("Sidebar actions need to have an enabled function");if(!t.onClick||typeof t.onClick!="function")throw new Error("Sidebar actions need to have an onClick function")}function no(t){if(Yi(t),ie.filesSidebarTabs??=new Map,ie.filesSidebarTabs.has(t.id)){de.warn(`Sidebar tab with id "${t.id}" already registered. Skipping.`);return}ie.filesSidebarTabs.set(t.id,t),de.debug(`New sidebar tab with id "${t.id}" registered.`)}function Yi(t){if(typeof t!="object")throw new Error("Sidebar tab is not an object");if(!t.id||typeof t.id!="string"||t.id!==CSS.escape(t.id))throw new Error("Sidebar tabs need to have an id conforming to the HTML id attribute specifications");if(!t.tagName||typeof t.tagName!="string")throw new Error("Sidebar tabs need to have the tagName name set");if(!t.tagName.match(/^[a-z][a-z0-9-_]+$/))throw new Error('Sidebar tab "tagName" is invalid');if(!t.displayName||typeof t.displayName!="string")throw new Error("Sidebar tabs need to have a name set");if(typeof t.iconSvgInline!="string"||!Un(t.iconSvgInline))throw new Error("Sidebar tabs need to have an valid SVG icon");if(typeof t.order!="number")throw new Error("Sidebar tabs need to have a numeric order set");if(t.enabled&&typeof t.enabled!="function")throw new Error('Sidebar tab "enabled" is not a function');if(t.onInit&&typeof t.onInit!="function")throw new Error('Sidebar tab "onInit" is not a function')}const bt=["B","KB","MB","GB","TB","PB"],mt=["B","KiB","MiB","GiB","TiB","PiB"];function io(t,c=!1,h=!1,g=!1){h=h&&!g,typeof t=="string"&&(t=Number(t));let O=t>0?Math.floor(Math.log(t)/Math.log(g?1e3:1024)):0;O=Math.min((h?mt.length:bt.length)-1,O);const p=h?mt[O]:bt[O];let b=(t/Math.pow(g?1e3:1024,O)).toFixed(1);return c===!0&&O===0?(b!=="0.0"?"< 1 ":"0 ")+(h?mt[1]:bt[1]):(O<2?b=parseFloat(b).toFixed(0):b=parseFloat(b).toLocaleString(Hn()),b+" "+p)}export{Zi as C,Vi as D,eo as V,Ki as a,Ji as b,ro as c,io as f,to as g,no as r}; -//# sourceMappingURL=index-DNfSxz5H.chunk.mjs.map +//# sourceMappingURL=index-sQy2Ug64.chunk.mjs.map diff --git a/dist/index-DNfSxz5H.chunk.mjs.license b/dist/index-sQy2Ug64.chunk.mjs.license similarity index 99% rename from dist/index-DNfSxz5H.chunk.mjs.license rename to dist/index-sQy2Ug64.chunk.mjs.license index 3695f0a72cd87..b960ef2fb87eb 100644 --- a/dist/index-DNfSxz5H.chunk.mjs.license +++ b/dist/index-sQy2Ug64.chunk.mjs.license @@ -22,7 +22,7 @@ This file is generated from multiple sources. Included packages: - version: 0.4.4 - license: MIT - @nextcloud/files - - version: 4.0.0-rc.3 + - version: 4.0.0 - license: AGPL-3.0-or-later - available-typed-arrays - version: 1.0.7 diff --git a/dist/index-DNfSxz5H.chunk.mjs.map b/dist/index-sQy2Ug64.chunk.mjs.map similarity index 99% rename from dist/index-DNfSxz5H.chunk.mjs.map rename to dist/index-sQy2Ug64.chunk.mjs.map index 11697bbd186fd..c0d0fb29df316 100644 --- a/dist/index-DNfSxz5H.chunk.mjs.map +++ b/dist/index-sQy2Ug64.chunk.mjs.map @@ -1 +1 @@ -{"version":3,"file":"index-DNfSxz5H.chunk.mjs","sources":["../node_modules/typescript-event-target/dist/index.mjs","../node_modules/events/events.js","../node_modules/inherits/inherits_browser.js","../node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/stream-browser.js","../node_modules/has-symbols/shams.js","../node_modules/has-tostringtag/shams.js","../node_modules/es-object-atoms/index.js","../node_modules/es-errors/index.js","../node_modules/es-errors/eval.js","../node_modules/es-errors/range.js","../node_modules/es-errors/ref.js","../node_modules/es-errors/syntax.js","../node_modules/es-errors/type.js","../node_modules/es-errors/uri.js","../node_modules/math-intrinsics/abs.js","../node_modules/math-intrinsics/floor.js","../node_modules/math-intrinsics/max.js","../node_modules/math-intrinsics/min.js","../node_modules/math-intrinsics/pow.js","../node_modules/math-intrinsics/round.js","../node_modules/math-intrinsics/isNaN.js","../node_modules/math-intrinsics/sign.js","../node_modules/gopd/gOPD.js","../node_modules/gopd/index.js","../node_modules/es-define-property/index.js","../node_modules/has-symbols/index.js","../node_modules/get-proto/Reflect.getPrototypeOf.js","../node_modules/get-proto/Object.getPrototypeOf.js","../node_modules/function-bind/implementation.js","../node_modules/function-bind/index.js","../node_modules/call-bind-apply-helpers/functionCall.js","../node_modules/call-bind-apply-helpers/functionApply.js","../node_modules/call-bind-apply-helpers/reflectApply.js","../node_modules/call-bind-apply-helpers/actualApply.js","../node_modules/call-bind-apply-helpers/index.js","../node_modules/dunder-proto/get.js","../node_modules/get-proto/index.js","../node_modules/hasown/index.js","../node_modules/get-intrinsic/index.js","../node_modules/call-bound/index.js","../node_modules/is-arguments/index.js","../node_modules/is-regex/index.js","../node_modules/safe-regex-test/index.js","../node_modules/generator-function/index.js","../node_modules/is-generator-function/index.js","../node_modules/is-callable/index.js","../node_modules/for-each/index.js","../node_modules/possible-typed-array-names/index.js","../node_modules/available-typed-arrays/index.js","../node_modules/define-data-property/index.js","../node_modules/has-property-descriptors/index.js","../node_modules/set-function-length/index.js","../node_modules/call-bind-apply-helpers/applyBind.js","../node_modules/call-bind/index.js","../node_modules/which-typed-array/index.js","../node_modules/is-typed-array/index.js","../node_modules/util/support/types.js","../node_modules/util/support/isBufferBrowser.js","../node_modules/util/util.js","../node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/buffer_list.js","../node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/destroy.js","../node_modules/stream-browserify/node_modules/readable-stream/errors-browser.js","../node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/state.js","../node_modules/util-deprecate/browser.js","../node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_writable.js","../node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_duplex.js","../node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/end-of-stream.js","../node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/async_iterator.js","../node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/from-browser.js","../node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_readable.js","../node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_transform.js","../node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_passthrough.js","../node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/pipeline.js","../node_modules/stream-browserify/index.js","../node_modules/sax/lib/sax.js","../node_modules/@file-type/xml/lib/index.js","../node_modules/is-svg/index.js","../node_modules/@nextcloud/files/dist/index.mjs"],"sourcesContent":["var e=class extends EventTarget{dispatchTypedEvent(s,t){return super.dispatchEvent(t)}};export{e as TypedEventTarget};\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nvar R = typeof Reflect === 'object' ? Reflect : null\nvar ReflectApply = R && typeof R.apply === 'function'\n ? R.apply\n : function ReflectApply(target, receiver, args) {\n return Function.prototype.apply.call(target, receiver, args);\n }\n\nvar ReflectOwnKeys\nif (R && typeof R.ownKeys === 'function') {\n ReflectOwnKeys = R.ownKeys\n} else if (Object.getOwnPropertySymbols) {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target)\n .concat(Object.getOwnPropertySymbols(target));\n };\n} else {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target);\n };\n}\n\nfunction ProcessEmitWarning(warning) {\n if (console && console.warn) console.warn(warning);\n}\n\nvar NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {\n return value !== value;\n}\n\nfunction EventEmitter() {\n EventEmitter.init.call(this);\n}\nmodule.exports = EventEmitter;\nmodule.exports.once = once;\n\n// Backwards-compat with node 0.10.x\nEventEmitter.EventEmitter = EventEmitter;\n\nEventEmitter.prototype._events = undefined;\nEventEmitter.prototype._eventsCount = 0;\nEventEmitter.prototype._maxListeners = undefined;\n\n// By default EventEmitters will print a warning if more than 10 listeners are\n// added to it. This is a useful default which helps finding memory leaks.\nvar defaultMaxListeners = 10;\n\nfunction checkListener(listener) {\n if (typeof listener !== 'function') {\n throw new TypeError('The \"listener\" argument must be of type Function. Received type ' + typeof listener);\n }\n}\n\nObject.defineProperty(EventEmitter, 'defaultMaxListeners', {\n enumerable: true,\n get: function() {\n return defaultMaxListeners;\n },\n set: function(arg) {\n if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {\n throw new RangeError('The value of \"defaultMaxListeners\" is out of range. It must be a non-negative number. Received ' + arg + '.');\n }\n defaultMaxListeners = arg;\n }\n});\n\nEventEmitter.init = function() {\n\n if (this._events === undefined ||\n this._events === Object.getPrototypeOf(this)._events) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n }\n\n this._maxListeners = this._maxListeners || undefined;\n};\n\n// Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\nEventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {\n if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {\n throw new RangeError('The value of \"n\" is out of range. It must be a non-negative number. Received ' + n + '.');\n }\n this._maxListeners = n;\n return this;\n};\n\nfunction _getMaxListeners(that) {\n if (that._maxListeners === undefined)\n return EventEmitter.defaultMaxListeners;\n return that._maxListeners;\n}\n\nEventEmitter.prototype.getMaxListeners = function getMaxListeners() {\n return _getMaxListeners(this);\n};\n\nEventEmitter.prototype.emit = function emit(type) {\n var args = [];\n for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);\n var doError = (type === 'error');\n\n var events = this._events;\n if (events !== undefined)\n doError = (doError && events.error === undefined);\n else if (!doError)\n return false;\n\n // If there is no 'error' event listener then throw.\n if (doError) {\n var er;\n if (args.length > 0)\n er = args[0];\n if (er instanceof Error) {\n // Note: The comments on the `throw` lines are intentional, they show\n // up in Node's output if this results in an unhandled exception.\n throw er; // Unhandled 'error' event\n }\n // At least give some kind of context to the user\n var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));\n err.context = er;\n throw err; // Unhandled 'error' event\n }\n\n var handler = events[type];\n\n if (handler === undefined)\n return false;\n\n if (typeof handler === 'function') {\n ReflectApply(handler, this, args);\n } else {\n var len = handler.length;\n var listeners = arrayClone(handler, len);\n for (var i = 0; i < len; ++i)\n ReflectApply(listeners[i], this, args);\n }\n\n return true;\n};\n\nfunction _addListener(target, type, listener, prepend) {\n var m;\n var events;\n var existing;\n\n checkListener(listener);\n\n events = target._events;\n if (events === undefined) {\n events = target._events = Object.create(null);\n target._eventsCount = 0;\n } else {\n // To avoid recursion in the case that type === \"newListener\"! Before\n // adding it to the listeners, first emit \"newListener\".\n if (events.newListener !== undefined) {\n target.emit('newListener', type,\n listener.listener ? listener.listener : listener);\n\n // Re-assign `events` because a newListener handler could have caused the\n // this._events to be assigned to a new object\n events = target._events;\n }\n existing = events[type];\n }\n\n if (existing === undefined) {\n // Optimize the case of one listener. Don't need the extra array object.\n existing = events[type] = listener;\n ++target._eventsCount;\n } else {\n if (typeof existing === 'function') {\n // Adding the second element, need to change to array.\n existing = events[type] =\n prepend ? [listener, existing] : [existing, listener];\n // If we've already got an array, just append.\n } else if (prepend) {\n existing.unshift(listener);\n } else {\n existing.push(listener);\n }\n\n // Check for listener leak\n m = _getMaxListeners(target);\n if (m > 0 && existing.length > m && !existing.warned) {\n existing.warned = true;\n // No error code for this since it is a Warning\n // eslint-disable-next-line no-restricted-syntax\n var w = new Error('Possible EventEmitter memory leak detected. ' +\n existing.length + ' ' + String(type) + ' listeners ' +\n 'added. Use emitter.setMaxListeners() to ' +\n 'increase limit');\n w.name = 'MaxListenersExceededWarning';\n w.emitter = target;\n w.type = type;\n w.count = existing.length;\n ProcessEmitWarning(w);\n }\n }\n\n return target;\n}\n\nEventEmitter.prototype.addListener = function addListener(type, listener) {\n return _addListener(this, type, listener, false);\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.prependListener =\n function prependListener(type, listener) {\n return _addListener(this, type, listener, true);\n };\n\nfunction onceWrapper() {\n if (!this.fired) {\n this.target.removeListener(this.type, this.wrapFn);\n this.fired = true;\n if (arguments.length === 0)\n return this.listener.call(this.target);\n return this.listener.apply(this.target, arguments);\n }\n}\n\nfunction _onceWrap(target, type, listener) {\n var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };\n var wrapped = onceWrapper.bind(state);\n wrapped.listener = listener;\n state.wrapFn = wrapped;\n return wrapped;\n}\n\nEventEmitter.prototype.once = function once(type, listener) {\n checkListener(listener);\n this.on(type, _onceWrap(this, type, listener));\n return this;\n};\n\nEventEmitter.prototype.prependOnceListener =\n function prependOnceListener(type, listener) {\n checkListener(listener);\n this.prependListener(type, _onceWrap(this, type, listener));\n return this;\n };\n\n// Emits a 'removeListener' event if and only if the listener was removed.\nEventEmitter.prototype.removeListener =\n function removeListener(type, listener) {\n var list, events, position, i, originalListener;\n\n checkListener(listener);\n\n events = this._events;\n if (events === undefined)\n return this;\n\n list = events[type];\n if (list === undefined)\n return this;\n\n if (list === listener || list.listener === listener) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else {\n delete events[type];\n if (events.removeListener)\n this.emit('removeListener', type, list.listener || listener);\n }\n } else if (typeof list !== 'function') {\n position = -1;\n\n for (i = list.length - 1; i >= 0; i--) {\n if (list[i] === listener || list[i].listener === listener) {\n originalListener = list[i].listener;\n position = i;\n break;\n }\n }\n\n if (position < 0)\n return this;\n\n if (position === 0)\n list.shift();\n else {\n spliceOne(list, position);\n }\n\n if (list.length === 1)\n events[type] = list[0];\n\n if (events.removeListener !== undefined)\n this.emit('removeListener', type, originalListener || listener);\n }\n\n return this;\n };\n\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\n\nEventEmitter.prototype.removeAllListeners =\n function removeAllListeners(type) {\n var listeners, events, i;\n\n events = this._events;\n if (events === undefined)\n return this;\n\n // not listening for removeListener, no need to emit\n if (events.removeListener === undefined) {\n if (arguments.length === 0) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n } else if (events[type] !== undefined) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else\n delete events[type];\n }\n return this;\n }\n\n // emit removeListener for all listeners on all events\n if (arguments.length === 0) {\n var keys = Object.keys(events);\n var key;\n for (i = 0; i < keys.length; ++i) {\n key = keys[i];\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n this.removeAllListeners('removeListener');\n this._events = Object.create(null);\n this._eventsCount = 0;\n return this;\n }\n\n listeners = events[type];\n\n if (typeof listeners === 'function') {\n this.removeListener(type, listeners);\n } else if (listeners !== undefined) {\n // LIFO order\n for (i = listeners.length - 1; i >= 0; i--) {\n this.removeListener(type, listeners[i]);\n }\n }\n\n return this;\n };\n\nfunction _listeners(target, type, unwrap) {\n var events = target._events;\n\n if (events === undefined)\n return [];\n\n var evlistener = events[type];\n if (evlistener === undefined)\n return [];\n\n if (typeof evlistener === 'function')\n return unwrap ? [evlistener.listener || evlistener] : [evlistener];\n\n return unwrap ?\n unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);\n}\n\nEventEmitter.prototype.listeners = function listeners(type) {\n return _listeners(this, type, true);\n};\n\nEventEmitter.prototype.rawListeners = function rawListeners(type) {\n return _listeners(this, type, false);\n};\n\nEventEmitter.listenerCount = function(emitter, type) {\n if (typeof emitter.listenerCount === 'function') {\n return emitter.listenerCount(type);\n } else {\n return listenerCount.call(emitter, type);\n }\n};\n\nEventEmitter.prototype.listenerCount = listenerCount;\nfunction listenerCount(type) {\n var events = this._events;\n\n if (events !== undefined) {\n var evlistener = events[type];\n\n if (typeof evlistener === 'function') {\n return 1;\n } else if (evlistener !== undefined) {\n return evlistener.length;\n }\n }\n\n return 0;\n}\n\nEventEmitter.prototype.eventNames = function eventNames() {\n return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];\n};\n\nfunction arrayClone(arr, n) {\n var copy = new Array(n);\n for (var i = 0; i < n; ++i)\n copy[i] = arr[i];\n return copy;\n}\n\nfunction spliceOne(list, index) {\n for (; index + 1 < list.length; index++)\n list[index] = list[index + 1];\n list.pop();\n}\n\nfunction unwrapListeners(arr) {\n var ret = new Array(arr.length);\n for (var i = 0; i < ret.length; ++i) {\n ret[i] = arr[i].listener || arr[i];\n }\n return ret;\n}\n\nfunction once(emitter, name) {\n return new Promise(function (resolve, reject) {\n function errorListener(err) {\n emitter.removeListener(name, resolver);\n reject(err);\n }\n\n function resolver() {\n if (typeof emitter.removeListener === 'function') {\n emitter.removeListener('error', errorListener);\n }\n resolve([].slice.call(arguments));\n };\n\n eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });\n if (name !== 'error') {\n addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });\n }\n });\n}\n\nfunction addErrorHandlerIfEventEmitter(emitter, handler, flags) {\n if (typeof emitter.on === 'function') {\n eventTargetAgnosticAddListener(emitter, 'error', handler, flags);\n }\n}\n\nfunction eventTargetAgnosticAddListener(emitter, name, listener, flags) {\n if (typeof emitter.on === 'function') {\n if (flags.once) {\n emitter.once(name, listener);\n } else {\n emitter.on(name, listener);\n }\n } else if (typeof emitter.addEventListener === 'function') {\n // EventTarget does not have `error` event semantics like Node\n // EventEmitters, we do not listen for `error` events here.\n emitter.addEventListener(name, function wrapListener(arg) {\n // IE does not have builtin `{ once: true }` support so we\n // have to do it manually.\n if (flags.once) {\n emitter.removeEventListener(name, wrapListener);\n }\n listener(arg);\n });\n } else {\n throw new TypeError('The \"emitter\" argument must be of type EventEmitter. Received type ' + typeof emitter);\n }\n}\n","if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n })\n }\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n }\n}\n","module.exports = require('events').EventEmitter;\n","'use strict';\n\n/** @type {import('./shams')} */\n/* eslint complexity: [2, 18], max-statements: [2, 33] */\nmodule.exports = function hasSymbols() {\n\tif (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }\n\tif (typeof Symbol.iterator === 'symbol') { return true; }\n\n\t/** @type {{ [k in symbol]?: unknown }} */\n\tvar obj = {};\n\tvar sym = Symbol('test');\n\tvar symObj = Object(sym);\n\tif (typeof sym === 'string') { return false; }\n\n\tif (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }\n\tif (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }\n\n\t// temp disabled per https://github.com/ljharb/object.assign/issues/17\n\t// if (sym instanceof Symbol) { return false; }\n\t// temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4\n\t// if (!(symObj instanceof Symbol)) { return false; }\n\n\t// if (typeof Symbol.prototype.toString !== 'function') { return false; }\n\t// if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }\n\n\tvar symVal = 42;\n\tobj[sym] = symVal;\n\tfor (var _ in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop\n\tif (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }\n\n\tif (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }\n\n\tvar syms = Object.getOwnPropertySymbols(obj);\n\tif (syms.length !== 1 || syms[0] !== sym) { return false; }\n\n\tif (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }\n\n\tif (typeof Object.getOwnPropertyDescriptor === 'function') {\n\t\t// eslint-disable-next-line no-extra-parens\n\t\tvar descriptor = /** @type {PropertyDescriptor} */ (Object.getOwnPropertyDescriptor(obj, sym));\n\t\tif (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }\n\t}\n\n\treturn true;\n};\n","'use strict';\n\nvar hasSymbols = require('has-symbols/shams');\n\n/** @type {import('.')} */\nmodule.exports = function hasToStringTagShams() {\n\treturn hasSymbols() && !!Symbol.toStringTag;\n};\n","'use strict';\n\n/** @type {import('.')} */\nmodule.exports = Object;\n","'use strict';\n\n/** @type {import('.')} */\nmodule.exports = Error;\n","'use strict';\n\n/** @type {import('./eval')} */\nmodule.exports = EvalError;\n","'use strict';\n\n/** @type {import('./range')} */\nmodule.exports = RangeError;\n","'use strict';\n\n/** @type {import('./ref')} */\nmodule.exports = ReferenceError;\n","'use strict';\n\n/** @type {import('./syntax')} */\nmodule.exports = SyntaxError;\n","'use strict';\n\n/** @type {import('./type')} */\nmodule.exports = TypeError;\n","'use strict';\n\n/** @type {import('./uri')} */\nmodule.exports = URIError;\n","'use strict';\n\n/** @type {import('./abs')} */\nmodule.exports = Math.abs;\n","'use strict';\n\n/** @type {import('./floor')} */\nmodule.exports = Math.floor;\n","'use strict';\n\n/** @type {import('./max')} */\nmodule.exports = Math.max;\n","'use strict';\n\n/** @type {import('./min')} */\nmodule.exports = Math.min;\n","'use strict';\n\n/** @type {import('./pow')} */\nmodule.exports = Math.pow;\n","'use strict';\n\n/** @type {import('./round')} */\nmodule.exports = Math.round;\n","'use strict';\n\n/** @type {import('./isNaN')} */\nmodule.exports = Number.isNaN || function isNaN(a) {\n\treturn a !== a;\n};\n","'use strict';\n\nvar $isNaN = require('./isNaN');\n\n/** @type {import('./sign')} */\nmodule.exports = function sign(number) {\n\tif ($isNaN(number) || number === 0) {\n\t\treturn number;\n\t}\n\treturn number < 0 ? -1 : +1;\n};\n","'use strict';\n\n/** @type {import('./gOPD')} */\nmodule.exports = Object.getOwnPropertyDescriptor;\n","'use strict';\n\n/** @type {import('.')} */\nvar $gOPD = require('./gOPD');\n\nif ($gOPD) {\n\ttry {\n\t\t$gOPD([], 'length');\n\t} catch (e) {\n\t\t// IE 8 has a broken gOPD\n\t\t$gOPD = null;\n\t}\n}\n\nmodule.exports = $gOPD;\n","'use strict';\n\n/** @type {import('.')} */\nvar $defineProperty = Object.defineProperty || false;\nif ($defineProperty) {\n\ttry {\n\t\t$defineProperty({}, 'a', { value: 1 });\n\t} catch (e) {\n\t\t// IE 8 has a broken defineProperty\n\t\t$defineProperty = false;\n\t}\n}\n\nmodule.exports = $defineProperty;\n","'use strict';\n\nvar origSymbol = typeof Symbol !== 'undefined' && Symbol;\nvar hasSymbolSham = require('./shams');\n\n/** @type {import('.')} */\nmodule.exports = function hasNativeSymbols() {\n\tif (typeof origSymbol !== 'function') { return false; }\n\tif (typeof Symbol !== 'function') { return false; }\n\tif (typeof origSymbol('foo') !== 'symbol') { return false; }\n\tif (typeof Symbol('bar') !== 'symbol') { return false; }\n\n\treturn hasSymbolSham();\n};\n","'use strict';\n\n/** @type {import('./Reflect.getPrototypeOf')} */\nmodule.exports = (typeof Reflect !== 'undefined' && Reflect.getPrototypeOf) || null;\n","'use strict';\n\nvar $Object = require('es-object-atoms');\n\n/** @type {import('./Object.getPrototypeOf')} */\nmodule.exports = $Object.getPrototypeOf || null;\n","'use strict';\n\n/* eslint no-invalid-this: 1 */\n\nvar ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';\nvar toStr = Object.prototype.toString;\nvar max = Math.max;\nvar funcType = '[object Function]';\n\nvar concatty = function concatty(a, b) {\n var arr = [];\n\n for (var i = 0; i < a.length; i += 1) {\n arr[i] = a[i];\n }\n for (var j = 0; j < b.length; j += 1) {\n arr[j + a.length] = b[j];\n }\n\n return arr;\n};\n\nvar slicy = function slicy(arrLike, offset) {\n var arr = [];\n for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {\n arr[j] = arrLike[i];\n }\n return arr;\n};\n\nvar joiny = function (arr, joiner) {\n var str = '';\n for (var i = 0; i < arr.length; i += 1) {\n str += arr[i];\n if (i + 1 < arr.length) {\n str += joiner;\n }\n }\n return str;\n};\n\nmodule.exports = function bind(that) {\n var target = this;\n if (typeof target !== 'function' || toStr.apply(target) !== funcType) {\n throw new TypeError(ERROR_MESSAGE + target);\n }\n var args = slicy(arguments, 1);\n\n var bound;\n var binder = function () {\n if (this instanceof bound) {\n var result = target.apply(\n this,\n concatty(args, arguments)\n );\n if (Object(result) === result) {\n return result;\n }\n return this;\n }\n return target.apply(\n that,\n concatty(args, arguments)\n );\n\n };\n\n var boundLength = max(0, target.length - args.length);\n var boundArgs = [];\n for (var i = 0; i < boundLength; i++) {\n boundArgs[i] = '$' + i;\n }\n\n bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder);\n\n if (target.prototype) {\n var Empty = function Empty() {};\n Empty.prototype = target.prototype;\n bound.prototype = new Empty();\n Empty.prototype = null;\n }\n\n return bound;\n};\n","'use strict';\n\nvar implementation = require('./implementation');\n\nmodule.exports = Function.prototype.bind || implementation;\n","'use strict';\n\n/** @type {import('./functionCall')} */\nmodule.exports = Function.prototype.call;\n","'use strict';\n\n/** @type {import('./functionApply')} */\nmodule.exports = Function.prototype.apply;\n","'use strict';\n\n/** @type {import('./reflectApply')} */\nmodule.exports = typeof Reflect !== 'undefined' && Reflect && Reflect.apply;\n","'use strict';\n\nvar bind = require('function-bind');\n\nvar $apply = require('./functionApply');\nvar $call = require('./functionCall');\nvar $reflectApply = require('./reflectApply');\n\n/** @type {import('./actualApply')} */\nmodule.exports = $reflectApply || bind.call($call, $apply);\n","'use strict';\n\nvar bind = require('function-bind');\nvar $TypeError = require('es-errors/type');\n\nvar $call = require('./functionCall');\nvar $actualApply = require('./actualApply');\n\n/** @type {(args: [Function, thisArg?: unknown, ...args: unknown[]]) => Function} TODO FIXME, find a way to use import('.') */\nmodule.exports = function callBindBasic(args) {\n\tif (args.length < 1 || typeof args[0] !== 'function') {\n\t\tthrow new $TypeError('a function is required');\n\t}\n\treturn $actualApply(bind, $call, args);\n};\n","'use strict';\n\nvar callBind = require('call-bind-apply-helpers');\nvar gOPD = require('gopd');\n\nvar hasProtoAccessor;\ntry {\n\t// eslint-disable-next-line no-extra-parens, no-proto\n\thasProtoAccessor = /** @type {{ __proto__?: typeof Array.prototype }} */ ([]).__proto__ === Array.prototype;\n} catch (e) {\n\tif (!e || typeof e !== 'object' || !('code' in e) || e.code !== 'ERR_PROTO_ACCESS') {\n\t\tthrow e;\n\t}\n}\n\n// eslint-disable-next-line no-extra-parens\nvar desc = !!hasProtoAccessor && gOPD && gOPD(Object.prototype, /** @type {keyof typeof Object.prototype} */ ('__proto__'));\n\nvar $Object = Object;\nvar $getPrototypeOf = $Object.getPrototypeOf;\n\n/** @type {import('./get')} */\nmodule.exports = desc && typeof desc.get === 'function'\n\t? callBind([desc.get])\n\t: typeof $getPrototypeOf === 'function'\n\t\t? /** @type {import('./get')} */ function getDunder(value) {\n\t\t\t// eslint-disable-next-line eqeqeq\n\t\t\treturn $getPrototypeOf(value == null ? value : $Object(value));\n\t\t}\n\t\t: false;\n","'use strict';\n\nvar reflectGetProto = require('./Reflect.getPrototypeOf');\nvar originalGetProto = require('./Object.getPrototypeOf');\n\nvar getDunderProto = require('dunder-proto/get');\n\n/** @type {import('.')} */\nmodule.exports = reflectGetProto\n\t? function getProto(O) {\n\t\t// @ts-expect-error TS can't narrow inside a closure, for some reason\n\t\treturn reflectGetProto(O);\n\t}\n\t: originalGetProto\n\t\t? function getProto(O) {\n\t\t\tif (!O || (typeof O !== 'object' && typeof O !== 'function')) {\n\t\t\t\tthrow new TypeError('getProto: not an object');\n\t\t\t}\n\t\t\t// @ts-expect-error TS can't narrow inside a closure, for some reason\n\t\t\treturn originalGetProto(O);\n\t\t}\n\t\t: getDunderProto\n\t\t\t? function getProto(O) {\n\t\t\t\t// @ts-expect-error TS can't narrow inside a closure, for some reason\n\t\t\t\treturn getDunderProto(O);\n\t\t\t}\n\t\t\t: null;\n","'use strict';\n\nvar call = Function.prototype.call;\nvar $hasOwn = Object.prototype.hasOwnProperty;\nvar bind = require('function-bind');\n\n/** @type {import('.')} */\nmodule.exports = bind.call(call, $hasOwn);\n","'use strict';\n\nvar undefined;\n\nvar $Object = require('es-object-atoms');\n\nvar $Error = require('es-errors');\nvar $EvalError = require('es-errors/eval');\nvar $RangeError = require('es-errors/range');\nvar $ReferenceError = require('es-errors/ref');\nvar $SyntaxError = require('es-errors/syntax');\nvar $TypeError = require('es-errors/type');\nvar $URIError = require('es-errors/uri');\n\nvar abs = require('math-intrinsics/abs');\nvar floor = require('math-intrinsics/floor');\nvar max = require('math-intrinsics/max');\nvar min = require('math-intrinsics/min');\nvar pow = require('math-intrinsics/pow');\nvar round = require('math-intrinsics/round');\nvar sign = require('math-intrinsics/sign');\n\nvar $Function = Function;\n\n// eslint-disable-next-line consistent-return\nvar getEvalledConstructor = function (expressionSyntax) {\n\ttry {\n\t\treturn $Function('\"use strict\"; return (' + expressionSyntax + ').constructor;')();\n\t} catch (e) {}\n};\n\nvar $gOPD = require('gopd');\nvar $defineProperty = require('es-define-property');\n\nvar throwTypeError = function () {\n\tthrow new $TypeError();\n};\nvar ThrowTypeError = $gOPD\n\t? (function () {\n\t\ttry {\n\t\t\t// eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties\n\t\t\targuments.callee; // IE 8 does not throw here\n\t\t\treturn throwTypeError;\n\t\t} catch (calleeThrows) {\n\t\t\ttry {\n\t\t\t\t// IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')\n\t\t\t\treturn $gOPD(arguments, 'callee').get;\n\t\t\t} catch (gOPDthrows) {\n\t\t\t\treturn throwTypeError;\n\t\t\t}\n\t\t}\n\t}())\n\t: throwTypeError;\n\nvar hasSymbols = require('has-symbols')();\n\nvar getProto = require('get-proto');\nvar $ObjectGPO = require('get-proto/Object.getPrototypeOf');\nvar $ReflectGPO = require('get-proto/Reflect.getPrototypeOf');\n\nvar $apply = require('call-bind-apply-helpers/functionApply');\nvar $call = require('call-bind-apply-helpers/functionCall');\n\nvar needsEval = {};\n\nvar TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array);\n\nvar INTRINSICS = {\n\t__proto__: null,\n\t'%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,\n\t'%Array%': Array,\n\t'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,\n\t'%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined,\n\t'%AsyncFromSyncIteratorPrototype%': undefined,\n\t'%AsyncFunction%': needsEval,\n\t'%AsyncGenerator%': needsEval,\n\t'%AsyncGeneratorFunction%': needsEval,\n\t'%AsyncIteratorPrototype%': needsEval,\n\t'%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,\n\t'%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,\n\t'%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array,\n\t'%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array,\n\t'%Boolean%': Boolean,\n\t'%DataView%': typeof DataView === 'undefined' ? undefined : DataView,\n\t'%Date%': Date,\n\t'%decodeURI%': decodeURI,\n\t'%decodeURIComponent%': decodeURIComponent,\n\t'%encodeURI%': encodeURI,\n\t'%encodeURIComponent%': encodeURIComponent,\n\t'%Error%': $Error,\n\t'%eval%': eval, // eslint-disable-line no-eval\n\t'%EvalError%': $EvalError,\n\t'%Float16Array%': typeof Float16Array === 'undefined' ? undefined : Float16Array,\n\t'%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,\n\t'%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,\n\t'%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,\n\t'%Function%': $Function,\n\t'%GeneratorFunction%': needsEval,\n\t'%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,\n\t'%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,\n\t'%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,\n\t'%isFinite%': isFinite,\n\t'%isNaN%': isNaN,\n\t'%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined,\n\t'%JSON%': typeof JSON === 'object' ? JSON : undefined,\n\t'%Map%': typeof Map === 'undefined' ? undefined : Map,\n\t'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()),\n\t'%Math%': Math,\n\t'%Number%': Number,\n\t'%Object%': $Object,\n\t'%Object.getOwnPropertyDescriptor%': $gOPD,\n\t'%parseFloat%': parseFloat,\n\t'%parseInt%': parseInt,\n\t'%Promise%': typeof Promise === 'undefined' ? undefined : Promise,\n\t'%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,\n\t'%RangeError%': $RangeError,\n\t'%ReferenceError%': $ReferenceError,\n\t'%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,\n\t'%RegExp%': RegExp,\n\t'%Set%': typeof Set === 'undefined' ? undefined : Set,\n\t'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()),\n\t'%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,\n\t'%String%': String,\n\t'%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined,\n\t'%Symbol%': hasSymbols ? Symbol : undefined,\n\t'%SyntaxError%': $SyntaxError,\n\t'%ThrowTypeError%': ThrowTypeError,\n\t'%TypedArray%': TypedArray,\n\t'%TypeError%': $TypeError,\n\t'%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,\n\t'%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,\n\t'%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,\n\t'%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,\n\t'%URIError%': $URIError,\n\t'%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,\n\t'%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,\n\t'%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet,\n\n\t'%Function.prototype.call%': $call,\n\t'%Function.prototype.apply%': $apply,\n\t'%Object.defineProperty%': $defineProperty,\n\t'%Object.getPrototypeOf%': $ObjectGPO,\n\t'%Math.abs%': abs,\n\t'%Math.floor%': floor,\n\t'%Math.max%': max,\n\t'%Math.min%': min,\n\t'%Math.pow%': pow,\n\t'%Math.round%': round,\n\t'%Math.sign%': sign,\n\t'%Reflect.getPrototypeOf%': $ReflectGPO\n};\n\nif (getProto) {\n\ttry {\n\t\tnull.error; // eslint-disable-line no-unused-expressions\n\t} catch (e) {\n\t\t// https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229\n\t\tvar errorProto = getProto(getProto(e));\n\t\tINTRINSICS['%Error.prototype%'] = errorProto;\n\t}\n}\n\nvar doEval = function doEval(name) {\n\tvar value;\n\tif (name === '%AsyncFunction%') {\n\t\tvalue = getEvalledConstructor('async function () {}');\n\t} else if (name === '%GeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('function* () {}');\n\t} else if (name === '%AsyncGeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('async function* () {}');\n\t} else if (name === '%AsyncGenerator%') {\n\t\tvar fn = doEval('%AsyncGeneratorFunction%');\n\t\tif (fn) {\n\t\t\tvalue = fn.prototype;\n\t\t}\n\t} else if (name === '%AsyncIteratorPrototype%') {\n\t\tvar gen = doEval('%AsyncGenerator%');\n\t\tif (gen && getProto) {\n\t\t\tvalue = getProto(gen.prototype);\n\t\t}\n\t}\n\n\tINTRINSICS[name] = value;\n\n\treturn value;\n};\n\nvar LEGACY_ALIASES = {\n\t__proto__: null,\n\t'%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],\n\t'%ArrayPrototype%': ['Array', 'prototype'],\n\t'%ArrayProto_entries%': ['Array', 'prototype', 'entries'],\n\t'%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],\n\t'%ArrayProto_keys%': ['Array', 'prototype', 'keys'],\n\t'%ArrayProto_values%': ['Array', 'prototype', 'values'],\n\t'%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],\n\t'%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],\n\t'%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],\n\t'%BooleanPrototype%': ['Boolean', 'prototype'],\n\t'%DataViewPrototype%': ['DataView', 'prototype'],\n\t'%DatePrototype%': ['Date', 'prototype'],\n\t'%ErrorPrototype%': ['Error', 'prototype'],\n\t'%EvalErrorPrototype%': ['EvalError', 'prototype'],\n\t'%Float32ArrayPrototype%': ['Float32Array', 'prototype'],\n\t'%Float64ArrayPrototype%': ['Float64Array', 'prototype'],\n\t'%FunctionPrototype%': ['Function', 'prototype'],\n\t'%Generator%': ['GeneratorFunction', 'prototype'],\n\t'%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],\n\t'%Int8ArrayPrototype%': ['Int8Array', 'prototype'],\n\t'%Int16ArrayPrototype%': ['Int16Array', 'prototype'],\n\t'%Int32ArrayPrototype%': ['Int32Array', 'prototype'],\n\t'%JSONParse%': ['JSON', 'parse'],\n\t'%JSONStringify%': ['JSON', 'stringify'],\n\t'%MapPrototype%': ['Map', 'prototype'],\n\t'%NumberPrototype%': ['Number', 'prototype'],\n\t'%ObjectPrototype%': ['Object', 'prototype'],\n\t'%ObjProto_toString%': ['Object', 'prototype', 'toString'],\n\t'%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],\n\t'%PromisePrototype%': ['Promise', 'prototype'],\n\t'%PromiseProto_then%': ['Promise', 'prototype', 'then'],\n\t'%Promise_all%': ['Promise', 'all'],\n\t'%Promise_reject%': ['Promise', 'reject'],\n\t'%Promise_resolve%': ['Promise', 'resolve'],\n\t'%RangeErrorPrototype%': ['RangeError', 'prototype'],\n\t'%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],\n\t'%RegExpPrototype%': ['RegExp', 'prototype'],\n\t'%SetPrototype%': ['Set', 'prototype'],\n\t'%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],\n\t'%StringPrototype%': ['String', 'prototype'],\n\t'%SymbolPrototype%': ['Symbol', 'prototype'],\n\t'%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],\n\t'%TypedArrayPrototype%': ['TypedArray', 'prototype'],\n\t'%TypeErrorPrototype%': ['TypeError', 'prototype'],\n\t'%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],\n\t'%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],\n\t'%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],\n\t'%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],\n\t'%URIErrorPrototype%': ['URIError', 'prototype'],\n\t'%WeakMapPrototype%': ['WeakMap', 'prototype'],\n\t'%WeakSetPrototype%': ['WeakSet', 'prototype']\n};\n\nvar bind = require('function-bind');\nvar hasOwn = require('hasown');\nvar $concat = bind.call($call, Array.prototype.concat);\nvar $spliceApply = bind.call($apply, Array.prototype.splice);\nvar $replace = bind.call($call, String.prototype.replace);\nvar $strSlice = bind.call($call, String.prototype.slice);\nvar $exec = bind.call($call, RegExp.prototype.exec);\n\n/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */\nvar rePropName = /[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g;\nvar reEscapeChar = /\\\\(\\\\)?/g; /** Used to match backslashes in property paths. */\nvar stringToPath = function stringToPath(string) {\n\tvar first = $strSlice(string, 0, 1);\n\tvar last = $strSlice(string, -1);\n\tif (first === '%' && last !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected closing `%`');\n\t} else if (last === '%' && first !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected opening `%`');\n\t}\n\tvar result = [];\n\t$replace(string, rePropName, function (match, number, quote, subString) {\n\t\tresult[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;\n\t});\n\treturn result;\n};\n/* end adaptation */\n\nvar getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {\n\tvar intrinsicName = name;\n\tvar alias;\n\tif (hasOwn(LEGACY_ALIASES, intrinsicName)) {\n\t\talias = LEGACY_ALIASES[intrinsicName];\n\t\tintrinsicName = '%' + alias[0] + '%';\n\t}\n\n\tif (hasOwn(INTRINSICS, intrinsicName)) {\n\t\tvar value = INTRINSICS[intrinsicName];\n\t\tif (value === needsEval) {\n\t\t\tvalue = doEval(intrinsicName);\n\t\t}\n\t\tif (typeof value === 'undefined' && !allowMissing) {\n\t\t\tthrow new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');\n\t\t}\n\n\t\treturn {\n\t\t\talias: alias,\n\t\t\tname: intrinsicName,\n\t\t\tvalue: value\n\t\t};\n\t}\n\n\tthrow new $SyntaxError('intrinsic ' + name + ' does not exist!');\n};\n\nmodule.exports = function GetIntrinsic(name, allowMissing) {\n\tif (typeof name !== 'string' || name.length === 0) {\n\t\tthrow new $TypeError('intrinsic name must be a non-empty string');\n\t}\n\tif (arguments.length > 1 && typeof allowMissing !== 'boolean') {\n\t\tthrow new $TypeError('\"allowMissing\" argument must be a boolean');\n\t}\n\n\tif ($exec(/^%?[^%]*%?$/, name) === null) {\n\t\tthrow new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');\n\t}\n\tvar parts = stringToPath(name);\n\tvar intrinsicBaseName = parts.length > 0 ? parts[0] : '';\n\n\tvar intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);\n\tvar intrinsicRealName = intrinsic.name;\n\tvar value = intrinsic.value;\n\tvar skipFurtherCaching = false;\n\n\tvar alias = intrinsic.alias;\n\tif (alias) {\n\t\tintrinsicBaseName = alias[0];\n\t\t$spliceApply(parts, $concat([0, 1], alias));\n\t}\n\n\tfor (var i = 1, isOwn = true; i < parts.length; i += 1) {\n\t\tvar part = parts[i];\n\t\tvar first = $strSlice(part, 0, 1);\n\t\tvar last = $strSlice(part, -1);\n\t\tif (\n\t\t\t(\n\t\t\t\t(first === '\"' || first === \"'\" || first === '`')\n\t\t\t\t|| (last === '\"' || last === \"'\" || last === '`')\n\t\t\t)\n\t\t\t&& first !== last\n\t\t) {\n\t\t\tthrow new $SyntaxError('property names with quotes must have matching quotes');\n\t\t}\n\t\tif (part === 'constructor' || !isOwn) {\n\t\t\tskipFurtherCaching = true;\n\t\t}\n\n\t\tintrinsicBaseName += '.' + part;\n\t\tintrinsicRealName = '%' + intrinsicBaseName + '%';\n\n\t\tif (hasOwn(INTRINSICS, intrinsicRealName)) {\n\t\t\tvalue = INTRINSICS[intrinsicRealName];\n\t\t} else if (value != null) {\n\t\t\tif (!(part in value)) {\n\t\t\t\tif (!allowMissing) {\n\t\t\t\t\tthrow new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');\n\t\t\t\t}\n\t\t\t\treturn void undefined;\n\t\t\t}\n\t\t\tif ($gOPD && (i + 1) >= parts.length) {\n\t\t\t\tvar desc = $gOPD(value, part);\n\t\t\t\tisOwn = !!desc;\n\n\t\t\t\t// By convention, when a data property is converted to an accessor\n\t\t\t\t// property to emulate a data property that does not suffer from\n\t\t\t\t// the override mistake, that accessor's getter is marked with\n\t\t\t\t// an `originalValue` property. Here, when we detect this, we\n\t\t\t\t// uphold the illusion by pretending to see that original data\n\t\t\t\t// property, i.e., returning the value rather than the getter\n\t\t\t\t// itself.\n\t\t\t\tif (isOwn && 'get' in desc && !('originalValue' in desc.get)) {\n\t\t\t\t\tvalue = desc.get;\n\t\t\t\t} else {\n\t\t\t\t\tvalue = value[part];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tisOwn = hasOwn(value, part);\n\t\t\t\tvalue = value[part];\n\t\t\t}\n\n\t\t\tif (isOwn && !skipFurtherCaching) {\n\t\t\t\tINTRINSICS[intrinsicRealName] = value;\n\t\t\t}\n\t\t}\n\t}\n\treturn value;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar callBindBasic = require('call-bind-apply-helpers');\n\n/** @type {(thisArg: string, searchString: string, position?: number) => number} */\nvar $indexOf = callBindBasic([GetIntrinsic('%String.prototype.indexOf%')]);\n\n/** @type {import('.')} */\nmodule.exports = function callBoundIntrinsic(name, allowMissing) {\n\t/* eslint no-extra-parens: 0 */\n\n\tvar intrinsic = /** @type {(this: unknown, ...args: unknown[]) => unknown} */ (GetIntrinsic(name, !!allowMissing));\n\tif (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {\n\t\treturn callBindBasic(/** @type {const} */ ([intrinsic]));\n\t}\n\treturn intrinsic;\n};\n","'use strict';\n\nvar hasToStringTag = require('has-tostringtag/shams')();\nvar callBound = require('call-bound');\n\nvar $toString = callBound('Object.prototype.toString');\n\n/** @type {import('.')} */\nvar isStandardArguments = function isArguments(value) {\n\tif (\n\t\thasToStringTag\n\t\t&& value\n\t\t&& typeof value === 'object'\n\t\t&& Symbol.toStringTag in value\n\t) {\n\t\treturn false;\n\t}\n\treturn $toString(value) === '[object Arguments]';\n};\n\n/** @type {import('.')} */\nvar isLegacyArguments = function isArguments(value) {\n\tif (isStandardArguments(value)) {\n\t\treturn true;\n\t}\n\treturn value !== null\n\t\t&& typeof value === 'object'\n\t\t&& 'length' in value\n\t\t&& typeof value.length === 'number'\n\t\t&& value.length >= 0\n\t\t&& $toString(value) !== '[object Array]'\n\t\t&& 'callee' in value\n\t\t&& $toString(value.callee) === '[object Function]';\n};\n\nvar supportsStandardArguments = (function () {\n\treturn isStandardArguments(arguments);\n}());\n\n// @ts-expect-error TODO make this not error\nisStandardArguments.isLegacyArguments = isLegacyArguments; // for tests\n\n/** @type {import('.')} */\nmodule.exports = supportsStandardArguments ? isStandardArguments : isLegacyArguments;\n","'use strict';\n\nvar callBound = require('call-bound');\nvar hasToStringTag = require('has-tostringtag/shams')();\nvar hasOwn = require('hasown');\nvar gOPD = require('gopd');\n\n/** @type {import('.')} */\nvar fn;\n\nif (hasToStringTag) {\n\t/** @type {(receiver: ThisParameterType, ...args: Parameters) => ReturnType} */\n\tvar $exec = callBound('RegExp.prototype.exec');\n\t/** @type {object} */\n\tvar isRegexMarker = {};\n\n\tvar throwRegexMarker = function () {\n\t\tthrow isRegexMarker;\n\t};\n\t/** @type {{ toString(): never, valueOf(): never, [Symbol.toPrimitive]?(): never }} */\n\tvar badStringifier = {\n\t\ttoString: throwRegexMarker,\n\t\tvalueOf: throwRegexMarker\n\t};\n\n\tif (typeof Symbol.toPrimitive === 'symbol') {\n\t\tbadStringifier[Symbol.toPrimitive] = throwRegexMarker;\n\t}\n\n\t/** @type {import('.')} */\n\t// @ts-expect-error TS can't figure out that the $exec call always throws\n\t// eslint-disable-next-line consistent-return\n\tfn = function isRegex(value) {\n\t\tif (!value || typeof value !== 'object') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// eslint-disable-next-line no-extra-parens\n\t\tvar descriptor = /** @type {NonNullable} */ (gOPD)(/** @type {{ lastIndex?: unknown }} */ (value), 'lastIndex');\n\t\tvar hasLastIndexDataProperty = descriptor && hasOwn(descriptor, 'value');\n\t\tif (!hasLastIndexDataProperty) {\n\t\t\treturn false;\n\t\t}\n\n\t\ttry {\n\t\t\t// eslint-disable-next-line no-extra-parens\n\t\t\t$exec(value, /** @type {string} */ (/** @type {unknown} */ (badStringifier)));\n\t\t} catch (e) {\n\t\t\treturn e === isRegexMarker;\n\t\t}\n\t};\n} else {\n\t/** @type {(receiver: ThisParameterType, ...args: Parameters) => ReturnType} */\n\tvar $toString = callBound('Object.prototype.toString');\n\t/** @const @type {'[object RegExp]'} */\n\tvar regexClass = '[object RegExp]';\n\n\t/** @type {import('.')} */\n\tfn = function isRegex(value) {\n\t\t// In older browsers, typeof regex incorrectly returns 'function'\n\t\tif (!value || (typeof value !== 'object' && typeof value !== 'function')) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $toString(value) === regexClass;\n\t};\n}\n\nmodule.exports = fn;\n","'use strict';\n\nvar callBound = require('call-bound');\nvar isRegex = require('is-regex');\n\nvar $exec = callBound('RegExp.prototype.exec');\nvar $TypeError = require('es-errors/type');\n\n/** @type {import('.')} */\nmodule.exports = function regexTester(regex) {\n\tif (!isRegex(regex)) {\n\t\tthrow new $TypeError('`regex` must be a RegExp');\n\t}\n\treturn function test(s) {\n\t\treturn $exec(regex, s) !== null;\n\t};\n};\n","'use strict';\n\n// eslint-disable-next-line no-extra-parens, no-empty-function\nconst cached = /** @type {GeneratorFunctionConstructor} */ (function* () {}.constructor);\n\n/** @type {import('.')} */\nmodule.exports = () => cached;\n\n","'use strict';\n\nvar callBound = require('call-bound');\nvar safeRegexTest = require('safe-regex-test');\nvar isFnRegex = safeRegexTest(/^\\s*(?:function)?\\*/);\nvar hasToStringTag = require('has-tostringtag/shams')();\nvar getProto = require('get-proto');\n\nvar toStr = callBound('Object.prototype.toString');\nvar fnToStr = callBound('Function.prototype.toString');\n\nvar getGeneratorFunction = require('generator-function');\n\n/** @type {import('.')} */\nmodule.exports = function isGeneratorFunction(fn) {\n\tif (typeof fn !== 'function') {\n\t\treturn false;\n\t}\n\tif (isFnRegex(fnToStr(fn))) {\n\t\treturn true;\n\t}\n\tif (!hasToStringTag) {\n\t\tvar str = toStr(fn);\n\t\treturn str === '[object GeneratorFunction]';\n\t}\n\tif (!getProto) {\n\t\treturn false;\n\t}\n\tvar GeneratorFunction = getGeneratorFunction();\n\treturn GeneratorFunction && getProto(fn) === GeneratorFunction.prototype;\n};\n","'use strict';\n\nvar fnToStr = Function.prototype.toString;\nvar reflectApply = typeof Reflect === 'object' && Reflect !== null && Reflect.apply;\nvar badArrayLike;\nvar isCallableMarker;\nif (typeof reflectApply === 'function' && typeof Object.defineProperty === 'function') {\n\ttry {\n\t\tbadArrayLike = Object.defineProperty({}, 'length', {\n\t\t\tget: function () {\n\t\t\t\tthrow isCallableMarker;\n\t\t\t}\n\t\t});\n\t\tisCallableMarker = {};\n\t\t// eslint-disable-next-line no-throw-literal\n\t\treflectApply(function () { throw 42; }, null, badArrayLike);\n\t} catch (_) {\n\t\tif (_ !== isCallableMarker) {\n\t\t\treflectApply = null;\n\t\t}\n\t}\n} else {\n\treflectApply = null;\n}\n\nvar constructorRegex = /^\\s*class\\b/;\nvar isES6ClassFn = function isES6ClassFunction(value) {\n\ttry {\n\t\tvar fnStr = fnToStr.call(value);\n\t\treturn constructorRegex.test(fnStr);\n\t} catch (e) {\n\t\treturn false; // not a function\n\t}\n};\n\nvar tryFunctionObject = function tryFunctionToStr(value) {\n\ttry {\n\t\tif (isES6ClassFn(value)) { return false; }\n\t\tfnToStr.call(value);\n\t\treturn true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n};\nvar toStr = Object.prototype.toString;\nvar objectClass = '[object Object]';\nvar fnClass = '[object Function]';\nvar genClass = '[object GeneratorFunction]';\nvar ddaClass = '[object HTMLAllCollection]'; // IE 11\nvar ddaClass2 = '[object HTML document.all class]';\nvar ddaClass3 = '[object HTMLCollection]'; // IE 9-10\nvar hasToStringTag = typeof Symbol === 'function' && !!Symbol.toStringTag; // better: use `has-tostringtag`\n\nvar isIE68 = !(0 in [,]); // eslint-disable-line no-sparse-arrays, comma-spacing\n\nvar isDDA = function isDocumentDotAll() { return false; };\nif (typeof document === 'object') {\n\t// Firefox 3 canonicalizes DDA to undefined when it's not accessed directly\n\tvar all = document.all;\n\tif (toStr.call(all) === toStr.call(document.all)) {\n\t\tisDDA = function isDocumentDotAll(value) {\n\t\t\t/* globals document: false */\n\t\t\t// in IE 6-8, typeof document.all is \"object\" and it's truthy\n\t\t\tif ((isIE68 || !value) && (typeof value === 'undefined' || typeof value === 'object')) {\n\t\t\t\ttry {\n\t\t\t\t\tvar str = toStr.call(value);\n\t\t\t\t\treturn (\n\t\t\t\t\t\tstr === ddaClass\n\t\t\t\t\t\t|| str === ddaClass2\n\t\t\t\t\t\t|| str === ddaClass3 // opera 12.16\n\t\t\t\t\t\t|| str === objectClass // IE 6-8\n\t\t\t\t\t) && value('') == null; // eslint-disable-line eqeqeq\n\t\t\t\t} catch (e) { /**/ }\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n\t}\n}\n\nmodule.exports = reflectApply\n\t? function isCallable(value) {\n\t\tif (isDDA(value)) { return true; }\n\t\tif (!value) { return false; }\n\t\tif (typeof value !== 'function' && typeof value !== 'object') { return false; }\n\t\ttry {\n\t\t\treflectApply(value, null, badArrayLike);\n\t\t} catch (e) {\n\t\t\tif (e !== isCallableMarker) { return false; }\n\t\t}\n\t\treturn !isES6ClassFn(value) && tryFunctionObject(value);\n\t}\n\t: function isCallable(value) {\n\t\tif (isDDA(value)) { return true; }\n\t\tif (!value) { return false; }\n\t\tif (typeof value !== 'function' && typeof value !== 'object') { return false; }\n\t\tif (hasToStringTag) { return tryFunctionObject(value); }\n\t\tif (isES6ClassFn(value)) { return false; }\n\t\tvar strClass = toStr.call(value);\n\t\tif (strClass !== fnClass && strClass !== genClass && !(/^\\[object HTML/).test(strClass)) { return false; }\n\t\treturn tryFunctionObject(value);\n\t};\n","'use strict';\n\nvar isCallable = require('is-callable');\n\nvar toStr = Object.prototype.toString;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\n/** @type {(arr: A, iterator: (this: This | void, value: A[number], index: number, arr: A) => void, receiver: This | undefined) => void} */\nvar forEachArray = function forEachArray(array, iterator, receiver) {\n for (var i = 0, len = array.length; i < len; i++) {\n if (hasOwnProperty.call(array, i)) {\n if (receiver == null) {\n iterator(array[i], i, array);\n } else {\n iterator.call(receiver, array[i], i, array);\n }\n }\n }\n};\n\n/** @type {(string: S, iterator: (this: This | void, value: S[number], index: number, string: S) => void, receiver: This | undefined) => void} */\nvar forEachString = function forEachString(string, iterator, receiver) {\n for (var i = 0, len = string.length; i < len; i++) {\n // no such thing as a sparse string.\n if (receiver == null) {\n iterator(string.charAt(i), i, string);\n } else {\n iterator.call(receiver, string.charAt(i), i, string);\n }\n }\n};\n\n/** @type {(obj: O, iterator: (this: This | void, value: O[keyof O], index: keyof O, obj: O) => void, receiver: This | undefined) => void} */\nvar forEachObject = function forEachObject(object, iterator, receiver) {\n for (var k in object) {\n if (hasOwnProperty.call(object, k)) {\n if (receiver == null) {\n iterator(object[k], k, object);\n } else {\n iterator.call(receiver, object[k], k, object);\n }\n }\n }\n};\n\n/** @type {(x: unknown) => x is readonly unknown[]} */\nfunction isArray(x) {\n return toStr.call(x) === '[object Array]';\n}\n\n/** @type {import('.')._internal} */\nmodule.exports = function forEach(list, iterator, thisArg) {\n if (!isCallable(iterator)) {\n throw new TypeError('iterator must be a function');\n }\n\n var receiver;\n if (arguments.length >= 3) {\n receiver = thisArg;\n }\n\n if (isArray(list)) {\n forEachArray(list, iterator, receiver);\n } else if (typeof list === 'string') {\n forEachString(list, iterator, receiver);\n } else {\n forEachObject(list, iterator, receiver);\n }\n};\n","'use strict';\n\n/** @type {import('.')} */\nmodule.exports = [\n\t'Float16Array',\n\t'Float32Array',\n\t'Float64Array',\n\t'Int8Array',\n\t'Int16Array',\n\t'Int32Array',\n\t'Uint8Array',\n\t'Uint8ClampedArray',\n\t'Uint16Array',\n\t'Uint32Array',\n\t'BigInt64Array',\n\t'BigUint64Array'\n];\n","'use strict';\n\nvar possibleNames = require('possible-typed-array-names');\n\nvar g = typeof globalThis === 'undefined' ? global : globalThis;\n\n/** @type {import('.')} */\nmodule.exports = function availableTypedArrays() {\n\tvar /** @type {ReturnType} */ out = [];\n\tfor (var i = 0; i < possibleNames.length; i++) {\n\t\tif (typeof g[possibleNames[i]] === 'function') {\n\t\t\t// @ts-expect-error\n\t\t\tout[out.length] = possibleNames[i];\n\t\t}\n\t}\n\treturn out;\n};\n","'use strict';\n\nvar $defineProperty = require('es-define-property');\n\nvar $SyntaxError = require('es-errors/syntax');\nvar $TypeError = require('es-errors/type');\n\nvar gopd = require('gopd');\n\n/** @type {import('.')} */\nmodule.exports = function defineDataProperty(\n\tobj,\n\tproperty,\n\tvalue\n) {\n\tif (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {\n\t\tthrow new $TypeError('`obj` must be an object or a function`');\n\t}\n\tif (typeof property !== 'string' && typeof property !== 'symbol') {\n\t\tthrow new $TypeError('`property` must be a string or a symbol`');\n\t}\n\tif (arguments.length > 3 && typeof arguments[3] !== 'boolean' && arguments[3] !== null) {\n\t\tthrow new $TypeError('`nonEnumerable`, if provided, must be a boolean or null');\n\t}\n\tif (arguments.length > 4 && typeof arguments[4] !== 'boolean' && arguments[4] !== null) {\n\t\tthrow new $TypeError('`nonWritable`, if provided, must be a boolean or null');\n\t}\n\tif (arguments.length > 5 && typeof arguments[5] !== 'boolean' && arguments[5] !== null) {\n\t\tthrow new $TypeError('`nonConfigurable`, if provided, must be a boolean or null');\n\t}\n\tif (arguments.length > 6 && typeof arguments[6] !== 'boolean') {\n\t\tthrow new $TypeError('`loose`, if provided, must be a boolean');\n\t}\n\n\tvar nonEnumerable = arguments.length > 3 ? arguments[3] : null;\n\tvar nonWritable = arguments.length > 4 ? arguments[4] : null;\n\tvar nonConfigurable = arguments.length > 5 ? arguments[5] : null;\n\tvar loose = arguments.length > 6 ? arguments[6] : false;\n\n\t/* @type {false | TypedPropertyDescriptor} */\n\tvar desc = !!gopd && gopd(obj, property);\n\n\tif ($defineProperty) {\n\t\t$defineProperty(obj, property, {\n\t\t\tconfigurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable,\n\t\t\tenumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable,\n\t\t\tvalue: value,\n\t\t\twritable: nonWritable === null && desc ? desc.writable : !nonWritable\n\t\t});\n\t} else if (loose || (!nonEnumerable && !nonWritable && !nonConfigurable)) {\n\t\t// must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable\n\t\tobj[property] = value; // eslint-disable-line no-param-reassign\n\t} else {\n\t\tthrow new $SyntaxError('This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.');\n\t}\n};\n","'use strict';\n\nvar $defineProperty = require('es-define-property');\n\nvar hasPropertyDescriptors = function hasPropertyDescriptors() {\n\treturn !!$defineProperty;\n};\n\nhasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {\n\t// node v0.6 has a bug where array lengths can be Set but not Defined\n\tif (!$defineProperty) {\n\t\treturn null;\n\t}\n\ttry {\n\t\treturn $defineProperty([], 'length', { value: 1 }).length !== 1;\n\t} catch (e) {\n\t\t// In Firefox 4-22, defining length on an array throws an exception.\n\t\treturn true;\n\t}\n};\n\nmodule.exports = hasPropertyDescriptors;\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\nvar define = require('define-data-property');\nvar hasDescriptors = require('has-property-descriptors')();\nvar gOPD = require('gopd');\n\nvar $TypeError = require('es-errors/type');\nvar $floor = GetIntrinsic('%Math.floor%');\n\n/** @type {import('.')} */\nmodule.exports = function setFunctionLength(fn, length) {\n\tif (typeof fn !== 'function') {\n\t\tthrow new $TypeError('`fn` is not a function');\n\t}\n\tif (typeof length !== 'number' || length < 0 || length > 0xFFFFFFFF || $floor(length) !== length) {\n\t\tthrow new $TypeError('`length` must be a positive 32-bit integer');\n\t}\n\n\tvar loose = arguments.length > 2 && !!arguments[2];\n\n\tvar functionLengthIsConfigurable = true;\n\tvar functionLengthIsWritable = true;\n\tif ('length' in fn && gOPD) {\n\t\tvar desc = gOPD(fn, 'length');\n\t\tif (desc && !desc.configurable) {\n\t\t\tfunctionLengthIsConfigurable = false;\n\t\t}\n\t\tif (desc && !desc.writable) {\n\t\t\tfunctionLengthIsWritable = false;\n\t\t}\n\t}\n\n\tif (functionLengthIsConfigurable || functionLengthIsWritable || !loose) {\n\t\tif (hasDescriptors) {\n\t\t\tdefine(/** @type {Parameters[0]} */ (fn), 'length', length, true, true);\n\t\t} else {\n\t\t\tdefine(/** @type {Parameters[0]} */ (fn), 'length', length);\n\t\t}\n\t}\n\treturn fn;\n};\n","'use strict';\n\nvar bind = require('function-bind');\nvar $apply = require('./functionApply');\nvar actualApply = require('./actualApply');\n\n/** @type {import('./applyBind')} */\nmodule.exports = function applyBind() {\n\treturn actualApply(bind, $apply, arguments);\n};\n","'use strict';\n\nvar setFunctionLength = require('set-function-length');\n\nvar $defineProperty = require('es-define-property');\n\nvar callBindBasic = require('call-bind-apply-helpers');\nvar applyBind = require('call-bind-apply-helpers/applyBind');\n\nmodule.exports = function callBind(originalFunction) {\n\tvar func = callBindBasic(arguments);\n\tvar adjustedLength = originalFunction.length - (arguments.length - 1);\n\treturn setFunctionLength(\n\t\tfunc,\n\t\t1 + (adjustedLength > 0 ? adjustedLength : 0),\n\t\ttrue\n\t);\n};\n\nif ($defineProperty) {\n\t$defineProperty(module.exports, 'apply', { value: applyBind });\n} else {\n\tmodule.exports.apply = applyBind;\n}\n","'use strict';\n\nvar forEach = require('for-each');\nvar availableTypedArrays = require('available-typed-arrays');\nvar callBind = require('call-bind');\nvar callBound = require('call-bound');\nvar gOPD = require('gopd');\nvar getProto = require('get-proto');\n\nvar $toString = callBound('Object.prototype.toString');\nvar hasToStringTag = require('has-tostringtag/shams')();\n\nvar g = typeof globalThis === 'undefined' ? global : globalThis;\nvar typedArrays = availableTypedArrays();\n\nvar $slice = callBound('String.prototype.slice');\n\n/** @type {(array: readonly T[], value: unknown) => number} */\nvar $indexOf = callBound('Array.prototype.indexOf', true) || function indexOf(array, value) {\n\tfor (var i = 0; i < array.length; i += 1) {\n\t\tif (array[i] === value) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n};\n\n/** @typedef {import('./types').Getter} Getter */\n/** @type {import('./types').Cache} */\nvar cache = { __proto__: null };\nif (hasToStringTag && gOPD && getProto) {\n\tforEach(typedArrays, function (typedArray) {\n\t\tvar arr = new g[typedArray]();\n\t\tif (Symbol.toStringTag in arr && getProto) {\n\t\t\tvar proto = getProto(arr);\n\t\t\t// @ts-expect-error TS won't narrow inside a closure\n\t\t\tvar descriptor = gOPD(proto, Symbol.toStringTag);\n\t\t\tif (!descriptor && proto) {\n\t\t\t\tvar superProto = getProto(proto);\n\t\t\t\t// @ts-expect-error TS won't narrow inside a closure\n\t\t\t\tdescriptor = gOPD(superProto, Symbol.toStringTag);\n\t\t\t}\n\t\t\t// @ts-expect-error TODO: fix\n\t\t\tcache['$' + typedArray] = callBind(descriptor.get);\n\t\t}\n\t});\n} else {\n\tforEach(typedArrays, function (typedArray) {\n\t\tvar arr = new g[typedArray]();\n\t\tvar fn = arr.slice || arr.set;\n\t\tif (fn) {\n\t\t\tcache[\n\t\t\t\t/** @type {`$${import('.').TypedArrayName}`} */ ('$' + typedArray)\n\t\t\t] = /** @type {import('./types').BoundSlice | import('./types').BoundSet} */ (\n\t\t\t\t// @ts-expect-error TODO FIXME\n\t\t\t\tcallBind(fn)\n\t\t\t);\n\t\t}\n\t});\n}\n\n/** @type {(value: object) => false | import('.').TypedArrayName} */\nvar tryTypedArrays = function tryAllTypedArrays(value) {\n\t/** @type {ReturnType} */ var found = false;\n\tforEach(\n\t\t/** @type {Record<`\\$${import('.').TypedArrayName}`, Getter>} */ (cache),\n\t\t/** @type {(getter: Getter, name: `\\$${import('.').TypedArrayName}`) => void} */\n\t\tfunction (getter, typedArray) {\n\t\t\tif (!found) {\n\t\t\t\ttry {\n\t\t\t\t\t// @ts-expect-error a throw is fine here\n\t\t\t\t\tif ('$' + getter(value) === typedArray) {\n\t\t\t\t\t\tfound = /** @type {import('.').TypedArrayName} */ ($slice(typedArray, 1));\n\t\t\t\t\t}\n\t\t\t\t} catch (e) { /**/ }\n\t\t\t}\n\t\t}\n\t);\n\treturn found;\n};\n\n/** @type {(value: object) => false | import('.').TypedArrayName} */\nvar trySlices = function tryAllSlices(value) {\n\t/** @type {ReturnType} */ var found = false;\n\tforEach(\n\t\t/** @type {Record<`\\$${import('.').TypedArrayName}`, Getter>} */(cache),\n\t\t/** @type {(getter: Getter, name: `\\$${import('.').TypedArrayName}`) => void} */ function (getter, name) {\n\t\t\tif (!found) {\n\t\t\t\ttry {\n\t\t\t\t\t// @ts-expect-error a throw is fine here\n\t\t\t\t\tgetter(value);\n\t\t\t\t\tfound = /** @type {import('.').TypedArrayName} */ ($slice(name, 1));\n\t\t\t\t} catch (e) { /**/ }\n\t\t\t}\n\t\t}\n\t);\n\treturn found;\n};\n\n/** @type {import('.')} */\nmodule.exports = function whichTypedArray(value) {\n\tif (!value || typeof value !== 'object') { return false; }\n\tif (!hasToStringTag) {\n\t\t/** @type {string} */\n\t\tvar tag = $slice($toString(value), 8, -1);\n\t\tif ($indexOf(typedArrays, tag) > -1) {\n\t\t\treturn tag;\n\t\t}\n\t\tif (tag !== 'Object') {\n\t\t\treturn false;\n\t\t}\n\t\t// node < 0.6 hits here on real Typed Arrays\n\t\treturn trySlices(value);\n\t}\n\tif (!gOPD) { return null; } // unknown engine\n\treturn tryTypedArrays(value);\n};\n","'use strict';\n\nvar whichTypedArray = require('which-typed-array');\n\n/** @type {import('.')} */\nmodule.exports = function isTypedArray(value) {\n\treturn !!whichTypedArray(value);\n};\n","// Currently in sync with Node.js lib/internal/util/types.js\n// https://github.com/nodejs/node/commit/112cc7c27551254aa2b17098fb774867f05ed0d9\n\n'use strict';\n\nvar isArgumentsObject = require('is-arguments');\nvar isGeneratorFunction = require('is-generator-function');\nvar whichTypedArray = require('which-typed-array');\nvar isTypedArray = require('is-typed-array');\n\nfunction uncurryThis(f) {\n return f.call.bind(f);\n}\n\nvar BigIntSupported = typeof BigInt !== 'undefined';\nvar SymbolSupported = typeof Symbol !== 'undefined';\n\nvar ObjectToString = uncurryThis(Object.prototype.toString);\n\nvar numberValue = uncurryThis(Number.prototype.valueOf);\nvar stringValue = uncurryThis(String.prototype.valueOf);\nvar booleanValue = uncurryThis(Boolean.prototype.valueOf);\n\nif (BigIntSupported) {\n var bigIntValue = uncurryThis(BigInt.prototype.valueOf);\n}\n\nif (SymbolSupported) {\n var symbolValue = uncurryThis(Symbol.prototype.valueOf);\n}\n\nfunction checkBoxedPrimitive(value, prototypeValueOf) {\n if (typeof value !== 'object') {\n return false;\n }\n try {\n prototypeValueOf(value);\n return true;\n } catch(e) {\n return false;\n }\n}\n\nexports.isArgumentsObject = isArgumentsObject;\nexports.isGeneratorFunction = isGeneratorFunction;\nexports.isTypedArray = isTypedArray;\n\n// Taken from here and modified for better browser support\n// https://github.com/sindresorhus/p-is-promise/blob/cda35a513bda03f977ad5cde3a079d237e82d7ef/index.js\nfunction isPromise(input) {\n\treturn (\n\t\t(\n\t\t\ttypeof Promise !== 'undefined' &&\n\t\t\tinput instanceof Promise\n\t\t) ||\n\t\t(\n\t\t\tinput !== null &&\n\t\t\ttypeof input === 'object' &&\n\t\t\ttypeof input.then === 'function' &&\n\t\t\ttypeof input.catch === 'function'\n\t\t)\n\t);\n}\nexports.isPromise = isPromise;\n\nfunction isArrayBufferView(value) {\n if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView) {\n return ArrayBuffer.isView(value);\n }\n\n return (\n isTypedArray(value) ||\n isDataView(value)\n );\n}\nexports.isArrayBufferView = isArrayBufferView;\n\n\nfunction isUint8Array(value) {\n return whichTypedArray(value) === 'Uint8Array';\n}\nexports.isUint8Array = isUint8Array;\n\nfunction isUint8ClampedArray(value) {\n return whichTypedArray(value) === 'Uint8ClampedArray';\n}\nexports.isUint8ClampedArray = isUint8ClampedArray;\n\nfunction isUint16Array(value) {\n return whichTypedArray(value) === 'Uint16Array';\n}\nexports.isUint16Array = isUint16Array;\n\nfunction isUint32Array(value) {\n return whichTypedArray(value) === 'Uint32Array';\n}\nexports.isUint32Array = isUint32Array;\n\nfunction isInt8Array(value) {\n return whichTypedArray(value) === 'Int8Array';\n}\nexports.isInt8Array = isInt8Array;\n\nfunction isInt16Array(value) {\n return whichTypedArray(value) === 'Int16Array';\n}\nexports.isInt16Array = isInt16Array;\n\nfunction isInt32Array(value) {\n return whichTypedArray(value) === 'Int32Array';\n}\nexports.isInt32Array = isInt32Array;\n\nfunction isFloat32Array(value) {\n return whichTypedArray(value) === 'Float32Array';\n}\nexports.isFloat32Array = isFloat32Array;\n\nfunction isFloat64Array(value) {\n return whichTypedArray(value) === 'Float64Array';\n}\nexports.isFloat64Array = isFloat64Array;\n\nfunction isBigInt64Array(value) {\n return whichTypedArray(value) === 'BigInt64Array';\n}\nexports.isBigInt64Array = isBigInt64Array;\n\nfunction isBigUint64Array(value) {\n return whichTypedArray(value) === 'BigUint64Array';\n}\nexports.isBigUint64Array = isBigUint64Array;\n\nfunction isMapToString(value) {\n return ObjectToString(value) === '[object Map]';\n}\nisMapToString.working = (\n typeof Map !== 'undefined' &&\n isMapToString(new Map())\n);\n\nfunction isMap(value) {\n if (typeof Map === 'undefined') {\n return false;\n }\n\n return isMapToString.working\n ? isMapToString(value)\n : value instanceof Map;\n}\nexports.isMap = isMap;\n\nfunction isSetToString(value) {\n return ObjectToString(value) === '[object Set]';\n}\nisSetToString.working = (\n typeof Set !== 'undefined' &&\n isSetToString(new Set())\n);\nfunction isSet(value) {\n if (typeof Set === 'undefined') {\n return false;\n }\n\n return isSetToString.working\n ? isSetToString(value)\n : value instanceof Set;\n}\nexports.isSet = isSet;\n\nfunction isWeakMapToString(value) {\n return ObjectToString(value) === '[object WeakMap]';\n}\nisWeakMapToString.working = (\n typeof WeakMap !== 'undefined' &&\n isWeakMapToString(new WeakMap())\n);\nfunction isWeakMap(value) {\n if (typeof WeakMap === 'undefined') {\n return false;\n }\n\n return isWeakMapToString.working\n ? isWeakMapToString(value)\n : value instanceof WeakMap;\n}\nexports.isWeakMap = isWeakMap;\n\nfunction isWeakSetToString(value) {\n return ObjectToString(value) === '[object WeakSet]';\n}\nisWeakSetToString.working = (\n typeof WeakSet !== 'undefined' &&\n isWeakSetToString(new WeakSet())\n);\nfunction isWeakSet(value) {\n return isWeakSetToString(value);\n}\nexports.isWeakSet = isWeakSet;\n\nfunction isArrayBufferToString(value) {\n return ObjectToString(value) === '[object ArrayBuffer]';\n}\nisArrayBufferToString.working = (\n typeof ArrayBuffer !== 'undefined' &&\n isArrayBufferToString(new ArrayBuffer())\n);\nfunction isArrayBuffer(value) {\n if (typeof ArrayBuffer === 'undefined') {\n return false;\n }\n\n return isArrayBufferToString.working\n ? isArrayBufferToString(value)\n : value instanceof ArrayBuffer;\n}\nexports.isArrayBuffer = isArrayBuffer;\n\nfunction isDataViewToString(value) {\n return ObjectToString(value) === '[object DataView]';\n}\nisDataViewToString.working = (\n typeof ArrayBuffer !== 'undefined' &&\n typeof DataView !== 'undefined' &&\n isDataViewToString(new DataView(new ArrayBuffer(1), 0, 1))\n);\nfunction isDataView(value) {\n if (typeof DataView === 'undefined') {\n return false;\n }\n\n return isDataViewToString.working\n ? isDataViewToString(value)\n : value instanceof DataView;\n}\nexports.isDataView = isDataView;\n\n// Store a copy of SharedArrayBuffer in case it's deleted elsewhere\nvar SharedArrayBufferCopy = typeof SharedArrayBuffer !== 'undefined' ? SharedArrayBuffer : undefined;\nfunction isSharedArrayBufferToString(value) {\n return ObjectToString(value) === '[object SharedArrayBuffer]';\n}\nfunction isSharedArrayBuffer(value) {\n if (typeof SharedArrayBufferCopy === 'undefined') {\n return false;\n }\n\n if (typeof isSharedArrayBufferToString.working === 'undefined') {\n isSharedArrayBufferToString.working = isSharedArrayBufferToString(new SharedArrayBufferCopy());\n }\n\n return isSharedArrayBufferToString.working\n ? isSharedArrayBufferToString(value)\n : value instanceof SharedArrayBufferCopy;\n}\nexports.isSharedArrayBuffer = isSharedArrayBuffer;\n\nfunction isAsyncFunction(value) {\n return ObjectToString(value) === '[object AsyncFunction]';\n}\nexports.isAsyncFunction = isAsyncFunction;\n\nfunction isMapIterator(value) {\n return ObjectToString(value) === '[object Map Iterator]';\n}\nexports.isMapIterator = isMapIterator;\n\nfunction isSetIterator(value) {\n return ObjectToString(value) === '[object Set Iterator]';\n}\nexports.isSetIterator = isSetIterator;\n\nfunction isGeneratorObject(value) {\n return ObjectToString(value) === '[object Generator]';\n}\nexports.isGeneratorObject = isGeneratorObject;\n\nfunction isWebAssemblyCompiledModule(value) {\n return ObjectToString(value) === '[object WebAssembly.Module]';\n}\nexports.isWebAssemblyCompiledModule = isWebAssemblyCompiledModule;\n\nfunction isNumberObject(value) {\n return checkBoxedPrimitive(value, numberValue);\n}\nexports.isNumberObject = isNumberObject;\n\nfunction isStringObject(value) {\n return checkBoxedPrimitive(value, stringValue);\n}\nexports.isStringObject = isStringObject;\n\nfunction isBooleanObject(value) {\n return checkBoxedPrimitive(value, booleanValue);\n}\nexports.isBooleanObject = isBooleanObject;\n\nfunction isBigIntObject(value) {\n return BigIntSupported && checkBoxedPrimitive(value, bigIntValue);\n}\nexports.isBigIntObject = isBigIntObject;\n\nfunction isSymbolObject(value) {\n return SymbolSupported && checkBoxedPrimitive(value, symbolValue);\n}\nexports.isSymbolObject = isSymbolObject;\n\nfunction isBoxedPrimitive(value) {\n return (\n isNumberObject(value) ||\n isStringObject(value) ||\n isBooleanObject(value) ||\n isBigIntObject(value) ||\n isSymbolObject(value)\n );\n}\nexports.isBoxedPrimitive = isBoxedPrimitive;\n\nfunction isAnyArrayBuffer(value) {\n return typeof Uint8Array !== 'undefined' && (\n isArrayBuffer(value) ||\n isSharedArrayBuffer(value)\n );\n}\nexports.isAnyArrayBuffer = isAnyArrayBuffer;\n\n['isProxy', 'isExternal', 'isModuleNamespaceObject'].forEach(function(method) {\n Object.defineProperty(exports, method, {\n enumerable: false,\n value: function() {\n throw new Error(method + ' is not supported in userland');\n }\n });\n});\n","module.exports = function isBuffer(arg) {\n return arg && typeof arg === 'object'\n && typeof arg.copy === 'function'\n && typeof arg.fill === 'function'\n && typeof arg.readUInt8 === 'function';\n}","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nvar getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors ||\n function getOwnPropertyDescriptors(obj) {\n var keys = Object.keys(obj);\n var descriptors = {};\n for (var i = 0; i < keys.length; i++) {\n descriptors[keys[i]] = Object.getOwnPropertyDescriptor(obj, keys[i]);\n }\n return descriptors;\n };\n\nvar formatRegExp = /%[sdj%]/g;\nexports.format = function(f) {\n if (!isString(f)) {\n var objects = [];\n for (var i = 0; i < arguments.length; i++) {\n objects.push(inspect(arguments[i]));\n }\n return objects.join(' ');\n }\n\n var i = 1;\n var args = arguments;\n var len = args.length;\n var str = String(f).replace(formatRegExp, function(x) {\n if (x === '%%') return '%';\n if (i >= len) return x;\n switch (x) {\n case '%s': return String(args[i++]);\n case '%d': return Number(args[i++]);\n case '%j':\n try {\n return JSON.stringify(args[i++]);\n } catch (_) {\n return '[Circular]';\n }\n default:\n return x;\n }\n });\n for (var x = args[i]; i < len; x = args[++i]) {\n if (isNull(x) || !isObject(x)) {\n str += ' ' + x;\n } else {\n str += ' ' + inspect(x);\n }\n }\n return str;\n};\n\n\n// Mark that a method should not be used.\n// Returns a modified function which warns once by default.\n// If --no-deprecation is set, then it is a no-op.\nexports.deprecate = function(fn, msg) {\n if (typeof process !== 'undefined' && process.noDeprecation === true) {\n return fn;\n }\n\n // Allow for deprecating things in the process of starting up.\n if (typeof process === 'undefined') {\n return function() {\n return exports.deprecate(fn, msg).apply(this, arguments);\n };\n }\n\n var warned = false;\n function deprecated() {\n if (!warned) {\n if (process.throwDeprecation) {\n throw new Error(msg);\n } else if (process.traceDeprecation) {\n console.trace(msg);\n } else {\n console.error(msg);\n }\n warned = true;\n }\n return fn.apply(this, arguments);\n }\n\n return deprecated;\n};\n\n\nvar debugs = {};\nvar debugEnvRegex = /^$/;\n\nif (process.env.NODE_DEBUG) {\n var debugEnv = process.env.NODE_DEBUG;\n debugEnv = debugEnv.replace(/[|\\\\{}()[\\]^$+?.]/g, '\\\\$&')\n .replace(/\\*/g, '.*')\n .replace(/,/g, '$|^')\n .toUpperCase();\n debugEnvRegex = new RegExp('^' + debugEnv + '$', 'i');\n}\nexports.debuglog = function(set) {\n set = set.toUpperCase();\n if (!debugs[set]) {\n if (debugEnvRegex.test(set)) {\n var pid = process.pid;\n debugs[set] = function() {\n var msg = exports.format.apply(exports, arguments);\n console.error('%s %d: %s', set, pid, msg);\n };\n } else {\n debugs[set] = function() {};\n }\n }\n return debugs[set];\n};\n\n\n/**\n * Echos the value of a value. Trys to print the value out\n * in the best way possible given the different types.\n *\n * @param {Object} obj The object to print out.\n * @param {Object} opts Optional options object that alters the output.\n */\n/* legacy: obj, showHidden, depth, colors*/\nfunction inspect(obj, opts) {\n // default options\n var ctx = {\n seen: [],\n stylize: stylizeNoColor\n };\n // legacy...\n if (arguments.length >= 3) ctx.depth = arguments[2];\n if (arguments.length >= 4) ctx.colors = arguments[3];\n if (isBoolean(opts)) {\n // legacy...\n ctx.showHidden = opts;\n } else if (opts) {\n // got an \"options\" object\n exports._extend(ctx, opts);\n }\n // set default options\n if (isUndefined(ctx.showHidden)) ctx.showHidden = false;\n if (isUndefined(ctx.depth)) ctx.depth = 2;\n if (isUndefined(ctx.colors)) ctx.colors = false;\n if (isUndefined(ctx.customInspect)) ctx.customInspect = true;\n if (ctx.colors) ctx.stylize = stylizeWithColor;\n return formatValue(ctx, obj, ctx.depth);\n}\nexports.inspect = inspect;\n\n\n// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics\ninspect.colors = {\n 'bold' : [1, 22],\n 'italic' : [3, 23],\n 'underline' : [4, 24],\n 'inverse' : [7, 27],\n 'white' : [37, 39],\n 'grey' : [90, 39],\n 'black' : [30, 39],\n 'blue' : [34, 39],\n 'cyan' : [36, 39],\n 'green' : [32, 39],\n 'magenta' : [35, 39],\n 'red' : [31, 39],\n 'yellow' : [33, 39]\n};\n\n// Don't use 'blue' not visible on cmd.exe\ninspect.styles = {\n 'special': 'cyan',\n 'number': 'yellow',\n 'boolean': 'yellow',\n 'undefined': 'grey',\n 'null': 'bold',\n 'string': 'green',\n 'date': 'magenta',\n // \"name\": intentionally not styling\n 'regexp': 'red'\n};\n\n\nfunction stylizeWithColor(str, styleType) {\n var style = inspect.styles[styleType];\n\n if (style) {\n return '\\u001b[' + inspect.colors[style][0] + 'm' + str +\n '\\u001b[' + inspect.colors[style][1] + 'm';\n } else {\n return str;\n }\n}\n\n\nfunction stylizeNoColor(str, styleType) {\n return str;\n}\n\n\nfunction arrayToHash(array) {\n var hash = {};\n\n array.forEach(function(val, idx) {\n hash[val] = true;\n });\n\n return hash;\n}\n\n\nfunction formatValue(ctx, value, recurseTimes) {\n // Provide a hook for user-specified inspect functions.\n // Check that value is an object with an inspect function on it\n if (ctx.customInspect &&\n value &&\n isFunction(value.inspect) &&\n // Filter out the util module, it's inspect function is special\n value.inspect !== exports.inspect &&\n // Also filter out any prototype objects using the circular check.\n !(value.constructor && value.constructor.prototype === value)) {\n var ret = value.inspect(recurseTimes, ctx);\n if (!isString(ret)) {\n ret = formatValue(ctx, ret, recurseTimes);\n }\n return ret;\n }\n\n // Primitive types cannot have properties\n var primitive = formatPrimitive(ctx, value);\n if (primitive) {\n return primitive;\n }\n\n // Look up the keys of the object.\n var keys = Object.keys(value);\n var visibleKeys = arrayToHash(keys);\n\n if (ctx.showHidden) {\n keys = Object.getOwnPropertyNames(value);\n }\n\n // IE doesn't make error fields non-enumerable\n // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx\n if (isError(value)\n && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {\n return formatError(value);\n }\n\n // Some type of object without properties can be shortcutted.\n if (keys.length === 0) {\n if (isFunction(value)) {\n var name = value.name ? ': ' + value.name : '';\n return ctx.stylize('[Function' + name + ']', 'special');\n }\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n }\n if (isDate(value)) {\n return ctx.stylize(Date.prototype.toString.call(value), 'date');\n }\n if (isError(value)) {\n return formatError(value);\n }\n }\n\n var base = '', array = false, braces = ['{', '}'];\n\n // Make Array say that they are Array\n if (isArray(value)) {\n array = true;\n braces = ['[', ']'];\n }\n\n // Make functions say that they are functions\n if (isFunction(value)) {\n var n = value.name ? ': ' + value.name : '';\n base = ' [Function' + n + ']';\n }\n\n // Make RegExps say that they are RegExps\n if (isRegExp(value)) {\n base = ' ' + RegExp.prototype.toString.call(value);\n }\n\n // Make dates with properties first say the date\n if (isDate(value)) {\n base = ' ' + Date.prototype.toUTCString.call(value);\n }\n\n // Make error with message first say the error\n if (isError(value)) {\n base = ' ' + formatError(value);\n }\n\n if (keys.length === 0 && (!array || value.length == 0)) {\n return braces[0] + base + braces[1];\n }\n\n if (recurseTimes < 0) {\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n } else {\n return ctx.stylize('[Object]', 'special');\n }\n }\n\n ctx.seen.push(value);\n\n var output;\n if (array) {\n output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);\n } else {\n output = keys.map(function(key) {\n return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);\n });\n }\n\n ctx.seen.pop();\n\n return reduceToSingleString(output, base, braces);\n}\n\n\nfunction formatPrimitive(ctx, value) {\n if (isUndefined(value))\n return ctx.stylize('undefined', 'undefined');\n if (isString(value)) {\n var simple = '\\'' + JSON.stringify(value).replace(/^\"|\"$/g, '')\n .replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"') + '\\'';\n return ctx.stylize(simple, 'string');\n }\n if (isNumber(value))\n return ctx.stylize('' + value, 'number');\n if (isBoolean(value))\n return ctx.stylize('' + value, 'boolean');\n // For some reason typeof null is \"object\", so special case here.\n if (isNull(value))\n return ctx.stylize('null', 'null');\n}\n\n\nfunction formatError(value) {\n return '[' + Error.prototype.toString.call(value) + ']';\n}\n\n\nfunction formatArray(ctx, value, recurseTimes, visibleKeys, keys) {\n var output = [];\n for (var i = 0, l = value.length; i < l; ++i) {\n if (hasOwnProperty(value, String(i))) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n String(i), true));\n } else {\n output.push('');\n }\n }\n keys.forEach(function(key) {\n if (!key.match(/^\\d+$/)) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n key, true));\n }\n });\n return output;\n}\n\n\nfunction formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {\n var name, str, desc;\n desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };\n if (desc.get) {\n if (desc.set) {\n str = ctx.stylize('[Getter/Setter]', 'special');\n } else {\n str = ctx.stylize('[Getter]', 'special');\n }\n } else {\n if (desc.set) {\n str = ctx.stylize('[Setter]', 'special');\n }\n }\n if (!hasOwnProperty(visibleKeys, key)) {\n name = '[' + key + ']';\n }\n if (!str) {\n if (ctx.seen.indexOf(desc.value) < 0) {\n if (isNull(recurseTimes)) {\n str = formatValue(ctx, desc.value, null);\n } else {\n str = formatValue(ctx, desc.value, recurseTimes - 1);\n }\n if (str.indexOf('\\n') > -1) {\n if (array) {\n str = str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n').slice(2);\n } else {\n str = '\\n' + str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n');\n }\n }\n } else {\n str = ctx.stylize('[Circular]', 'special');\n }\n }\n if (isUndefined(name)) {\n if (array && key.match(/^\\d+$/)) {\n return str;\n }\n name = JSON.stringify('' + key);\n if (name.match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)) {\n name = name.slice(1, -1);\n name = ctx.stylize(name, 'name');\n } else {\n name = name.replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"')\n .replace(/(^\"|\"$)/g, \"'\");\n name = ctx.stylize(name, 'string');\n }\n }\n\n return name + ': ' + str;\n}\n\n\nfunction reduceToSingleString(output, base, braces) {\n var numLinesEst = 0;\n var length = output.reduce(function(prev, cur) {\n numLinesEst++;\n if (cur.indexOf('\\n') >= 0) numLinesEst++;\n return prev + cur.replace(/\\u001b\\[\\d\\d?m/g, '').length + 1;\n }, 0);\n\n if (length > 60) {\n return braces[0] +\n (base === '' ? '' : base + '\\n ') +\n ' ' +\n output.join(',\\n ') +\n ' ' +\n braces[1];\n }\n\n return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];\n}\n\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\nexports.types = require('./support/types');\n\nfunction isArray(ar) {\n return Array.isArray(ar);\n}\nexports.isArray = isArray;\n\nfunction isBoolean(arg) {\n return typeof arg === 'boolean';\n}\nexports.isBoolean = isBoolean;\n\nfunction isNull(arg) {\n return arg === null;\n}\nexports.isNull = isNull;\n\nfunction isNullOrUndefined(arg) {\n return arg == null;\n}\nexports.isNullOrUndefined = isNullOrUndefined;\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\nexports.isNumber = isNumber;\n\nfunction isString(arg) {\n return typeof arg === 'string';\n}\nexports.isString = isString;\n\nfunction isSymbol(arg) {\n return typeof arg === 'symbol';\n}\nexports.isSymbol = isSymbol;\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\nexports.isUndefined = isUndefined;\n\nfunction isRegExp(re) {\n return isObject(re) && objectToString(re) === '[object RegExp]';\n}\nexports.isRegExp = isRegExp;\nexports.types.isRegExp = isRegExp;\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\nexports.isObject = isObject;\n\nfunction isDate(d) {\n return isObject(d) && objectToString(d) === '[object Date]';\n}\nexports.isDate = isDate;\nexports.types.isDate = isDate;\n\nfunction isError(e) {\n return isObject(e) &&\n (objectToString(e) === '[object Error]' || e instanceof Error);\n}\nexports.isError = isError;\nexports.types.isNativeError = isError;\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\nexports.isFunction = isFunction;\n\nfunction isPrimitive(arg) {\n return arg === null ||\n typeof arg === 'boolean' ||\n typeof arg === 'number' ||\n typeof arg === 'string' ||\n typeof arg === 'symbol' || // ES6 symbol\n typeof arg === 'undefined';\n}\nexports.isPrimitive = isPrimitive;\n\nexports.isBuffer = require('./support/isBuffer');\n\nfunction objectToString(o) {\n return Object.prototype.toString.call(o);\n}\n\n\nfunction pad(n) {\n return n < 10 ? '0' + n.toString(10) : n.toString(10);\n}\n\n\nvar months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',\n 'Oct', 'Nov', 'Dec'];\n\n// 26 Feb 16:19:34\nfunction timestamp() {\n var d = new Date();\n var time = [pad(d.getHours()),\n pad(d.getMinutes()),\n pad(d.getSeconds())].join(':');\n return [d.getDate(), months[d.getMonth()], time].join(' ');\n}\n\n\n// log is just a thin wrapper to console.log that prepends a timestamp\nexports.log = function() {\n console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));\n};\n\n\n/**\n * Inherit the prototype methods from one constructor into another.\n *\n * The Function.prototype.inherits from lang.js rewritten as a standalone\n * function (not on Function.prototype). NOTE: If this file is to be loaded\n * during bootstrapping this function needs to be rewritten using some native\n * functions as prototype setup using normal JavaScript does not work as\n * expected during bootstrapping (see mirror.js in r114903).\n *\n * @param {function} ctor Constructor function which needs to inherit the\n * prototype.\n * @param {function} superCtor Constructor function to inherit prototype from.\n */\nexports.inherits = require('inherits');\n\nexports._extend = function(origin, add) {\n // Don't do anything if add isn't an object\n if (!add || !isObject(add)) return origin;\n\n var keys = Object.keys(add);\n var i = keys.length;\n while (i--) {\n origin[keys[i]] = add[keys[i]];\n }\n return origin;\n};\n\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nvar kCustomPromisifiedSymbol = typeof Symbol !== 'undefined' ? Symbol('util.promisify.custom') : undefined;\n\nexports.promisify = function promisify(original) {\n if (typeof original !== 'function')\n throw new TypeError('The \"original\" argument must be of type Function');\n\n if (kCustomPromisifiedSymbol && original[kCustomPromisifiedSymbol]) {\n var fn = original[kCustomPromisifiedSymbol];\n if (typeof fn !== 'function') {\n throw new TypeError('The \"util.promisify.custom\" argument must be of type Function');\n }\n Object.defineProperty(fn, kCustomPromisifiedSymbol, {\n value: fn, enumerable: false, writable: false, configurable: true\n });\n return fn;\n }\n\n function fn() {\n var promiseResolve, promiseReject;\n var promise = new Promise(function (resolve, reject) {\n promiseResolve = resolve;\n promiseReject = reject;\n });\n\n var args = [];\n for (var i = 0; i < arguments.length; i++) {\n args.push(arguments[i]);\n }\n args.push(function (err, value) {\n if (err) {\n promiseReject(err);\n } else {\n promiseResolve(value);\n }\n });\n\n try {\n original.apply(this, args);\n } catch (err) {\n promiseReject(err);\n }\n\n return promise;\n }\n\n Object.setPrototypeOf(fn, Object.getPrototypeOf(original));\n\n if (kCustomPromisifiedSymbol) Object.defineProperty(fn, kCustomPromisifiedSymbol, {\n value: fn, enumerable: false, writable: false, configurable: true\n });\n return Object.defineProperties(\n fn,\n getOwnPropertyDescriptors(original)\n );\n}\n\nexports.promisify.custom = kCustomPromisifiedSymbol\n\nfunction callbackifyOnRejected(reason, cb) {\n // `!reason` guard inspired by bluebird (Ref: https://goo.gl/t5IS6M).\n // Because `null` is a special error value in callbacks which means \"no error\n // occurred\", we error-wrap so the callback consumer can distinguish between\n // \"the promise rejected with null\" or \"the promise fulfilled with undefined\".\n if (!reason) {\n var newReason = new Error('Promise was rejected with a falsy value');\n newReason.reason = reason;\n reason = newReason;\n }\n return cb(reason);\n}\n\nfunction callbackify(original) {\n if (typeof original !== 'function') {\n throw new TypeError('The \"original\" argument must be of type Function');\n }\n\n // We DO NOT return the promise as it gives the user a false sense that\n // the promise is actually somehow related to the callback's execution\n // and that the callback throwing will reject the promise.\n function callbackified() {\n var args = [];\n for (var i = 0; i < arguments.length; i++) {\n args.push(arguments[i]);\n }\n\n var maybeCb = args.pop();\n if (typeof maybeCb !== 'function') {\n throw new TypeError('The last argument must be of type Function');\n }\n var self = this;\n var cb = function() {\n return maybeCb.apply(self, arguments);\n };\n // In true node style we process the callback on `nextTick` with all the\n // implications (stack, `uncaughtException`, `async_hooks`)\n original.apply(this, args)\n .then(function(ret) { process.nextTick(cb.bind(null, null, ret)) },\n function(rej) { process.nextTick(callbackifyOnRejected.bind(null, rej, cb)) });\n }\n\n Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original));\n Object.defineProperties(callbackified,\n getOwnPropertyDescriptors(original));\n return callbackified;\n}\nexports.callbackify = callbackify;\n","'use strict';\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return typeof key === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (typeof input !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (typeof res !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nvar _require = require('buffer'),\n Buffer = _require.Buffer;\nvar _require2 = require('util'),\n inspect = _require2.inspect;\nvar custom = inspect && inspect.custom || 'inspect';\nfunction copyBuffer(src, target, offset) {\n Buffer.prototype.copy.call(src, target, offset);\n}\nmodule.exports = /*#__PURE__*/function () {\n function BufferList() {\n _classCallCheck(this, BufferList);\n this.head = null;\n this.tail = null;\n this.length = 0;\n }\n _createClass(BufferList, [{\n key: \"push\",\n value: function push(v) {\n var entry = {\n data: v,\n next: null\n };\n if (this.length > 0) this.tail.next = entry;else this.head = entry;\n this.tail = entry;\n ++this.length;\n }\n }, {\n key: \"unshift\",\n value: function unshift(v) {\n var entry = {\n data: v,\n next: this.head\n };\n if (this.length === 0) this.tail = entry;\n this.head = entry;\n ++this.length;\n }\n }, {\n key: \"shift\",\n value: function shift() {\n if (this.length === 0) return;\n var ret = this.head.data;\n if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;\n --this.length;\n return ret;\n }\n }, {\n key: \"clear\",\n value: function clear() {\n this.head = this.tail = null;\n this.length = 0;\n }\n }, {\n key: \"join\",\n value: function join(s) {\n if (this.length === 0) return '';\n var p = this.head;\n var ret = '' + p.data;\n while (p = p.next) ret += s + p.data;\n return ret;\n }\n }, {\n key: \"concat\",\n value: function concat(n) {\n if (this.length === 0) return Buffer.alloc(0);\n var ret = Buffer.allocUnsafe(n >>> 0);\n var p = this.head;\n var i = 0;\n while (p) {\n copyBuffer(p.data, ret, i);\n i += p.data.length;\n p = p.next;\n }\n return ret;\n }\n\n // Consumes a specified amount of bytes or characters from the buffered data.\n }, {\n key: \"consume\",\n value: function consume(n, hasStrings) {\n var ret;\n if (n < this.head.data.length) {\n // `slice` is the same for buffers and strings.\n ret = this.head.data.slice(0, n);\n this.head.data = this.head.data.slice(n);\n } else if (n === this.head.data.length) {\n // First chunk is a perfect match.\n ret = this.shift();\n } else {\n // Result spans more than one buffer.\n ret = hasStrings ? this._getString(n) : this._getBuffer(n);\n }\n return ret;\n }\n }, {\n key: \"first\",\n value: function first() {\n return this.head.data;\n }\n\n // Consumes a specified amount of characters from the buffered data.\n }, {\n key: \"_getString\",\n value: function _getString(n) {\n var p = this.head;\n var c = 1;\n var ret = p.data;\n n -= ret.length;\n while (p = p.next) {\n var str = p.data;\n var nb = n > str.length ? str.length : n;\n if (nb === str.length) ret += str;else ret += str.slice(0, n);\n n -= nb;\n if (n === 0) {\n if (nb === str.length) {\n ++c;\n if (p.next) this.head = p.next;else this.head = this.tail = null;\n } else {\n this.head = p;\n p.data = str.slice(nb);\n }\n break;\n }\n ++c;\n }\n this.length -= c;\n return ret;\n }\n\n // Consumes a specified amount of bytes from the buffered data.\n }, {\n key: \"_getBuffer\",\n value: function _getBuffer(n) {\n var ret = Buffer.allocUnsafe(n);\n var p = this.head;\n var c = 1;\n p.data.copy(ret);\n n -= p.data.length;\n while (p = p.next) {\n var buf = p.data;\n var nb = n > buf.length ? buf.length : n;\n buf.copy(ret, ret.length - n, 0, nb);\n n -= nb;\n if (n === 0) {\n if (nb === buf.length) {\n ++c;\n if (p.next) this.head = p.next;else this.head = this.tail = null;\n } else {\n this.head = p;\n p.data = buf.slice(nb);\n }\n break;\n }\n ++c;\n }\n this.length -= c;\n return ret;\n }\n\n // Make sure the linked list only shows the minimal necessary information.\n }, {\n key: custom,\n value: function value(_, options) {\n return inspect(this, _objectSpread(_objectSpread({}, options), {}, {\n // Only inspect one level.\n depth: 0,\n // It should not recurse.\n customInspect: false\n }));\n }\n }]);\n return BufferList;\n}();","'use strict';\n\n// undocumented cb() API, needed for core, not for public API\nfunction destroy(err, cb) {\n var _this = this;\n var readableDestroyed = this._readableState && this._readableState.destroyed;\n var writableDestroyed = this._writableState && this._writableState.destroyed;\n if (readableDestroyed || writableDestroyed) {\n if (cb) {\n cb(err);\n } else if (err) {\n if (!this._writableState) {\n process.nextTick(emitErrorNT, this, err);\n } else if (!this._writableState.errorEmitted) {\n this._writableState.errorEmitted = true;\n process.nextTick(emitErrorNT, this, err);\n }\n }\n return this;\n }\n\n // we set destroyed to true before firing error callbacks in order\n // to make it re-entrance safe in case destroy() is called within callbacks\n\n if (this._readableState) {\n this._readableState.destroyed = true;\n }\n\n // if this is a duplex stream mark the writable part as destroyed as well\n if (this._writableState) {\n this._writableState.destroyed = true;\n }\n this._destroy(err || null, function (err) {\n if (!cb && err) {\n if (!_this._writableState) {\n process.nextTick(emitErrorAndCloseNT, _this, err);\n } else if (!_this._writableState.errorEmitted) {\n _this._writableState.errorEmitted = true;\n process.nextTick(emitErrorAndCloseNT, _this, err);\n } else {\n process.nextTick(emitCloseNT, _this);\n }\n } else if (cb) {\n process.nextTick(emitCloseNT, _this);\n cb(err);\n } else {\n process.nextTick(emitCloseNT, _this);\n }\n });\n return this;\n}\nfunction emitErrorAndCloseNT(self, err) {\n emitErrorNT(self, err);\n emitCloseNT(self);\n}\nfunction emitCloseNT(self) {\n if (self._writableState && !self._writableState.emitClose) return;\n if (self._readableState && !self._readableState.emitClose) return;\n self.emit('close');\n}\nfunction undestroy() {\n if (this._readableState) {\n this._readableState.destroyed = false;\n this._readableState.reading = false;\n this._readableState.ended = false;\n this._readableState.endEmitted = false;\n }\n if (this._writableState) {\n this._writableState.destroyed = false;\n this._writableState.ended = false;\n this._writableState.ending = false;\n this._writableState.finalCalled = false;\n this._writableState.prefinished = false;\n this._writableState.finished = false;\n this._writableState.errorEmitted = false;\n }\n}\nfunction emitErrorNT(self, err) {\n self.emit('error', err);\n}\nfunction errorOrDestroy(stream, err) {\n // We have tests that rely on errors being emitted\n // in the same tick, so changing this is semver major.\n // For now when you opt-in to autoDestroy we allow\n // the error to be emitted nextTick. In a future\n // semver major update we should change the default to this.\n\n var rState = stream._readableState;\n var wState = stream._writableState;\n if (rState && rState.autoDestroy || wState && wState.autoDestroy) stream.destroy(err);else stream.emit('error', err);\n}\nmodule.exports = {\n destroy: destroy,\n undestroy: undestroy,\n errorOrDestroy: errorOrDestroy\n};","'use strict';\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nvar codes = {};\n\nfunction createErrorType(code, message, Base) {\n if (!Base) {\n Base = Error;\n }\n\n function getMessage(arg1, arg2, arg3) {\n if (typeof message === 'string') {\n return message;\n } else {\n return message(arg1, arg2, arg3);\n }\n }\n\n var NodeError =\n /*#__PURE__*/\n function (_Base) {\n _inheritsLoose(NodeError, _Base);\n\n function NodeError(arg1, arg2, arg3) {\n return _Base.call(this, getMessage(arg1, arg2, arg3)) || this;\n }\n\n return NodeError;\n }(Base);\n\n NodeError.prototype.name = Base.name;\n NodeError.prototype.code = code;\n codes[code] = NodeError;\n} // https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js\n\n\nfunction oneOf(expected, thing) {\n if (Array.isArray(expected)) {\n var len = expected.length;\n expected = expected.map(function (i) {\n return String(i);\n });\n\n if (len > 2) {\n return \"one of \".concat(thing, \" \").concat(expected.slice(0, len - 1).join(', '), \", or \") + expected[len - 1];\n } else if (len === 2) {\n return \"one of \".concat(thing, \" \").concat(expected[0], \" or \").concat(expected[1]);\n } else {\n return \"of \".concat(thing, \" \").concat(expected[0]);\n }\n } else {\n return \"of \".concat(thing, \" \").concat(String(expected));\n }\n} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith\n\n\nfunction startsWith(str, search, pos) {\n return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search;\n} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith\n\n\nfunction endsWith(str, search, this_len) {\n if (this_len === undefined || this_len > str.length) {\n this_len = str.length;\n }\n\n return str.substring(this_len - search.length, this_len) === search;\n} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes\n\n\nfunction includes(str, search, start) {\n if (typeof start !== 'number') {\n start = 0;\n }\n\n if (start + search.length > str.length) {\n return false;\n } else {\n return str.indexOf(search, start) !== -1;\n }\n}\n\ncreateErrorType('ERR_INVALID_OPT_VALUE', function (name, value) {\n return 'The value \"' + value + '\" is invalid for option \"' + name + '\"';\n}, TypeError);\ncreateErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) {\n // determiner: 'must be' or 'must not be'\n var determiner;\n\n if (typeof expected === 'string' && startsWith(expected, 'not ')) {\n determiner = 'must not be';\n expected = expected.replace(/^not /, '');\n } else {\n determiner = 'must be';\n }\n\n var msg;\n\n if (endsWith(name, ' argument')) {\n // For cases like 'first argument'\n msg = \"The \".concat(name, \" \").concat(determiner, \" \").concat(oneOf(expected, 'type'));\n } else {\n var type = includes(name, '.') ? 'property' : 'argument';\n msg = \"The \\\"\".concat(name, \"\\\" \").concat(type, \" \").concat(determiner, \" \").concat(oneOf(expected, 'type'));\n }\n\n msg += \". Received type \".concat(typeof actual);\n return msg;\n}, TypeError);\ncreateErrorType('ERR_STREAM_PUSH_AFTER_EOF', 'stream.push() after EOF');\ncreateErrorType('ERR_METHOD_NOT_IMPLEMENTED', function (name) {\n return 'The ' + name + ' method is not implemented';\n});\ncreateErrorType('ERR_STREAM_PREMATURE_CLOSE', 'Premature close');\ncreateErrorType('ERR_STREAM_DESTROYED', function (name) {\n return 'Cannot call ' + name + ' after a stream was destroyed';\n});\ncreateErrorType('ERR_MULTIPLE_CALLBACK', 'Callback called multiple times');\ncreateErrorType('ERR_STREAM_CANNOT_PIPE', 'Cannot pipe, not readable');\ncreateErrorType('ERR_STREAM_WRITE_AFTER_END', 'write after end');\ncreateErrorType('ERR_STREAM_NULL_VALUES', 'May not write null values to stream', TypeError);\ncreateErrorType('ERR_UNKNOWN_ENCODING', function (arg) {\n return 'Unknown encoding: ' + arg;\n}, TypeError);\ncreateErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event');\nmodule.exports.codes = codes;\n","'use strict';\n\nvar ERR_INVALID_OPT_VALUE = require('../../../errors').codes.ERR_INVALID_OPT_VALUE;\nfunction highWaterMarkFrom(options, isDuplex, duplexKey) {\n return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null;\n}\nfunction getHighWaterMark(state, options, duplexKey, isDuplex) {\n var hwm = highWaterMarkFrom(options, isDuplex, duplexKey);\n if (hwm != null) {\n if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) {\n var name = isDuplex ? duplexKey : 'highWaterMark';\n throw new ERR_INVALID_OPT_VALUE(name, hwm);\n }\n return Math.floor(hwm);\n }\n\n // Default value\n return state.objectMode ? 16 : 16 * 1024;\n}\nmodule.exports = {\n getHighWaterMark: getHighWaterMark\n};","\n/**\n * Module exports.\n */\n\nmodule.exports = deprecate;\n\n/**\n * Mark that a method should not be used.\n * Returns a modified function which warns once by default.\n *\n * If `localStorage.noDeprecation = true` is set, then it is a no-op.\n *\n * If `localStorage.throwDeprecation = true` is set, then deprecated functions\n * will throw an Error when invoked.\n *\n * If `localStorage.traceDeprecation = true` is set, then deprecated functions\n * will invoke `console.trace()` instead of `console.error()`.\n *\n * @param {Function} fn - the function to deprecate\n * @param {String} msg - the string to print to the console when `fn` is invoked\n * @returns {Function} a new \"deprecated\" version of `fn`\n * @api public\n */\n\nfunction deprecate (fn, msg) {\n if (config('noDeprecation')) {\n return fn;\n }\n\n var warned = false;\n function deprecated() {\n if (!warned) {\n if (config('throwDeprecation')) {\n throw new Error(msg);\n } else if (config('traceDeprecation')) {\n console.trace(msg);\n } else {\n console.warn(msg);\n }\n warned = true;\n }\n return fn.apply(this, arguments);\n }\n\n return deprecated;\n}\n\n/**\n * Checks `localStorage` for boolean values for the given `name`.\n *\n * @param {String} name\n * @returns {Boolean}\n * @api private\n */\n\nfunction config (name) {\n // accessing global.localStorage can trigger a DOMException in sandboxed iframes\n try {\n if (!global.localStorage) return false;\n } catch (_) {\n return false;\n }\n var val = global.localStorage[name];\n if (null == val) return false;\n return String(val).toLowerCase() === 'true';\n}\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// A bit simpler than readable streams.\n// Implement an async ._write(chunk, encoding, cb), and it'll handle all\n// the drain event emission and buffering.\n\n'use strict';\n\nmodule.exports = Writable;\n\n/* */\nfunction WriteReq(chunk, encoding, cb) {\n this.chunk = chunk;\n this.encoding = encoding;\n this.callback = cb;\n this.next = null;\n}\n\n// It seems a linked list but it is not\n// there will be only 2 of these for each stream\nfunction CorkedRequest(state) {\n var _this = this;\n this.next = null;\n this.entry = null;\n this.finish = function () {\n onCorkedFinish(_this, state);\n };\n}\n/* */\n\n/**/\nvar Duplex;\n/**/\n\nWritable.WritableState = WritableState;\n\n/**/\nvar internalUtil = {\n deprecate: require('util-deprecate')\n};\n/**/\n\n/**/\nvar Stream = require('./internal/streams/stream');\n/**/\n\nvar Buffer = require('buffer').Buffer;\nvar OurUint8Array = (typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}).Uint8Array || function () {};\nfunction _uint8ArrayToBuffer(chunk) {\n return Buffer.from(chunk);\n}\nfunction _isUint8Array(obj) {\n return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\n}\nvar destroyImpl = require('./internal/streams/destroy');\nvar _require = require('./internal/streams/state'),\n getHighWaterMark = _require.getHighWaterMark;\nvar _require$codes = require('../errors').codes,\n ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE,\n ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,\n ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK,\n ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE,\n ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED,\n ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES,\n ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END,\n ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING;\nvar errorOrDestroy = destroyImpl.errorOrDestroy;\nrequire('inherits')(Writable, Stream);\nfunction nop() {}\nfunction WritableState(options, stream, isDuplex) {\n Duplex = Duplex || require('./_stream_duplex');\n options = options || {};\n\n // Duplex streams are both readable and writable, but share\n // the same options object.\n // However, some cases require setting options to different\n // values for the readable and the writable sides of the duplex stream,\n // e.g. options.readableObjectMode vs. options.writableObjectMode, etc.\n if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex;\n\n // object stream flag to indicate whether or not this stream\n // contains buffers or objects.\n this.objectMode = !!options.objectMode;\n if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;\n\n // the point at which write() starts returning false\n // Note: 0 is a valid value, means that we always return false if\n // the entire buffer is not flushed immediately on write()\n this.highWaterMark = getHighWaterMark(this, options, 'writableHighWaterMark', isDuplex);\n\n // if _final has been called\n this.finalCalled = false;\n\n // drain event flag.\n this.needDrain = false;\n // at the start of calling end()\n this.ending = false;\n // when end() has been called, and returned\n this.ended = false;\n // when 'finish' is emitted\n this.finished = false;\n\n // has it been destroyed\n this.destroyed = false;\n\n // should we decode strings into buffers before passing to _write?\n // this is here so that some node-core streams can optimize string\n // handling at a lower level.\n var noDecode = options.decodeStrings === false;\n this.decodeStrings = !noDecode;\n\n // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n this.defaultEncoding = options.defaultEncoding || 'utf8';\n\n // not an actual buffer we keep track of, but a measurement\n // of how much we're waiting to get pushed to some underlying\n // socket or file.\n this.length = 0;\n\n // a flag to see when we're in the middle of a write.\n this.writing = false;\n\n // when true all writes will be buffered until .uncork() call\n this.corked = 0;\n\n // a flag to be able to tell if the onwrite cb is called immediately,\n // or on a later tick. We set this to true at first, because any\n // actions that shouldn't happen until \"later\" should generally also\n // not happen before the first write call.\n this.sync = true;\n\n // a flag to know if we're processing previously buffered items, which\n // may call the _write() callback in the same tick, so that we don't\n // end up in an overlapped onwrite situation.\n this.bufferProcessing = false;\n\n // the callback that's passed to _write(chunk,cb)\n this.onwrite = function (er) {\n onwrite(stream, er);\n };\n\n // the callback that the user supplies to write(chunk,encoding,cb)\n this.writecb = null;\n\n // the amount that is being written when _write is called.\n this.writelen = 0;\n this.bufferedRequest = null;\n this.lastBufferedRequest = null;\n\n // number of pending user-supplied write callbacks\n // this must be 0 before 'finish' can be emitted\n this.pendingcb = 0;\n\n // emit prefinish if the only thing we're waiting for is _write cbs\n // This is relevant for synchronous Transform streams\n this.prefinished = false;\n\n // True if the error was already emitted and should not be thrown again\n this.errorEmitted = false;\n\n // Should close be emitted on destroy. Defaults to true.\n this.emitClose = options.emitClose !== false;\n\n // Should .destroy() be called after 'finish' (and potentially 'end')\n this.autoDestroy = !!options.autoDestroy;\n\n // count buffered requests\n this.bufferedRequestCount = 0;\n\n // allocate the first CorkedRequest, there is always\n // one allocated and free to use, and we maintain at most two\n this.corkedRequestsFree = new CorkedRequest(this);\n}\nWritableState.prototype.getBuffer = function getBuffer() {\n var current = this.bufferedRequest;\n var out = [];\n while (current) {\n out.push(current);\n current = current.next;\n }\n return out;\n};\n(function () {\n try {\n Object.defineProperty(WritableState.prototype, 'buffer', {\n get: internalUtil.deprecate(function writableStateBufferGetter() {\n return this.getBuffer();\n }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')\n });\n } catch (_) {}\n})();\n\n// Test _writableState for inheritance to account for Duplex streams,\n// whose prototype chain only points to Readable.\nvar realHasInstance;\nif (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {\n realHasInstance = Function.prototype[Symbol.hasInstance];\n Object.defineProperty(Writable, Symbol.hasInstance, {\n value: function value(object) {\n if (realHasInstance.call(this, object)) return true;\n if (this !== Writable) return false;\n return object && object._writableState instanceof WritableState;\n }\n });\n} else {\n realHasInstance = function realHasInstance(object) {\n return object instanceof this;\n };\n}\nfunction Writable(options) {\n Duplex = Duplex || require('./_stream_duplex');\n\n // Writable ctor is applied to Duplexes, too.\n // `realHasInstance` is necessary because using plain `instanceof`\n // would return false, as no `_writableState` property is attached.\n\n // Trying to use the custom `instanceof` for Writable here will also break the\n // Node.js LazyTransform implementation, which has a non-trivial getter for\n // `_writableState` that would lead to infinite recursion.\n\n // Checking for a Stream.Duplex instance is faster here instead of inside\n // the WritableState constructor, at least with V8 6.5\n var isDuplex = this instanceof Duplex;\n if (!isDuplex && !realHasInstance.call(Writable, this)) return new Writable(options);\n this._writableState = new WritableState(options, this, isDuplex);\n\n // legacy.\n this.writable = true;\n if (options) {\n if (typeof options.write === 'function') this._write = options.write;\n if (typeof options.writev === 'function') this._writev = options.writev;\n if (typeof options.destroy === 'function') this._destroy = options.destroy;\n if (typeof options.final === 'function') this._final = options.final;\n }\n Stream.call(this);\n}\n\n// Otherwise people can pipe Writable streams, which is just wrong.\nWritable.prototype.pipe = function () {\n errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE());\n};\nfunction writeAfterEnd(stream, cb) {\n var er = new ERR_STREAM_WRITE_AFTER_END();\n // TODO: defer error events consistently everywhere, not just the cb\n errorOrDestroy(stream, er);\n process.nextTick(cb, er);\n}\n\n// Checks that a user-supplied chunk is valid, especially for the particular\n// mode the stream is in. Currently this means that `null` is never accepted\n// and undefined/non-string values are only allowed in object mode.\nfunction validChunk(stream, state, chunk, cb) {\n var er;\n if (chunk === null) {\n er = new ERR_STREAM_NULL_VALUES();\n } else if (typeof chunk !== 'string' && !state.objectMode) {\n er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer'], chunk);\n }\n if (er) {\n errorOrDestroy(stream, er);\n process.nextTick(cb, er);\n return false;\n }\n return true;\n}\nWritable.prototype.write = function (chunk, encoding, cb) {\n var state = this._writableState;\n var ret = false;\n var isBuf = !state.objectMode && _isUint8Array(chunk);\n if (isBuf && !Buffer.isBuffer(chunk)) {\n chunk = _uint8ArrayToBuffer(chunk);\n }\n if (typeof encoding === 'function') {\n cb = encoding;\n encoding = null;\n }\n if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;\n if (typeof cb !== 'function') cb = nop;\n if (state.ending) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {\n state.pendingcb++;\n ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);\n }\n return ret;\n};\nWritable.prototype.cork = function () {\n this._writableState.corked++;\n};\nWritable.prototype.uncork = function () {\n var state = this._writableState;\n if (state.corked) {\n state.corked--;\n if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);\n }\n};\nWritable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {\n // node::ParseEncoding() requires lower case.\n if (typeof encoding === 'string') encoding = encoding.toLowerCase();\n if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new ERR_UNKNOWN_ENCODING(encoding);\n this._writableState.defaultEncoding = encoding;\n return this;\n};\nObject.defineProperty(Writable.prototype, 'writableBuffer', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._writableState && this._writableState.getBuffer();\n }\n});\nfunction decodeChunk(state, chunk, encoding) {\n if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {\n chunk = Buffer.from(chunk, encoding);\n }\n return chunk;\n}\nObject.defineProperty(Writable.prototype, 'writableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._writableState.highWaterMark;\n }\n});\n\n// if we're already writing something, then just put this\n// in the queue, and wait our turn. Otherwise, call _write\n// If we return false, then we need a drain event, so set that flag.\nfunction writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {\n if (!isBuf) {\n var newChunk = decodeChunk(state, chunk, encoding);\n if (chunk !== newChunk) {\n isBuf = true;\n encoding = 'buffer';\n chunk = newChunk;\n }\n }\n var len = state.objectMode ? 1 : chunk.length;\n state.length += len;\n var ret = state.length < state.highWaterMark;\n // we must ensure that previous needDrain will not be reset to false.\n if (!ret) state.needDrain = true;\n if (state.writing || state.corked) {\n var last = state.lastBufferedRequest;\n state.lastBufferedRequest = {\n chunk: chunk,\n encoding: encoding,\n isBuf: isBuf,\n callback: cb,\n next: null\n };\n if (last) {\n last.next = state.lastBufferedRequest;\n } else {\n state.bufferedRequest = state.lastBufferedRequest;\n }\n state.bufferedRequestCount += 1;\n } else {\n doWrite(stream, state, false, len, chunk, encoding, cb);\n }\n return ret;\n}\nfunction doWrite(stream, state, writev, len, chunk, encoding, cb) {\n state.writelen = len;\n state.writecb = cb;\n state.writing = true;\n state.sync = true;\n if (state.destroyed) state.onwrite(new ERR_STREAM_DESTROYED('write'));else if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);\n state.sync = false;\n}\nfunction onwriteError(stream, state, sync, er, cb) {\n --state.pendingcb;\n if (sync) {\n // defer the callback if we are being called synchronously\n // to avoid piling up things on the stack\n process.nextTick(cb, er);\n // this can emit finish, and it will always happen\n // after error\n process.nextTick(finishMaybe, stream, state);\n stream._writableState.errorEmitted = true;\n errorOrDestroy(stream, er);\n } else {\n // the caller expect this to happen before if\n // it is async\n cb(er);\n stream._writableState.errorEmitted = true;\n errorOrDestroy(stream, er);\n // this can emit finish, but finish must\n // always follow error\n finishMaybe(stream, state);\n }\n}\nfunction onwriteStateUpdate(state) {\n state.writing = false;\n state.writecb = null;\n state.length -= state.writelen;\n state.writelen = 0;\n}\nfunction onwrite(stream, er) {\n var state = stream._writableState;\n var sync = state.sync;\n var cb = state.writecb;\n if (typeof cb !== 'function') throw new ERR_MULTIPLE_CALLBACK();\n onwriteStateUpdate(state);\n if (er) onwriteError(stream, state, sync, er, cb);else {\n // Check if we're actually ready to finish, but don't emit yet\n var finished = needFinish(state) || stream.destroyed;\n if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {\n clearBuffer(stream, state);\n }\n if (sync) {\n process.nextTick(afterWrite, stream, state, finished, cb);\n } else {\n afterWrite(stream, state, finished, cb);\n }\n }\n}\nfunction afterWrite(stream, state, finished, cb) {\n if (!finished) onwriteDrain(stream, state);\n state.pendingcb--;\n cb();\n finishMaybe(stream, state);\n}\n\n// Must force callback to be called on nextTick, so that we don't\n// emit 'drain' before the write() consumer gets the 'false' return\n// value, and has a chance to attach a 'drain' listener.\nfunction onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n}\n\n// if there's something in the buffer waiting, then process it\nfunction clearBuffer(stream, state) {\n state.bufferProcessing = true;\n var entry = state.bufferedRequest;\n if (stream._writev && entry && entry.next) {\n // Fast case, write everything using _writev()\n var l = state.bufferedRequestCount;\n var buffer = new Array(l);\n var holder = state.corkedRequestsFree;\n holder.entry = entry;\n var count = 0;\n var allBuffers = true;\n while (entry) {\n buffer[count] = entry;\n if (!entry.isBuf) allBuffers = false;\n entry = entry.next;\n count += 1;\n }\n buffer.allBuffers = allBuffers;\n doWrite(stream, state, true, state.length, buffer, '', holder.finish);\n\n // doWrite is almost always async, defer these to save a bit of time\n // as the hot path ends with doWrite\n state.pendingcb++;\n state.lastBufferedRequest = null;\n if (holder.next) {\n state.corkedRequestsFree = holder.next;\n holder.next = null;\n } else {\n state.corkedRequestsFree = new CorkedRequest(state);\n }\n state.bufferedRequestCount = 0;\n } else {\n // Slow case, write chunks one-by-one\n while (entry) {\n var chunk = entry.chunk;\n var encoding = entry.encoding;\n var cb = entry.callback;\n var len = state.objectMode ? 1 : chunk.length;\n doWrite(stream, state, false, len, chunk, encoding, cb);\n entry = entry.next;\n state.bufferedRequestCount--;\n // if we didn't call the onwrite immediately, then\n // it means that we need to wait until it does.\n // also, that means that the chunk and cb are currently\n // being processed, so move the buffer counter past them.\n if (state.writing) {\n break;\n }\n }\n if (entry === null) state.lastBufferedRequest = null;\n }\n state.bufferedRequest = entry;\n state.bufferProcessing = false;\n}\nWritable.prototype._write = function (chunk, encoding, cb) {\n cb(new ERR_METHOD_NOT_IMPLEMENTED('_write()'));\n};\nWritable.prototype._writev = null;\nWritable.prototype.end = function (chunk, encoding, cb) {\n var state = this._writableState;\n if (typeof chunk === 'function') {\n cb = chunk;\n chunk = null;\n encoding = null;\n } else if (typeof encoding === 'function') {\n cb = encoding;\n encoding = null;\n }\n if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);\n\n // .end() fully uncorks\n if (state.corked) {\n state.corked = 1;\n this.uncork();\n }\n\n // ignore unnecessary end() calls.\n if (!state.ending) endWritable(this, state, cb);\n return this;\n};\nObject.defineProperty(Writable.prototype, 'writableLength', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._writableState.length;\n }\n});\nfunction needFinish(state) {\n return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;\n}\nfunction callFinal(stream, state) {\n stream._final(function (err) {\n state.pendingcb--;\n if (err) {\n errorOrDestroy(stream, err);\n }\n state.prefinished = true;\n stream.emit('prefinish');\n finishMaybe(stream, state);\n });\n}\nfunction prefinish(stream, state) {\n if (!state.prefinished && !state.finalCalled) {\n if (typeof stream._final === 'function' && !state.destroyed) {\n state.pendingcb++;\n state.finalCalled = true;\n process.nextTick(callFinal, stream, state);\n } else {\n state.prefinished = true;\n stream.emit('prefinish');\n }\n }\n}\nfunction finishMaybe(stream, state) {\n var need = needFinish(state);\n if (need) {\n prefinish(stream, state);\n if (state.pendingcb === 0) {\n state.finished = true;\n stream.emit('finish');\n if (state.autoDestroy) {\n // In case of duplex streams we need a way to detect\n // if the readable side is ready for autoDestroy as well\n var rState = stream._readableState;\n if (!rState || rState.autoDestroy && rState.endEmitted) {\n stream.destroy();\n }\n }\n }\n }\n return need;\n}\nfunction endWritable(stream, state, cb) {\n state.ending = true;\n finishMaybe(stream, state);\n if (cb) {\n if (state.finished) process.nextTick(cb);else stream.once('finish', cb);\n }\n state.ended = true;\n stream.writable = false;\n}\nfunction onCorkedFinish(corkReq, state, err) {\n var entry = corkReq.entry;\n corkReq.entry = null;\n while (entry) {\n var cb = entry.callback;\n state.pendingcb--;\n cb(err);\n entry = entry.next;\n }\n\n // reuse the free corkReq.\n state.corkedRequestsFree.next = corkReq;\n}\nObject.defineProperty(Writable.prototype, 'destroyed', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n if (this._writableState === undefined) {\n return false;\n }\n return this._writableState.destroyed;\n },\n set: function set(value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (!this._writableState) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._writableState.destroyed = value;\n }\n});\nWritable.prototype.destroy = destroyImpl.destroy;\nWritable.prototype._undestroy = destroyImpl.undestroy;\nWritable.prototype._destroy = function (err, cb) {\n cb(err);\n};","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a duplex stream is just a stream that is both readable and writable.\n// Since JS doesn't have multiple prototypal inheritance, this class\n// prototypally inherits from Readable, and then parasitically from\n// Writable.\n\n'use strict';\n\n/**/\nvar objectKeys = Object.keys || function (obj) {\n var keys = [];\n for (var key in obj) keys.push(key);\n return keys;\n};\n/**/\n\nmodule.exports = Duplex;\nvar Readable = require('./_stream_readable');\nvar Writable = require('./_stream_writable');\nrequire('inherits')(Duplex, Readable);\n{\n // Allow the keys array to be GC'ed.\n var keys = objectKeys(Writable.prototype);\n for (var v = 0; v < keys.length; v++) {\n var method = keys[v];\n if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];\n }\n}\nfunction Duplex(options) {\n if (!(this instanceof Duplex)) return new Duplex(options);\n Readable.call(this, options);\n Writable.call(this, options);\n this.allowHalfOpen = true;\n if (options) {\n if (options.readable === false) this.readable = false;\n if (options.writable === false) this.writable = false;\n if (options.allowHalfOpen === false) {\n this.allowHalfOpen = false;\n this.once('end', onend);\n }\n }\n}\nObject.defineProperty(Duplex.prototype, 'writableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._writableState.highWaterMark;\n }\n});\nObject.defineProperty(Duplex.prototype, 'writableBuffer', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._writableState && this._writableState.getBuffer();\n }\n});\nObject.defineProperty(Duplex.prototype, 'writableLength', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._writableState.length;\n }\n});\n\n// the no-half-open enforcer\nfunction onend() {\n // If the writable side ended, then we're ok.\n if (this._writableState.ended) return;\n\n // no more data can be written.\n // But allow more writes to happen in this tick.\n process.nextTick(onEndNT, this);\n}\nfunction onEndNT(self) {\n self.end();\n}\nObject.defineProperty(Duplex.prototype, 'destroyed', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n if (this._readableState === undefined || this._writableState === undefined) {\n return false;\n }\n return this._readableState.destroyed && this._writableState.destroyed;\n },\n set: function set(value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (this._readableState === undefined || this._writableState === undefined) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._readableState.destroyed = value;\n this._writableState.destroyed = value;\n }\n});","// Ported from https://github.com/mafintosh/end-of-stream with\n// permission from the author, Mathias Buus (@mafintosh).\n\n'use strict';\n\nvar ERR_STREAM_PREMATURE_CLOSE = require('../../../errors').codes.ERR_STREAM_PREMATURE_CLOSE;\nfunction once(callback) {\n var called = false;\n return function () {\n if (called) return;\n called = true;\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n callback.apply(this, args);\n };\n}\nfunction noop() {}\nfunction isRequest(stream) {\n return stream.setHeader && typeof stream.abort === 'function';\n}\nfunction eos(stream, opts, callback) {\n if (typeof opts === 'function') return eos(stream, null, opts);\n if (!opts) opts = {};\n callback = once(callback || noop);\n var readable = opts.readable || opts.readable !== false && stream.readable;\n var writable = opts.writable || opts.writable !== false && stream.writable;\n var onlegacyfinish = function onlegacyfinish() {\n if (!stream.writable) onfinish();\n };\n var writableEnded = stream._writableState && stream._writableState.finished;\n var onfinish = function onfinish() {\n writable = false;\n writableEnded = true;\n if (!readable) callback.call(stream);\n };\n var readableEnded = stream._readableState && stream._readableState.endEmitted;\n var onend = function onend() {\n readable = false;\n readableEnded = true;\n if (!writable) callback.call(stream);\n };\n var onerror = function onerror(err) {\n callback.call(stream, err);\n };\n var onclose = function onclose() {\n var err;\n if (readable && !readableEnded) {\n if (!stream._readableState || !stream._readableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE();\n return callback.call(stream, err);\n }\n if (writable && !writableEnded) {\n if (!stream._writableState || !stream._writableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE();\n return callback.call(stream, err);\n }\n };\n var onrequest = function onrequest() {\n stream.req.on('finish', onfinish);\n };\n if (isRequest(stream)) {\n stream.on('complete', onfinish);\n stream.on('abort', onclose);\n if (stream.req) onrequest();else stream.on('request', onrequest);\n } else if (writable && !stream._writableState) {\n // legacy streams\n stream.on('end', onlegacyfinish);\n stream.on('close', onlegacyfinish);\n }\n stream.on('end', onend);\n stream.on('finish', onfinish);\n if (opts.error !== false) stream.on('error', onerror);\n stream.on('close', onclose);\n return function () {\n stream.removeListener('complete', onfinish);\n stream.removeListener('abort', onclose);\n stream.removeListener('request', onrequest);\n if (stream.req) stream.req.removeListener('finish', onfinish);\n stream.removeListener('end', onlegacyfinish);\n stream.removeListener('close', onlegacyfinish);\n stream.removeListener('finish', onfinish);\n stream.removeListener('end', onend);\n stream.removeListener('error', onerror);\n stream.removeListener('close', onclose);\n };\n}\nmodule.exports = eos;","'use strict';\n\nvar _Object$setPrototypeO;\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return typeof key === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (typeof input !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (typeof res !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nvar finished = require('./end-of-stream');\nvar kLastResolve = Symbol('lastResolve');\nvar kLastReject = Symbol('lastReject');\nvar kError = Symbol('error');\nvar kEnded = Symbol('ended');\nvar kLastPromise = Symbol('lastPromise');\nvar kHandlePromise = Symbol('handlePromise');\nvar kStream = Symbol('stream');\nfunction createIterResult(value, done) {\n return {\n value: value,\n done: done\n };\n}\nfunction readAndResolve(iter) {\n var resolve = iter[kLastResolve];\n if (resolve !== null) {\n var data = iter[kStream].read();\n // we defer if data is null\n // we can be expecting either 'end' or\n // 'error'\n if (data !== null) {\n iter[kLastPromise] = null;\n iter[kLastResolve] = null;\n iter[kLastReject] = null;\n resolve(createIterResult(data, false));\n }\n }\n}\nfunction onReadable(iter) {\n // we wait for the next tick, because it might\n // emit an error with process.nextTick\n process.nextTick(readAndResolve, iter);\n}\nfunction wrapForNext(lastPromise, iter) {\n return function (resolve, reject) {\n lastPromise.then(function () {\n if (iter[kEnded]) {\n resolve(createIterResult(undefined, true));\n return;\n }\n iter[kHandlePromise](resolve, reject);\n }, reject);\n };\n}\nvar AsyncIteratorPrototype = Object.getPrototypeOf(function () {});\nvar ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = {\n get stream() {\n return this[kStream];\n },\n next: function next() {\n var _this = this;\n // if we have detected an error in the meanwhile\n // reject straight away\n var error = this[kError];\n if (error !== null) {\n return Promise.reject(error);\n }\n if (this[kEnded]) {\n return Promise.resolve(createIterResult(undefined, true));\n }\n if (this[kStream].destroyed) {\n // We need to defer via nextTick because if .destroy(err) is\n // called, the error will be emitted via nextTick, and\n // we cannot guarantee that there is no error lingering around\n // waiting to be emitted.\n return new Promise(function (resolve, reject) {\n process.nextTick(function () {\n if (_this[kError]) {\n reject(_this[kError]);\n } else {\n resolve(createIterResult(undefined, true));\n }\n });\n });\n }\n\n // if we have multiple next() calls\n // we will wait for the previous Promise to finish\n // this logic is optimized to support for await loops,\n // where next() is only called once at a time\n var lastPromise = this[kLastPromise];\n var promise;\n if (lastPromise) {\n promise = new Promise(wrapForNext(lastPromise, this));\n } else {\n // fast path needed to support multiple this.push()\n // without triggering the next() queue\n var data = this[kStream].read();\n if (data !== null) {\n return Promise.resolve(createIterResult(data, false));\n }\n promise = new Promise(this[kHandlePromise]);\n }\n this[kLastPromise] = promise;\n return promise;\n }\n}, _defineProperty(_Object$setPrototypeO, Symbol.asyncIterator, function () {\n return this;\n}), _defineProperty(_Object$setPrototypeO, \"return\", function _return() {\n var _this2 = this;\n // destroy(err, cb) is a private API\n // we can guarantee we have that here, because we control the\n // Readable class this is attached to\n return new Promise(function (resolve, reject) {\n _this2[kStream].destroy(null, function (err) {\n if (err) {\n reject(err);\n return;\n }\n resolve(createIterResult(undefined, true));\n });\n });\n}), _Object$setPrototypeO), AsyncIteratorPrototype);\nvar createReadableStreamAsyncIterator = function createReadableStreamAsyncIterator(stream) {\n var _Object$create;\n var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty(_Object$create, kStream, {\n value: stream,\n writable: true\n }), _defineProperty(_Object$create, kLastResolve, {\n value: null,\n writable: true\n }), _defineProperty(_Object$create, kLastReject, {\n value: null,\n writable: true\n }), _defineProperty(_Object$create, kError, {\n value: null,\n writable: true\n }), _defineProperty(_Object$create, kEnded, {\n value: stream._readableState.endEmitted,\n writable: true\n }), _defineProperty(_Object$create, kHandlePromise, {\n value: function value(resolve, reject) {\n var data = iterator[kStream].read();\n if (data) {\n iterator[kLastPromise] = null;\n iterator[kLastResolve] = null;\n iterator[kLastReject] = null;\n resolve(createIterResult(data, false));\n } else {\n iterator[kLastResolve] = resolve;\n iterator[kLastReject] = reject;\n }\n },\n writable: true\n }), _Object$create));\n iterator[kLastPromise] = null;\n finished(stream, function (err) {\n if (err && err.code !== 'ERR_STREAM_PREMATURE_CLOSE') {\n var reject = iterator[kLastReject];\n // reject if we are waiting for data in the Promise\n // returned by next() and store the error\n if (reject !== null) {\n iterator[kLastPromise] = null;\n iterator[kLastResolve] = null;\n iterator[kLastReject] = null;\n reject(err);\n }\n iterator[kError] = err;\n return;\n }\n var resolve = iterator[kLastResolve];\n if (resolve !== null) {\n iterator[kLastPromise] = null;\n iterator[kLastResolve] = null;\n iterator[kLastReject] = null;\n resolve(createIterResult(undefined, true));\n }\n iterator[kEnded] = true;\n });\n stream.on('readable', onReadable.bind(null, iterator));\n return iterator;\n};\nmodule.exports = createReadableStreamAsyncIterator;","module.exports = function () {\n throw new Error('Readable.from is not available in the browser')\n};\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nmodule.exports = Readable;\n\n/**/\nvar Duplex;\n/**/\n\nReadable.ReadableState = ReadableState;\n\n/**/\nvar EE = require('events').EventEmitter;\nvar EElistenerCount = function EElistenerCount(emitter, type) {\n return emitter.listeners(type).length;\n};\n/**/\n\n/**/\nvar Stream = require('./internal/streams/stream');\n/**/\n\nvar Buffer = require('buffer').Buffer;\nvar OurUint8Array = (typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}).Uint8Array || function () {};\nfunction _uint8ArrayToBuffer(chunk) {\n return Buffer.from(chunk);\n}\nfunction _isUint8Array(obj) {\n return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\n}\n\n/**/\nvar debugUtil = require('util');\nvar debug;\nif (debugUtil && debugUtil.debuglog) {\n debug = debugUtil.debuglog('stream');\n} else {\n debug = function debug() {};\n}\n/**/\n\nvar BufferList = require('./internal/streams/buffer_list');\nvar destroyImpl = require('./internal/streams/destroy');\nvar _require = require('./internal/streams/state'),\n getHighWaterMark = _require.getHighWaterMark;\nvar _require$codes = require('../errors').codes,\n ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE,\n ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF,\n ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,\n ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;\n\n// Lazy loaded to improve the startup performance.\nvar StringDecoder;\nvar createReadableStreamAsyncIterator;\nvar from;\nrequire('inherits')(Readable, Stream);\nvar errorOrDestroy = destroyImpl.errorOrDestroy;\nvar kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];\nfunction prependListener(emitter, event, fn) {\n // Sadly this is not cacheable as some libraries bundle their own\n // event emitter implementation with them.\n if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn);\n\n // This is a hack to make sure that our error handler is attached before any\n // userland ones. NEVER DO THIS. This is here only because this code needs\n // to continue to work with older versions of Node.js that do not include\n // the prependListener() method. The goal is to eventually remove this hack.\n if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];\n}\nfunction ReadableState(options, stream, isDuplex) {\n Duplex = Duplex || require('./_stream_duplex');\n options = options || {};\n\n // Duplex streams are both readable and writable, but share\n // the same options object.\n // However, some cases require setting options to different\n // values for the readable and the writable sides of the duplex stream.\n // These options can be provided separately as readableXXX and writableXXX.\n if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex;\n\n // object stream flag. Used to make read(n) ignore n and to\n // make all the buffer merging and length checks go away\n this.objectMode = !!options.objectMode;\n if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;\n\n // the point at which it stops calling _read() to fill the buffer\n // Note: 0 is a valid value, means \"don't call _read preemptively ever\"\n this.highWaterMark = getHighWaterMark(this, options, 'readableHighWaterMark', isDuplex);\n\n // A linked list is used to store data chunks instead of an array because the\n // linked list can remove elements from the beginning faster than\n // array.shift()\n this.buffer = new BufferList();\n this.length = 0;\n this.pipes = null;\n this.pipesCount = 0;\n this.flowing = null;\n this.ended = false;\n this.endEmitted = false;\n this.reading = false;\n\n // a flag to be able to tell if the event 'readable'/'data' is emitted\n // immediately, or on a later tick. We set this to true at first, because\n // any actions that shouldn't happen until \"later\" should generally also\n // not happen before the first read call.\n this.sync = true;\n\n // whenever we return null, then we set a flag to say\n // that we're awaiting a 'readable' event emission.\n this.needReadable = false;\n this.emittedReadable = false;\n this.readableListening = false;\n this.resumeScheduled = false;\n this.paused = true;\n\n // Should close be emitted on destroy. Defaults to true.\n this.emitClose = options.emitClose !== false;\n\n // Should .destroy() be called after 'end' (and potentially 'finish')\n this.autoDestroy = !!options.autoDestroy;\n\n // has it been destroyed\n this.destroyed = false;\n\n // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n this.defaultEncoding = options.defaultEncoding || 'utf8';\n\n // the number of writers that are awaiting a drain event in .pipe()s\n this.awaitDrain = 0;\n\n // if true, a maybeReadMore has been scheduled\n this.readingMore = false;\n this.decoder = null;\n this.encoding = null;\n if (options.encoding) {\n if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;\n this.decoder = new StringDecoder(options.encoding);\n this.encoding = options.encoding;\n }\n}\nfunction Readable(options) {\n Duplex = Duplex || require('./_stream_duplex');\n if (!(this instanceof Readable)) return new Readable(options);\n\n // Checking for a Stream.Duplex instance is faster here instead of inside\n // the ReadableState constructor, at least with V8 6.5\n var isDuplex = this instanceof Duplex;\n this._readableState = new ReadableState(options, this, isDuplex);\n\n // legacy\n this.readable = true;\n if (options) {\n if (typeof options.read === 'function') this._read = options.read;\n if (typeof options.destroy === 'function') this._destroy = options.destroy;\n }\n Stream.call(this);\n}\nObject.defineProperty(Readable.prototype, 'destroyed', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n if (this._readableState === undefined) {\n return false;\n }\n return this._readableState.destroyed;\n },\n set: function set(value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (!this._readableState) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._readableState.destroyed = value;\n }\n});\nReadable.prototype.destroy = destroyImpl.destroy;\nReadable.prototype._undestroy = destroyImpl.undestroy;\nReadable.prototype._destroy = function (err, cb) {\n cb(err);\n};\n\n// Manually shove something into the read() buffer.\n// This returns true if the highWaterMark has not been hit yet,\n// similar to how Writable.write() returns true if you should\n// write() some more.\nReadable.prototype.push = function (chunk, encoding) {\n var state = this._readableState;\n var skipChunkCheck;\n if (!state.objectMode) {\n if (typeof chunk === 'string') {\n encoding = encoding || state.defaultEncoding;\n if (encoding !== state.encoding) {\n chunk = Buffer.from(chunk, encoding);\n encoding = '';\n }\n skipChunkCheck = true;\n }\n } else {\n skipChunkCheck = true;\n }\n return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);\n};\n\n// Unshift should *always* be something directly out of read()\nReadable.prototype.unshift = function (chunk) {\n return readableAddChunk(this, chunk, null, true, false);\n};\nfunction readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {\n debug('readableAddChunk', chunk);\n var state = stream._readableState;\n if (chunk === null) {\n state.reading = false;\n onEofChunk(stream, state);\n } else {\n var er;\n if (!skipChunkCheck) er = chunkInvalid(state, chunk);\n if (er) {\n errorOrDestroy(stream, er);\n } else if (state.objectMode || chunk && chunk.length > 0) {\n if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {\n chunk = _uint8ArrayToBuffer(chunk);\n }\n if (addToFront) {\n if (state.endEmitted) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT());else addChunk(stream, state, chunk, true);\n } else if (state.ended) {\n errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF());\n } else if (state.destroyed) {\n return false;\n } else {\n state.reading = false;\n if (state.decoder && !encoding) {\n chunk = state.decoder.write(chunk);\n if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);\n } else {\n addChunk(stream, state, chunk, false);\n }\n }\n } else if (!addToFront) {\n state.reading = false;\n maybeReadMore(stream, state);\n }\n }\n\n // We can push more data if we are below the highWaterMark.\n // Also, if we have no data yet, we can stand some more bytes.\n // This is to work around cases where hwm=0, such as the repl.\n return !state.ended && (state.length < state.highWaterMark || state.length === 0);\n}\nfunction addChunk(stream, state, chunk, addToFront) {\n if (state.flowing && state.length === 0 && !state.sync) {\n state.awaitDrain = 0;\n stream.emit('data', chunk);\n } else {\n // update the buffer info.\n state.length += state.objectMode ? 1 : chunk.length;\n if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);\n if (state.needReadable) emitReadable(stream);\n }\n maybeReadMore(stream, state);\n}\nfunction chunkInvalid(state, chunk) {\n var er;\n if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer', 'Uint8Array'], chunk);\n }\n return er;\n}\nReadable.prototype.isPaused = function () {\n return this._readableState.flowing === false;\n};\n\n// backwards compatibility.\nReadable.prototype.setEncoding = function (enc) {\n if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;\n var decoder = new StringDecoder(enc);\n this._readableState.decoder = decoder;\n // If setEncoding(null), decoder.encoding equals utf8\n this._readableState.encoding = this._readableState.decoder.encoding;\n\n // Iterate over current buffer to convert already stored Buffers:\n var p = this._readableState.buffer.head;\n var content = '';\n while (p !== null) {\n content += decoder.write(p.data);\n p = p.next;\n }\n this._readableState.buffer.clear();\n if (content !== '') this._readableState.buffer.push(content);\n this._readableState.length = content.length;\n return this;\n};\n\n// Don't raise the hwm > 1GB\nvar MAX_HWM = 0x40000000;\nfunction computeNewHighWaterMark(n) {\n if (n >= MAX_HWM) {\n // TODO(ronag): Throw ERR_VALUE_OUT_OF_RANGE.\n n = MAX_HWM;\n } else {\n // Get the next highest power of 2 to prevent increasing hwm excessively in\n // tiny amounts\n n--;\n n |= n >>> 1;\n n |= n >>> 2;\n n |= n >>> 4;\n n |= n >>> 8;\n n |= n >>> 16;\n n++;\n }\n return n;\n}\n\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n }\n // If we're asking for more than the current hwm, then raise the hwm.\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n;\n // Don't have enough\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n return state.length;\n}\n\n// you can override either this method, or the async _read(n) below.\nReadable.prototype.read = function (n) {\n debug('read', n);\n n = parseInt(n, 10);\n var state = this._readableState;\n var nOrig = n;\n if (n !== 0) state.emittedReadable = false;\n\n // if we're doing read(0) to trigger a readable event, but we\n // already have a bunch of data in the buffer, then just trigger\n // the 'readable' event and move on.\n if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) {\n debug('read: emitReadable', state.length, state.ended);\n if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);\n return null;\n }\n n = howMuchToRead(n, state);\n\n // if we've ended, and we're now clear, then finish it up.\n if (n === 0 && state.ended) {\n if (state.length === 0) endReadable(this);\n return null;\n }\n\n // All the actual chunk generation logic needs to be\n // *below* the call to _read. The reason is that in certain\n // synthetic stream cases, such as passthrough streams, _read\n // may be a completely synchronous operation which may change\n // the state of the read buffer, providing enough data when\n // before there was *not* enough.\n //\n // So, the steps are:\n // 1. Figure out what the state of things will be after we do\n // a read from the buffer.\n //\n // 2. If that resulting state will trigger a _read, then call _read.\n // Note that this may be asynchronous, or synchronous. Yes, it is\n // deeply ugly to write APIs this way, but that still doesn't mean\n // that the Readable class should behave improperly, as streams are\n // designed to be sync/async agnostic.\n // Take note if the _read call is sync or async (ie, if the read call\n // has returned yet), so that we know whether or not it's safe to emit\n // 'readable' etc.\n //\n // 3. Actually pull the requested chunks out of the buffer and return.\n\n // if we need a readable event, then we need to do some reading.\n var doRead = state.needReadable;\n debug('need readable', doRead);\n\n // if we currently have less than the highWaterMark, then also read some\n if (state.length === 0 || state.length - n < state.highWaterMark) {\n doRead = true;\n debug('length less than watermark', doRead);\n }\n\n // however, if we've ended, then there's no point, and if we're already\n // reading, then it's unnecessary.\n if (state.ended || state.reading) {\n doRead = false;\n debug('reading or ended', doRead);\n } else if (doRead) {\n debug('do read');\n state.reading = true;\n state.sync = true;\n // if the length is currently zero, then we *need* a readable event.\n if (state.length === 0) state.needReadable = true;\n // call internal read method\n this._read(state.highWaterMark);\n state.sync = false;\n // If _read pushed data synchronously, then `reading` will be false,\n // and we need to re-evaluate how much data we can return to the user.\n if (!state.reading) n = howMuchToRead(nOrig, state);\n }\n var ret;\n if (n > 0) ret = fromList(n, state);else ret = null;\n if (ret === null) {\n state.needReadable = state.length <= state.highWaterMark;\n n = 0;\n } else {\n state.length -= n;\n state.awaitDrain = 0;\n }\n if (state.length === 0) {\n // If we have nothing in the buffer, then we want to know\n // as soon as we *do* get something into the buffer.\n if (!state.ended) state.needReadable = true;\n\n // If we tried to read() past the EOF, then emit end on the next tick.\n if (nOrig !== n && state.ended) endReadable(this);\n }\n if (ret !== null) this.emit('data', ret);\n return ret;\n};\nfunction onEofChunk(stream, state) {\n debug('onEofChunk');\n if (state.ended) return;\n if (state.decoder) {\n var chunk = state.decoder.end();\n if (chunk && chunk.length) {\n state.buffer.push(chunk);\n state.length += state.objectMode ? 1 : chunk.length;\n }\n }\n state.ended = true;\n if (state.sync) {\n // if we are sync, wait until next tick to emit the data.\n // Otherwise we risk emitting data in the flow()\n // the readable code triggers during a read() call\n emitReadable(stream);\n } else {\n // emit 'readable' now to make sure it gets picked up.\n state.needReadable = false;\n if (!state.emittedReadable) {\n state.emittedReadable = true;\n emitReadable_(stream);\n }\n }\n}\n\n// Don't emit readable right away in sync mode, because this can trigger\n// another read() call => stack overflow. This way, it might trigger\n// a nextTick recursion warning, but that's not so bad.\nfunction emitReadable(stream) {\n var state = stream._readableState;\n debug('emitReadable', state.needReadable, state.emittedReadable);\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n process.nextTick(emitReadable_, stream);\n }\n}\nfunction emitReadable_(stream) {\n var state = stream._readableState;\n debug('emitReadable_', state.destroyed, state.length, state.ended);\n if (!state.destroyed && (state.length || state.ended)) {\n stream.emit('readable');\n state.emittedReadable = false;\n }\n\n // The stream needs another readable event if\n // 1. It is not flowing, as the flow mechanism will take\n // care of it.\n // 2. It is not ended.\n // 3. It is below the highWaterMark, so we can schedule\n // another readable later.\n state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark;\n flow(stream);\n}\n\n// at this point, the user has presumably seen the 'readable' event,\n// and called read() to consume some data. that may have triggered\n// in turn another _read(n) call, in which case reading = true if\n// it's in progress.\n// However, if we're not ended, or reading, and the length < hwm,\n// then go ahead and try to read some more preemptively.\nfunction maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n process.nextTick(maybeReadMore_, stream, state);\n }\n}\nfunction maybeReadMore_(stream, state) {\n // Attempt to read more data if we should.\n //\n // The conditions for reading more data are (one of):\n // - Not enough data buffered (state.length < state.highWaterMark). The loop\n // is responsible for filling the buffer with enough data if such data\n // is available. If highWaterMark is 0 and we are not in the flowing mode\n // we should _not_ attempt to buffer any extra data. We'll get more data\n // when the stream consumer calls read() instead.\n // - No data in the buffer, and the stream is in flowing mode. In this mode\n // the loop below is responsible for ensuring read() is called. Failing to\n // call read here would abort the flow and there's no other mechanism for\n // continuing the flow if the stream consumer has just subscribed to the\n // 'data' event.\n //\n // In addition to the above conditions to keep reading data, the following\n // conditions prevent the data from being read:\n // - The stream has ended (state.ended).\n // - There is already a pending 'read' operation (state.reading). This is a\n // case where the the stream has called the implementation defined _read()\n // method, but they are processing the call asynchronously and have _not_\n // called push() with new data. In this case we skip performing more\n // read()s. The execution ends in this method again after the _read() ends\n // up calling push() with more data.\n while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) {\n var len = state.length;\n debug('maybeReadMore read 0');\n stream.read(0);\n if (len === state.length)\n // didn't get any data, stop spinning.\n break;\n }\n state.readingMore = false;\n}\n\n// abstract method. to be overridden in specific implementation classes.\n// call cb(er, data) where data is <= n in length.\n// for virtual (non-string, non-buffer) streams, \"length\" is somewhat\n// arbitrary, and perhaps not very meaningful.\nReadable.prototype._read = function (n) {\n errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED('_read()'));\n};\nReadable.prototype.pipe = function (dest, pipeOpts) {\n var src = this;\n var state = this._readableState;\n switch (state.pipesCount) {\n case 0:\n state.pipes = dest;\n break;\n case 1:\n state.pipes = [state.pipes, dest];\n break;\n default:\n state.pipes.push(dest);\n break;\n }\n state.pipesCount += 1;\n debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);\n var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;\n var endFn = doEnd ? onend : unpipe;\n if (state.endEmitted) process.nextTick(endFn);else src.once('end', endFn);\n dest.on('unpipe', onunpipe);\n function onunpipe(readable, unpipeInfo) {\n debug('onunpipe');\n if (readable === src) {\n if (unpipeInfo && unpipeInfo.hasUnpiped === false) {\n unpipeInfo.hasUnpiped = true;\n cleanup();\n }\n }\n }\n function onend() {\n debug('onend');\n dest.end();\n }\n\n // when the dest drains, it reduces the awaitDrain counter\n // on the source. This would be more elegant with a .once()\n // handler in flow(), but adding and removing repeatedly is\n // too slow.\n var ondrain = pipeOnDrain(src);\n dest.on('drain', ondrain);\n var cleanedUp = false;\n function cleanup() {\n debug('cleanup');\n // cleanup event handlers once the pipe is broken\n dest.removeListener('close', onclose);\n dest.removeListener('finish', onfinish);\n dest.removeListener('drain', ondrain);\n dest.removeListener('error', onerror);\n dest.removeListener('unpipe', onunpipe);\n src.removeListener('end', onend);\n src.removeListener('end', unpipe);\n src.removeListener('data', ondata);\n cleanedUp = true;\n\n // if the reader is waiting for a drain event from this\n // specific writer, then it would cause it to never start\n // flowing again.\n // So, if this is awaiting a drain, then we just call it now.\n // If we don't know, then assume that we are waiting for one.\n if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();\n }\n src.on('data', ondata);\n function ondata(chunk) {\n debug('ondata');\n var ret = dest.write(chunk);\n debug('dest.write', ret);\n if (ret === false) {\n // If the user unpiped during `dest.write()`, it is possible\n // to get stuck in a permanently paused state if that write\n // also returned false.\n // => Check whether `dest` is still a piping destination.\n if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {\n debug('false write response, pause', state.awaitDrain);\n state.awaitDrain++;\n }\n src.pause();\n }\n }\n\n // if the dest has an error, then stop piping into it.\n // however, don't suppress the throwing behavior for this.\n function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n }\n\n // Make sure our error handler is attached before userland ones.\n prependListener(dest, 'error', onerror);\n\n // Both close and finish should trigger unpipe, but only once.\n function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }\n dest.once('close', onclose);\n function onfinish() {\n debug('onfinish');\n dest.removeListener('close', onclose);\n unpipe();\n }\n dest.once('finish', onfinish);\n function unpipe() {\n debug('unpipe');\n src.unpipe(dest);\n }\n\n // tell the dest that it's being piped to\n dest.emit('pipe', src);\n\n // start the flow if it hasn't been started already.\n if (!state.flowing) {\n debug('pipe resume');\n src.resume();\n }\n return dest;\n};\nfunction pipeOnDrain(src) {\n return function pipeOnDrainFunctionResult() {\n var state = src._readableState;\n debug('pipeOnDrain', state.awaitDrain);\n if (state.awaitDrain) state.awaitDrain--;\n if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {\n state.flowing = true;\n flow(src);\n }\n };\n}\nReadable.prototype.unpipe = function (dest) {\n var state = this._readableState;\n var unpipeInfo = {\n hasUnpiped: false\n };\n\n // if we're not piping anywhere, then do nothing.\n if (state.pipesCount === 0) return this;\n\n // just one destination. most common case.\n if (state.pipesCount === 1) {\n // passed in one, but it's not the right one.\n if (dest && dest !== state.pipes) return this;\n if (!dest) dest = state.pipes;\n\n // got a match.\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n if (dest) dest.emit('unpipe', this, unpipeInfo);\n return this;\n }\n\n // slow case. multiple pipe destinations.\n\n if (!dest) {\n // remove all.\n var dests = state.pipes;\n var len = state.pipesCount;\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n for (var i = 0; i < len; i++) dests[i].emit('unpipe', this, {\n hasUnpiped: false\n });\n return this;\n }\n\n // try to find the right one.\n var index = indexOf(state.pipes, dest);\n if (index === -1) return this;\n state.pipes.splice(index, 1);\n state.pipesCount -= 1;\n if (state.pipesCount === 1) state.pipes = state.pipes[0];\n dest.emit('unpipe', this, unpipeInfo);\n return this;\n};\n\n// set up data events if they are asked for\n// Ensure readable listeners eventually get something\nReadable.prototype.on = function (ev, fn) {\n var res = Stream.prototype.on.call(this, ev, fn);\n var state = this._readableState;\n if (ev === 'data') {\n // update readableListening so that resume() may be a no-op\n // a few lines down. This is needed to support once('readable').\n state.readableListening = this.listenerCount('readable') > 0;\n\n // Try start flowing on next tick if stream isn't explicitly paused\n if (state.flowing !== false) this.resume();\n } else if (ev === 'readable') {\n if (!state.endEmitted && !state.readableListening) {\n state.readableListening = state.needReadable = true;\n state.flowing = false;\n state.emittedReadable = false;\n debug('on readable', state.length, state.reading);\n if (state.length) {\n emitReadable(this);\n } else if (!state.reading) {\n process.nextTick(nReadingNextTick, this);\n }\n }\n }\n return res;\n};\nReadable.prototype.addListener = Readable.prototype.on;\nReadable.prototype.removeListener = function (ev, fn) {\n var res = Stream.prototype.removeListener.call(this, ev, fn);\n if (ev === 'readable') {\n // We need to check if there is someone still listening to\n // readable and reset the state. However this needs to happen\n // after readable has been emitted but before I/O (nextTick) to\n // support once('readable', fn) cycles. This means that calling\n // resume within the same tick will have no\n // effect.\n process.nextTick(updateReadableListening, this);\n }\n return res;\n};\nReadable.prototype.removeAllListeners = function (ev) {\n var res = Stream.prototype.removeAllListeners.apply(this, arguments);\n if (ev === 'readable' || ev === undefined) {\n // We need to check if there is someone still listening to\n // readable and reset the state. However this needs to happen\n // after readable has been emitted but before I/O (nextTick) to\n // support once('readable', fn) cycles. This means that calling\n // resume within the same tick will have no\n // effect.\n process.nextTick(updateReadableListening, this);\n }\n return res;\n};\nfunction updateReadableListening(self) {\n var state = self._readableState;\n state.readableListening = self.listenerCount('readable') > 0;\n if (state.resumeScheduled && !state.paused) {\n // flowing needs to be set to true now, otherwise\n // the upcoming resume will not flow.\n state.flowing = true;\n\n // crude way to check if we should resume\n } else if (self.listenerCount('data') > 0) {\n self.resume();\n }\n}\nfunction nReadingNextTick(self) {\n debug('readable nexttick read 0');\n self.read(0);\n}\n\n// pause() and resume() are remnants of the legacy readable stream API\n// If the user uses them, then switch into old mode.\nReadable.prototype.resume = function () {\n var state = this._readableState;\n if (!state.flowing) {\n debug('resume');\n // we flow only if there is no one listening\n // for readable, but we still have to call\n // resume()\n state.flowing = !state.readableListening;\n resume(this, state);\n }\n state.paused = false;\n return this;\n};\nfunction resume(stream, state) {\n if (!state.resumeScheduled) {\n state.resumeScheduled = true;\n process.nextTick(resume_, stream, state);\n }\n}\nfunction resume_(stream, state) {\n debug('resume', state.reading);\n if (!state.reading) {\n stream.read(0);\n }\n state.resumeScheduled = false;\n stream.emit('resume');\n flow(stream);\n if (state.flowing && !state.reading) stream.read(0);\n}\nReadable.prototype.pause = function () {\n debug('call pause flowing=%j', this._readableState.flowing);\n if (this._readableState.flowing !== false) {\n debug('pause');\n this._readableState.flowing = false;\n this.emit('pause');\n }\n this._readableState.paused = true;\n return this;\n};\nfunction flow(stream) {\n var state = stream._readableState;\n debug('flow', state.flowing);\n while (state.flowing && stream.read() !== null);\n}\n\n// wrap an old-style stream as the async data source.\n// This is *not* part of the readable stream interface.\n// It is an ugly unfortunate mess of history.\nReadable.prototype.wrap = function (stream) {\n var _this = this;\n var state = this._readableState;\n var paused = false;\n stream.on('end', function () {\n debug('wrapped end');\n if (state.decoder && !state.ended) {\n var chunk = state.decoder.end();\n if (chunk && chunk.length) _this.push(chunk);\n }\n _this.push(null);\n });\n stream.on('data', function (chunk) {\n debug('wrapped data');\n if (state.decoder) chunk = state.decoder.write(chunk);\n\n // don't skip over falsy values in objectMode\n if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;\n var ret = _this.push(chunk);\n if (!ret) {\n paused = true;\n stream.pause();\n }\n });\n\n // proxy all the other methods.\n // important when wrapping filters and duplexes.\n for (var i in stream) {\n if (this[i] === undefined && typeof stream[i] === 'function') {\n this[i] = function methodWrap(method) {\n return function methodWrapReturnFunction() {\n return stream[method].apply(stream, arguments);\n };\n }(i);\n }\n }\n\n // proxy certain important events.\n for (var n = 0; n < kProxyEvents.length; n++) {\n stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));\n }\n\n // when we try to consume some more bytes, simply unpause the\n // underlying stream.\n this._read = function (n) {\n debug('wrapped _read', n);\n if (paused) {\n paused = false;\n stream.resume();\n }\n };\n return this;\n};\nif (typeof Symbol === 'function') {\n Readable.prototype[Symbol.asyncIterator] = function () {\n if (createReadableStreamAsyncIterator === undefined) {\n createReadableStreamAsyncIterator = require('./internal/streams/async_iterator');\n }\n return createReadableStreamAsyncIterator(this);\n };\n}\nObject.defineProperty(Readable.prototype, 'readableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._readableState.highWaterMark;\n }\n});\nObject.defineProperty(Readable.prototype, 'readableBuffer', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._readableState && this._readableState.buffer;\n }\n});\nObject.defineProperty(Readable.prototype, 'readableFlowing', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._readableState.flowing;\n },\n set: function set(state) {\n if (this._readableState) {\n this._readableState.flowing = state;\n }\n }\n});\n\n// exposed for testing purposes only.\nReadable._fromList = fromList;\nObject.defineProperty(Readable.prototype, 'readableLength', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._readableState.length;\n }\n});\n\n// Pluck off n bytes from an array of buffers.\n// Length is the combined lengths of all the buffers in the list.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction fromList(n, state) {\n // nothing buffered\n if (state.length === 0) return null;\n var ret;\n if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {\n // read it all, truncate the list\n if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.first();else ret = state.buffer.concat(state.length);\n state.buffer.clear();\n } else {\n // read part of list\n ret = state.buffer.consume(n, state.decoder);\n }\n return ret;\n}\nfunction endReadable(stream) {\n var state = stream._readableState;\n debug('endReadable', state.endEmitted);\n if (!state.endEmitted) {\n state.ended = true;\n process.nextTick(endReadableNT, state, stream);\n }\n}\nfunction endReadableNT(state, stream) {\n debug('endReadableNT', state.endEmitted, state.length);\n\n // Check that we didn't get one last unshift.\n if (!state.endEmitted && state.length === 0) {\n state.endEmitted = true;\n stream.readable = false;\n stream.emit('end');\n if (state.autoDestroy) {\n // In case of duplex streams we need a way to detect\n // if the writable side is ready for autoDestroy as well\n var wState = stream._writableState;\n if (!wState || wState.autoDestroy && wState.finished) {\n stream.destroy();\n }\n }\n }\n}\nif (typeof Symbol === 'function') {\n Readable.from = function (iterable, opts) {\n if (from === undefined) {\n from = require('./internal/streams/from');\n }\n return from(Readable, iterable, opts);\n };\n}\nfunction indexOf(xs, x) {\n for (var i = 0, l = xs.length; i < l; i++) {\n if (xs[i] === x) return i;\n }\n return -1;\n}","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a transform stream is a readable/writable stream where you do\n// something with the data. Sometimes it's called a \"filter\",\n// but that's not a great name for it, since that implies a thing where\n// some bits pass through, and others are simply ignored. (That would\n// be a valid example of a transform, of course.)\n//\n// While the output is causally related to the input, it's not a\n// necessarily symmetric or synchronous transformation. For example,\n// a zlib stream might take multiple plain-text writes(), and then\n// emit a single compressed chunk some time in the future.\n//\n// Here's how this works:\n//\n// The Transform stream has all the aspects of the readable and writable\n// stream classes. When you write(chunk), that calls _write(chunk,cb)\n// internally, and returns false if there's a lot of pending writes\n// buffered up. When you call read(), that calls _read(n) until\n// there's enough pending readable data buffered up.\n//\n// In a transform stream, the written data is placed in a buffer. When\n// _read(n) is called, it transforms the queued up data, calling the\n// buffered _write cb's as it consumes chunks. If consuming a single\n// written chunk would result in multiple output chunks, then the first\n// outputted bit calls the readcb, and subsequent chunks just go into\n// the read buffer, and will cause it to emit 'readable' if necessary.\n//\n// This way, back-pressure is actually determined by the reading side,\n// since _read has to be called to start processing a new chunk. However,\n// a pathological inflate type of transform can cause excessive buffering\n// here. For example, imagine a stream where every byte of input is\n// interpreted as an integer from 0-255, and then results in that many\n// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in\n// 1kb of data being output. In this case, you could write a very small\n// amount of input, and end up with a very large amount of output. In\n// such a pathological inflating mechanism, there'd be no way to tell\n// the system to stop doing the transform. A single 4MB write could\n// cause the system to run out of memory.\n//\n// However, even in such a pathological case, only a single written chunk\n// would be consumed, and then the rest would wait (un-transformed) until\n// the results of the previous transformed chunk were consumed.\n\n'use strict';\n\nmodule.exports = Transform;\nvar _require$codes = require('../errors').codes,\n ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,\n ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK,\n ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING,\n ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0;\nvar Duplex = require('./_stream_duplex');\nrequire('inherits')(Transform, Duplex);\nfunction afterTransform(er, data) {\n var ts = this._transformState;\n ts.transforming = false;\n var cb = ts.writecb;\n if (cb === null) {\n return this.emit('error', new ERR_MULTIPLE_CALLBACK());\n }\n ts.writechunk = null;\n ts.writecb = null;\n if (data != null)\n // single equals check for both `null` and `undefined`\n this.push(data);\n cb(er);\n var rs = this._readableState;\n rs.reading = false;\n if (rs.needReadable || rs.length < rs.highWaterMark) {\n this._read(rs.highWaterMark);\n }\n}\nfunction Transform(options) {\n if (!(this instanceof Transform)) return new Transform(options);\n Duplex.call(this, options);\n this._transformState = {\n afterTransform: afterTransform.bind(this),\n needTransform: false,\n transforming: false,\n writecb: null,\n writechunk: null,\n writeencoding: null\n };\n\n // start out asking for a readable event once data is transformed.\n this._readableState.needReadable = true;\n\n // we have implemented the _read method, and done the other things\n // that Readable wants before the first _read call, so unset the\n // sync guard flag.\n this._readableState.sync = false;\n if (options) {\n if (typeof options.transform === 'function') this._transform = options.transform;\n if (typeof options.flush === 'function') this._flush = options.flush;\n }\n\n // When the writable side finishes, then flush out anything remaining.\n this.on('prefinish', prefinish);\n}\nfunction prefinish() {\n var _this = this;\n if (typeof this._flush === 'function' && !this._readableState.destroyed) {\n this._flush(function (er, data) {\n done(_this, er, data);\n });\n } else {\n done(this, null, null);\n }\n}\nTransform.prototype.push = function (chunk, encoding) {\n this._transformState.needTransform = false;\n return Duplex.prototype.push.call(this, chunk, encoding);\n};\n\n// This is the part where you do stuff!\n// override this function in implementation classes.\n// 'chunk' is an input chunk.\n//\n// Call `push(newChunk)` to pass along transformed output\n// to the readable side. You may call 'push' zero or more times.\n//\n// Call `cb(err)` when you are done with this chunk. If you pass\n// an error, then that'll put the hurt on the whole operation. If you\n// never call cb(), then you'll never get another chunk.\nTransform.prototype._transform = function (chunk, encoding, cb) {\n cb(new ERR_METHOD_NOT_IMPLEMENTED('_transform()'));\n};\nTransform.prototype._write = function (chunk, encoding, cb) {\n var ts = this._transformState;\n ts.writecb = cb;\n ts.writechunk = chunk;\n ts.writeencoding = encoding;\n if (!ts.transforming) {\n var rs = this._readableState;\n if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);\n }\n};\n\n// Doesn't matter what the args are here.\n// _transform does all the work.\n// That we got here means that the readable side wants more data.\nTransform.prototype._read = function (n) {\n var ts = this._transformState;\n if (ts.writechunk !== null && !ts.transforming) {\n ts.transforming = true;\n this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);\n } else {\n // mark that we need a transform, so that any data that comes in\n // will get processed, now that we've asked for it.\n ts.needTransform = true;\n }\n};\nTransform.prototype._destroy = function (err, cb) {\n Duplex.prototype._destroy.call(this, err, function (err2) {\n cb(err2);\n });\n};\nfunction done(stream, er, data) {\n if (er) return stream.emit('error', er);\n if (data != null)\n // single equals check for both `null` and `undefined`\n stream.push(data);\n\n // TODO(BridgeAR): Write a test for these two error cases\n // if there's nothing in the write buffer, then that means\n // that nothing more will ever be provided\n if (stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0();\n if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING();\n return stream.push(null);\n}","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a passthrough stream.\n// basically just the most minimal sort of Transform stream.\n// Every written chunk gets output as-is.\n\n'use strict';\n\nmodule.exports = PassThrough;\nvar Transform = require('./_stream_transform');\nrequire('inherits')(PassThrough, Transform);\nfunction PassThrough(options) {\n if (!(this instanceof PassThrough)) return new PassThrough(options);\n Transform.call(this, options);\n}\nPassThrough.prototype._transform = function (chunk, encoding, cb) {\n cb(null, chunk);\n};","// Ported from https://github.com/mafintosh/pump with\n// permission from the author, Mathias Buus (@mafintosh).\n\n'use strict';\n\nvar eos;\nfunction once(callback) {\n var called = false;\n return function () {\n if (called) return;\n called = true;\n callback.apply(void 0, arguments);\n };\n}\nvar _require$codes = require('../../../errors').codes,\n ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS,\n ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED;\nfunction noop(err) {\n // Rethrow the error if it exists to avoid swallowing it\n if (err) throw err;\n}\nfunction isRequest(stream) {\n return stream.setHeader && typeof stream.abort === 'function';\n}\nfunction destroyer(stream, reading, writing, callback) {\n callback = once(callback);\n var closed = false;\n stream.on('close', function () {\n closed = true;\n });\n if (eos === undefined) eos = require('./end-of-stream');\n eos(stream, {\n readable: reading,\n writable: writing\n }, function (err) {\n if (err) return callback(err);\n closed = true;\n callback();\n });\n var destroyed = false;\n return function (err) {\n if (closed) return;\n if (destroyed) return;\n destroyed = true;\n\n // request.destroy just do .end - .abort is what we want\n if (isRequest(stream)) return stream.abort();\n if (typeof stream.destroy === 'function') return stream.destroy();\n callback(err || new ERR_STREAM_DESTROYED('pipe'));\n };\n}\nfunction call(fn) {\n fn();\n}\nfunction pipe(from, to) {\n return from.pipe(to);\n}\nfunction popCallback(streams) {\n if (!streams.length) return noop;\n if (typeof streams[streams.length - 1] !== 'function') return noop;\n return streams.pop();\n}\nfunction pipeline() {\n for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) {\n streams[_key] = arguments[_key];\n }\n var callback = popCallback(streams);\n if (Array.isArray(streams[0])) streams = streams[0];\n if (streams.length < 2) {\n throw new ERR_MISSING_ARGS('streams');\n }\n var error;\n var destroys = streams.map(function (stream, i) {\n var reading = i < streams.length - 1;\n var writing = i > 0;\n return destroyer(stream, reading, writing, function (err) {\n if (!error) error = err;\n if (err) destroys.forEach(call);\n if (reading) return;\n destroys.forEach(call);\n callback(error);\n });\n });\n return streams.reduce(pipe);\n}\nmodule.exports = pipeline;","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nmodule.exports = Stream;\n\nvar EE = require('events').EventEmitter;\nvar inherits = require('inherits');\n\ninherits(Stream, EE);\nStream.Readable = require('readable-stream/lib/_stream_readable.js');\nStream.Writable = require('readable-stream/lib/_stream_writable.js');\nStream.Duplex = require('readable-stream/lib/_stream_duplex.js');\nStream.Transform = require('readable-stream/lib/_stream_transform.js');\nStream.PassThrough = require('readable-stream/lib/_stream_passthrough.js');\nStream.finished = require('readable-stream/lib/internal/streams/end-of-stream.js')\nStream.pipeline = require('readable-stream/lib/internal/streams/pipeline.js')\n\n// Backwards-compat with node 0.4.x\nStream.Stream = Stream;\n\n\n\n// old-style streams. Note that the pipe method (the only relevant\n// part of this class) is overridden in the Readable class.\n\nfunction Stream() {\n EE.call(this);\n}\n\nStream.prototype.pipe = function(dest, options) {\n var source = this;\n\n function ondata(chunk) {\n if (dest.writable) {\n if (false === dest.write(chunk) && source.pause) {\n source.pause();\n }\n }\n }\n\n source.on('data', ondata);\n\n function ondrain() {\n if (source.readable && source.resume) {\n source.resume();\n }\n }\n\n dest.on('drain', ondrain);\n\n // If the 'end' option is not supplied, dest.end() will be called when\n // source gets the 'end' or 'close' events. Only dest.end() once.\n if (!dest._isStdio && (!options || options.end !== false)) {\n source.on('end', onend);\n source.on('close', onclose);\n }\n\n var didOnEnd = false;\n function onend() {\n if (didOnEnd) return;\n didOnEnd = true;\n\n dest.end();\n }\n\n\n function onclose() {\n if (didOnEnd) return;\n didOnEnd = true;\n\n if (typeof dest.destroy === 'function') dest.destroy();\n }\n\n // don't leave dangling pipes when there are errors.\n function onerror(er) {\n cleanup();\n if (EE.listenerCount(this, 'error') === 0) {\n throw er; // Unhandled stream error in pipe.\n }\n }\n\n source.on('error', onerror);\n dest.on('error', onerror);\n\n // remove all the event listeners that were added.\n function cleanup() {\n source.removeListener('data', ondata);\n dest.removeListener('drain', ondrain);\n\n source.removeListener('end', onend);\n source.removeListener('close', onclose);\n\n source.removeListener('error', onerror);\n dest.removeListener('error', onerror);\n\n source.removeListener('end', cleanup);\n source.removeListener('close', cleanup);\n\n dest.removeListener('close', cleanup);\n }\n\n source.on('end', cleanup);\n source.on('close', cleanup);\n\n dest.on('close', cleanup);\n\n dest.emit('pipe', source);\n\n // Allow for unix-like usage: A.pipe(B).pipe(C)\n return dest;\n};\n",";(function (sax) { // wrapper for non-node envs\n sax.parser = function (strict, opt) { return new SAXParser(strict, opt) }\n sax.SAXParser = SAXParser\n sax.SAXStream = SAXStream\n sax.createStream = createStream\n\n // When we pass the MAX_BUFFER_LENGTH position, start checking for buffer overruns.\n // When we check, schedule the next check for MAX_BUFFER_LENGTH - (max(buffer lengths)),\n // since that's the earliest that a buffer overrun could occur. This way, checks are\n // as rare as required, but as often as necessary to ensure never crossing this bound.\n // Furthermore, buffers are only tested at most once per write(), so passing a very\n // large string into write() might have undesirable effects, but this is manageable by\n // the caller, so it is assumed to be safe. Thus, a call to write() may, in the extreme\n // edge case, result in creating at most one complete copy of the string passed in.\n // Set to Infinity to have unlimited buffers.\n sax.MAX_BUFFER_LENGTH = 64 * 1024\n\n var buffers = [\n 'comment', 'sgmlDecl', 'textNode', 'tagName', 'doctype',\n 'procInstName', 'procInstBody', 'entity', 'attribName',\n 'attribValue', 'cdata', 'script'\n ]\n\n sax.EVENTS = [\n 'text',\n 'processinginstruction',\n 'sgmldeclaration',\n 'doctype',\n 'comment',\n 'opentagstart',\n 'attribute',\n 'opentag',\n 'closetag',\n 'opencdata',\n 'cdata',\n 'closecdata',\n 'error',\n 'end',\n 'ready',\n 'script',\n 'opennamespace',\n 'closenamespace'\n ]\n\n function SAXParser (strict, opt) {\n if (!(this instanceof SAXParser)) {\n return new SAXParser(strict, opt)\n }\n\n var parser = this\n clearBuffers(parser)\n parser.q = parser.c = ''\n parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH\n parser.opt = opt || {}\n parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags\n parser.looseCase = parser.opt.lowercase ? 'toLowerCase' : 'toUpperCase'\n parser.tags = []\n parser.closed = parser.closedRoot = parser.sawRoot = false\n parser.tag = parser.error = null\n parser.strict = !!strict\n parser.noscript = !!(strict || parser.opt.noscript)\n parser.state = S.BEGIN\n parser.strictEntities = parser.opt.strictEntities\n parser.ENTITIES = parser.strictEntities ? Object.create(sax.XML_ENTITIES) : Object.create(sax.ENTITIES)\n parser.attribList = []\n\n // namespaces form a prototype chain.\n // it always points at the current tag,\n // which protos to its parent tag.\n if (parser.opt.xmlns) {\n parser.ns = Object.create(rootNS)\n }\n\n // disallow unquoted attribute values if not otherwise configured\n // and strict mode is true\n if (parser.opt.unquotedAttributeValues === undefined) {\n parser.opt.unquotedAttributeValues = !strict;\n }\n\n // mostly just for error reporting\n parser.trackPosition = parser.opt.position !== false\n if (parser.trackPosition) {\n parser.position = parser.line = parser.column = 0\n }\n emit(parser, 'onready')\n }\n\n if (!Object.create) {\n Object.create = function (o) {\n function F () {}\n F.prototype = o\n var newf = new F()\n return newf\n }\n }\n\n if (!Object.keys) {\n Object.keys = function (o) {\n var a = []\n for (var i in o) if (o.hasOwnProperty(i)) a.push(i)\n return a\n }\n }\n\n function checkBufferLength (parser) {\n var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10)\n var maxActual = 0\n for (var i = 0, l = buffers.length; i < l; i++) {\n var len = parser[buffers[i]].length\n if (len > maxAllowed) {\n // Text/cdata nodes can get big, and since they're buffered,\n // we can get here under normal conditions.\n // Avoid issues by emitting the text node now,\n // so at least it won't get any bigger.\n switch (buffers[i]) {\n case 'textNode':\n closeText(parser)\n break\n\n case 'cdata':\n emitNode(parser, 'oncdata', parser.cdata)\n parser.cdata = ''\n break\n\n case 'script':\n emitNode(parser, 'onscript', parser.script)\n parser.script = ''\n break\n\n default:\n error(parser, 'Max buffer length exceeded: ' + buffers[i])\n }\n }\n maxActual = Math.max(maxActual, len)\n }\n // schedule the next check for the earliest possible buffer overrun.\n var m = sax.MAX_BUFFER_LENGTH - maxActual\n parser.bufferCheckPosition = m + parser.position\n }\n\n function clearBuffers (parser) {\n for (var i = 0, l = buffers.length; i < l; i++) {\n parser[buffers[i]] = ''\n }\n }\n\n function flushBuffers (parser) {\n closeText(parser)\n if (parser.cdata !== '') {\n emitNode(parser, 'oncdata', parser.cdata)\n parser.cdata = ''\n }\n if (parser.script !== '') {\n emitNode(parser, 'onscript', parser.script)\n parser.script = ''\n }\n }\n\n SAXParser.prototype = {\n end: function () { end(this) },\n write: write,\n resume: function () { this.error = null; return this },\n close: function () { return this.write(null) },\n flush: function () { flushBuffers(this) }\n }\n\n var Stream\n try {\n Stream = require('stream').Stream\n } catch (ex) {\n Stream = function () {}\n }\n if (!Stream) Stream = function () {}\n\n var streamWraps = sax.EVENTS.filter(function (ev) {\n return ev !== 'error' && ev !== 'end'\n })\n\n function createStream (strict, opt) {\n return new SAXStream(strict, opt)\n }\n\n function SAXStream (strict, opt) {\n if (!(this instanceof SAXStream)) {\n return new SAXStream(strict, opt)\n }\n\n Stream.apply(this)\n\n this._parser = new SAXParser(strict, opt)\n this.writable = true\n this.readable = true\n\n var me = this\n\n this._parser.onend = function () {\n me.emit('end')\n }\n\n this._parser.onerror = function (er) {\n me.emit('error', er)\n\n // if didn't throw, then means error was handled.\n // go ahead and clear error, so we can write again.\n me._parser.error = null\n }\n\n this._decoder = null\n\n streamWraps.forEach(function (ev) {\n Object.defineProperty(me, 'on' + ev, {\n get: function () {\n return me._parser['on' + ev]\n },\n set: function (h) {\n if (!h) {\n me.removeAllListeners(ev)\n me._parser['on' + ev] = h\n return h\n }\n me.on(ev, h)\n },\n enumerable: true,\n configurable: false\n })\n })\n }\n\n SAXStream.prototype = Object.create(Stream.prototype, {\n constructor: {\n value: SAXStream\n }\n })\n\n SAXStream.prototype.write = function (data) {\n if (typeof Buffer === 'function' &&\n typeof Buffer.isBuffer === 'function' &&\n Buffer.isBuffer(data)) {\n if (!this._decoder) {\n var SD = require('string_decoder').StringDecoder\n this._decoder = new SD('utf8')\n }\n data = this._decoder.write(data)\n }\n\n this._parser.write(data.toString())\n this.emit('data', data)\n return true\n }\n\n SAXStream.prototype.end = function (chunk) {\n if (chunk && chunk.length) {\n this.write(chunk)\n }\n this._parser.end()\n return true\n }\n\n SAXStream.prototype.on = function (ev, handler) {\n var me = this\n if (!me._parser['on' + ev] && streamWraps.indexOf(ev) !== -1) {\n me._parser['on' + ev] = function () {\n var args = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments)\n args.splice(0, 0, ev)\n me.emit.apply(me, args)\n }\n }\n\n return Stream.prototype.on.call(me, ev, handler)\n }\n\n // this really needs to be replaced with character classes.\n // XML allows all manner of ridiculous numbers and digits.\n var CDATA = '[CDATA['\n var DOCTYPE = 'DOCTYPE'\n var XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace'\n var XMLNS_NAMESPACE = 'http://www.w3.org/2000/xmlns/'\n var rootNS = { xml: XML_NAMESPACE, xmlns: XMLNS_NAMESPACE }\n\n // http://www.w3.org/TR/REC-xml/#NT-NameStartChar\n // This implementation works on strings, a single character at a time\n // as such, it cannot ever support astral-plane characters (10000-EFFFF)\n // without a significant breaking change to either this parser, or the\n // JavaScript language. Implementation of an emoji-capable xml parser\n // is left as an exercise for the reader.\n var nameStart = /[:_A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]/\n\n var nameBody = /[:_A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\u00B7\\u0300-\\u036F\\u203F-\\u2040.\\d-]/\n\n var entityStart = /[#:_A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]/\n var entityBody = /[#:_A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\u00B7\\u0300-\\u036F\\u203F-\\u2040.\\d-]/\n\n function isWhitespace (c) {\n return c === ' ' || c === '\\n' || c === '\\r' || c === '\\t'\n }\n\n function isQuote (c) {\n return c === '\"' || c === '\\''\n }\n\n function isAttribEnd (c) {\n return c === '>' || isWhitespace(c)\n }\n\n function isMatch (regex, c) {\n return regex.test(c)\n }\n\n function notMatch (regex, c) {\n return !isMatch(regex, c)\n }\n\n var S = 0\n sax.STATE = {\n BEGIN: S++, // leading byte order mark or whitespace\n BEGIN_WHITESPACE: S++, // leading whitespace\n TEXT: S++, // general stuff\n TEXT_ENTITY: S++, // & and such.\n OPEN_WAKA: S++, // <\n SGML_DECL: S++, // \n SCRIPT: S++, //