1
0

files_sharing-init-public.js 47 KB

12
  1. (()=>{"use strict";var t,e,n,i={51528:(t,e,n)=>{var i=n(35810),r=n(32981),s=n(53334),o=n(50352),a=n(85471);const l='<svg xmlns="http://www.w3.org/2000/svg" id="mdi-link" viewBox="0 0 24 24"><path d="M3.9,12C3.9,10.29 5.29,8.9 7,8.9H11V7H7A5,5 0 0,0 2,12A5,5 0 0,0 7,17H11V15.1H7C5.29,15.1 3.9,13.71 3.9,12M8,13H16V11H8V13M17,7H13V8.9H17C18.71,8.9 20.1,10.29 20.1,12C20.1,13.71 18.71,15.1 17,15.1H13V17H17A5,5 0 0,0 22,12A5,5 0 0,0 17,7Z" /></svg>';var u=n(36117),d=n(43627);const c=(0,i.H4)();var h=n(35947);const f=(0,h.YK)().setApp("files").detectUser().build(),p=t=>(0,i.Al)(t),g=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/";t=(0,d.join)(i.lJ,t);const e=new AbortController,n=(0,i.VL)();return new u.CancelablePromise((async(i,r,s)=>{s((()=>e.abort()));try{const r=await c.getDirectoryContents(t,{details:!0,data:n,includeSelf:!0,signal:e.signal}),s=r.data[0],o=r.data.slice(1);if(s.filename!==t&&`${s.filename}/`!==t)throw f.debug(`Exepected "${t}" but got filename "${s.filename}" instead.`),new Error("Root node does not match requested path");i({folder:p(s),contents:o.map((t=>{try{return p(t)}catch(e){return f.error(`Invalid node detected '${t.basename}'`,{error:e}),null}})).filter(Boolean)})}catch(t){r(t)}}))},E=(0,h.YK)().setApp("files_sharing").detectUser().build();var m=n(63814),N=n(82490),b=n(40173);const w=(0,r.C)("files_sharing","view"),v=(0,r.C)("files_sharing","sharingToken");a.Ay.use(b.Ay);const x=b.Ay.prototype.push;b.Ay.prototype.push=function(t,e,n){return e||n?x.call(this,t,e,n):x.call(this,t).catch((t=>t))};const I=new b.Ay({mode:"history",base:(0,m.Jv)("/s"),linkActiveClass:"active",routes:[{path:"/",redirect:{name:"filelist",params:{view:w,token:v}}},{path:"/:token",name:"filelist",props:!0}],stringifyQuery(t){const e=N.A.stringify(t).replace(/%2F/gim,"/");return e?"?"+e:""}});(()=>{const t=(0,r.C)("files_sharing","filename");let e,l;const u=new i.Ss({id:"public-file-drop",name:(0,s.Tl)("files_sharing","File drop"),caption:(0,s.Tl)("files_sharing","Upload files to {foldername}",{foldername:t}),icon:o,order:1,emptyView:async i=>{if(void 0===e){const{default:t}=await Promise.all([n.e(4208),n.e(9087)]).then(n.bind(n,99087));e=a.Ay.extend(t)}l&&l.$destroy(),l=new e({propsData:{foldername:t}}),l.$mount(i)},getContents:async()=>({contents:[],folder:new i.vd({id:0,source:`${i.PY}${i.lJ}`,root:i.lJ,owner:null,permissions:i.aX.CREATE})})});(0,i.bh)().register(u)})(),(()=>{const t=new i.Ss({id:"public-share",name:(0,s.Tl)("files_sharing","Public share"),caption:(0,s.Tl)("files_sharing","Publicly shared files."),emptyTitle:(0,s.Tl)("files_sharing","No files"),emptyCaption:(0,s.Tl)("files_sharing","Files and folders shared with you will show up here"),icon:l,order:1,getContents:g});(0,i.bh)().register(t)})(),(()=>{const t=new i.Ss({id:"public-file-share",name:(0,s.Tl)("files_sharing","Public file share"),caption:(0,s.Tl)("files_sharing","Publicly shared file."),emptyTitle:(0,s.Tl)("files_sharing","No file"),emptyCaption:(0,s.Tl)("files_sharing","The file shared with you will show up here"),icon:l,order:1,getContents:()=>new u.CancelablePromise((async(t,e,n)=>{const r=new AbortController;n((()=>r.abort()));try{const e=await c.stat(i.lJ,{data:(0,i.VL)(),details:!0,signal:r.signal});t({contents:[(0,i.Al)(e.data)],folder:new i.vd({id:0,source:`${i.PY}${i.lJ}`,root:i.lJ,owner:null,permissions:i.aX.READ,attributes:{note:e.data.props?.note}})})}catch(t){E.error(t),e(t)}}))});(0,i.bh)().register(t)})();const y=(0,r.C)("files_sharing","view"),O=(0,i.bh)();O.setActive(O.views.find((t=>{let{id:e}=t;return e===y}))??null),window.OCP.Files=window.OCP.Files??{},window.OCP.Files.Router=new class{constructor(t){var e,n,i;e=this,i=void 0,(n=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(n="router"))in e?Object.defineProperty(e,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[n]=i,this.router=t}get name(){return this.router.currentRoute.name}get query(){return this.router.currentRoute.query||{}}get params(){return this.router.currentRoute.params||{}}get _router(){return this.router}goTo(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.router.push({path:t,replace:e})}goToRoute(t,e,n,i){return this.router.push({name:t,query:n,params:e,replace:i})}}(I);const T=(0,r.C)("files_sharing","fileId",null),A=(0,r.C)("files_sharing","sharingToken");null!==T&&window.OCP.Files.Router.goToRoute("filelist",{...window.OCP.Files.Router.params,token:A,fileid:String(T)},{...window.OCP.Files.Router.query,openfile:"true"})},50352:t=>{t.exports='<svg xmlns="http://www.w3.org/2000/svg" id="mdi-cloud-upload" viewBox="0 0 24 24"><path d="M11 20H6.5Q4.22 20 2.61 18.43 1 16.85 1 14.58 1 12.63 2.17 11.1 3.35 9.57 5.25 9.15 5.88 6.85 7.75 5.43 9.63 4 12 4 14.93 4 16.96 6.04 19 8.07 19 11 20.73 11.2 21.86 12.5 23 13.78 23 15.5 23 17.38 21.69 18.69 20.38 20 18.5 20H13V12.85L14.6 14.4L16 13L12 9L8 13L9.4 14.4L11 12.85Z" /></svg>'},35810:(t,e,n)=>{n.d(e,{Al:()=>i.r,E6:()=>p,H4:()=>i.c,KT:()=>f,PY:()=>i.b,Q$:()=>i.e,R3:()=>i.n,Ss:()=>Xt,VL:()=>i.l,a7:()=>u,aX:()=>i.P,bh:()=>v,di:()=>h,lJ:()=>i.d,m1:()=>ne,nF:()=>c,pt:()=>i.F,ur:()=>b,v7:()=>m,vd:()=>i.s});var i=n(29719),r=n(87485),s=n(43627),o=n(53334),a=n(380),l=n(65606),u=(t=>(t[t.UploadFromDevice=0]="UploadFromDevice",t[t.CreateNew=1]="CreateNew",t[t.Other=2]="Other",t))(u||{});class d{_entries=[];registerEntry(t){this.validateEntry(t),t.category=t.category??1,this._entries.push(t)}unregisterEntry(t){const e="string"==typeof t?this.getEntryIndex(t):this.getEntryIndex(t.id);-1!==e?this._entries.splice(e,1):i.o.warn("Entry not found, nothing removed",{entry:t,entries:this.getEntries()})}getEntries(t){return t?this._entries.filter((e=>"function"!=typeof e.enabled||e.enabled(t))):this._entries}getEntryIndex(t){return this._entries.findIndex((e=>e.id===t))}validateEntry(t){if(!t.id||!t.displayName||!t.iconSvgInline&&!t.iconClass||!t.handler)throw new Error("Invalid entry");if("string"!=typeof t.id||"string"!=typeof t.displayName)throw new Error("Invalid id or displayName property");if(t.iconClass&&"string"!=typeof t.iconClass||t.iconSvgInline&&"string"!=typeof t.iconSvgInline)throw new Error("Invalid icon provided");if(void 0!==t.enabled&&"function"!=typeof t.enabled)throw new Error("Invalid enabled property");if("function"!=typeof t.handler)throw new Error("Invalid handler property");if("order"in t&&"number"!=typeof t.order)throw new Error("Invalid order property");if(-1!==this.getEntryIndex(t.id))throw new Error("Duplicate entry")}}var c=(t=>(t.ReservedName="reserved name",t.Character="character",t.Extension="extension",t))(c||{});class h extends Error{constructor(t){super(`Invalid ${t.reason} '${t.segment}' in filename '${t.filename}'`,{cause:t})}get filename(){return this.cause.filename}get reason(){return this.cause.reason}get segment(){return this.cause.segment}}function f(t){const e=(0,r.F)().files,n=e.forbidden_filename_characters??window._oc_config?.forbidden_filenames_characters??["/","\\"];for(const e of n)if(t.includes(e))throw new h({segment:e,reason:"character",filename:t});if(t=t.toLocaleLowerCase(),(e.forbidden_filenames??[".htaccess"]).includes(t))throw new h({filename:t,segment:t,reason:"reserved name"});const i=t.indexOf(".",1),s=t.substring(0,-1===i?void 0:i);if((e.forbidden_filename_basenames??[]).includes(s))throw new h({filename:t,segment:s,reason:"reserved name"});const o=e.forbidden_filename_extensions??[".part",".filepart"];for(const e of o)if(t.length>e.length&&t.endsWith(e))throw new h({segment:e,reason:"extension",filename:t})}function p(t,e,n){const i={suffix:t=>`(${t})`,ignoreFileExtension:!1,...n};let r=t,o=1;for(;e.includes(r);){const e=i.ignoreFileExtension?"":(0,s.extname)(t);r=`${(0,s.basename)(t,e)} ${i.suffix(o++)}${e}`}return r}const g=["B","KB","MB","GB","TB","PB"],E=["B","KiB","MiB","GiB","TiB","PiB"];function m(t,e=!1,n=!1,i=!1){n=n&&!i,"string"==typeof t&&(t=Number(t));let r=t>0?Math.floor(Math.log(t)/Math.log(i?1e3:1024)):0;r=Math.min((n?E.length:g.length)-1,r);const s=n?E[r]:g[r];let a=(t/Math.pow(i?1e3:1024,r)).toFixed(1);return!0===e&&0===r?("0.0"!==a?"< 1 ":"0 ")+(n?E[1]:g[1]):(a=r<2?parseFloat(a).toFixed(0):parseFloat(a).toLocaleString((0,o.lO)()),a+" "+s)}function N(t){return t instanceof Date?t.toISOString():String(t)}function b(t,e={}){const n={sortingMode:"basename",sortingOrder:"asc",...e};return function(t,e,n){n=n??[];const i=(e=e??[t=>t]).map(((t,e)=>"asc"===(n[e]??"asc")?1:-1)),r=Intl.Collator([(0,o.Z0)(),(0,o.lO)()],{numeric:!0,usage:"sort"});return[...t].sort(((t,n)=>{for(const[s,o]of e.entries()){const e=r.compare(N(o(t)),N(o(n)));if(0!==e)return e*i[s]}return 0}))}(t,[...n.sortFavoritesFirst?[t=>1!==t.attributes?.favorite]:[],...n.sortFoldersFirst?[t=>"folder"!==t.type]:[],..."basename"!==n.sortingMode?[t=>t[n.sortingMode]]:[],t=>{return(e=t.displayname||t.attributes?.displayname||t.basename).lastIndexOf(".")>0?e.slice(0,e.lastIndexOf(".")):e;var e},t=>t.basename],[...n.sortFavoritesFirst?["asc"]:[],...n.sortFoldersFirst?["asc"]:[],..."mtime"===n.sortingMode?["asc"===n.sortingOrder?"desc":"asc"]:[],..."mtime"!==n.sortingMode&&"basename"!==n.sortingMode?[n.sortingOrder]:[],n.sortingOrder,n.sortingOrder])}class w extends a.m{_views=[];_currentView=null;register(t){if(this._views.find((e=>e.id===t.id)))throw new Error(`View id ${t.id} is already registered`);this._views.push(t),this.dispatchTypedEvent("update",new CustomEvent("update"))}remove(t){const e=this._views.findIndex((e=>e.id===t));-1!==e&&(this._views.splice(e,1),this.dispatchTypedEvent("update",new CustomEvent("update")))}setActive(t){this._currentView=t;const e=new CustomEvent("updateActive",{detail:t});this.dispatchTypedEvent("updateActive",e)}get active(){return this._currentView}get views(){return this._views}}const v=function(){return void 0===window._nc_navigation&&(window._nc_navigation=new w,i.o.debug("Navigation service initialized")),window._nc_navigation};class x{_column;constructor(t){I(t),this._column=t}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}}const I=function(t){if(!t.id||"string"!=typeof t.id)throw new Error("A column id is required");if(!t.title||"string"!=typeof t.title)throw new Error("A column title is required");if(!t.render||"function"!=typeof t.render)throw new Error("A render function is required");if(t.sort&&"function"!=typeof t.sort)throw new Error("Column sortFunction must be a function");if(t.summary&&"function"!=typeof t.summary)throw new Error("Column summary must be a function");return!0};var y={},O={};!function(t){const e=":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="["+e+"]["+e+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",i=new RegExp("^"+n+"$");t.isExist=function(t){return void 0!==t},t.isEmptyObject=function(t){return 0===Object.keys(t).length},t.merge=function(t,e,n){if(e){const i=Object.keys(e),r=i.length;for(let s=0;s<r;s++)t[i[s]]="strict"===n?[e[i[s]]]:e[i[s]]}},t.getValue=function(e){return t.isExist(e)?e:""},t.isName=function(t){return!(null==i.exec(t))},t.getAllMatches=function(t,e){const n=[];let i=e.exec(t);for(;i;){const r=[];r.startIndex=e.lastIndex-i[0].length;const s=i.length;for(let t=0;t<s;t++)r.push(i[t]);n.push(r),i=e.exec(t)}return n},t.nameRegexp=n}(O);const T=O,A={allowBooleanAttributes:!1,unpairedTags:[]};function R(t){return" "===t||"\t"===t||"\n"===t||"\r"===t}function L(t,e){const n=e;for(;e<t.length;e++)if("?"!=t[e]&&" "!=t[e]);else{const i=t.substr(n,e-n);if(e>5&&"xml"===i)return V("InvalidXml","XML declaration allowed only at the start of the document.",G(t,e));if("?"==t[e]&&">"==t[e+1]){e++;break}}return e}function C(t,e){if(t.length>e+5&&"-"===t[e+1]&&"-"===t[e+2]){for(e+=3;e<t.length;e++)if("-"===t[e]&&"-"===t[e+1]&&">"===t[e+2]){e+=2;break}}else if(t.length>e+8&&"D"===t[e+1]&&"O"===t[e+2]&&"C"===t[e+3]&&"T"===t[e+4]&&"Y"===t[e+5]&&"P"===t[e+6]&&"E"===t[e+7]){let n=1;for(e+=8;e<t.length;e++)if("<"===t[e])n++;else if(">"===t[e]&&(n--,0===n))break}else if(t.length>e+9&&"["===t[e+1]&&"C"===t[e+2]&&"D"===t[e+3]&&"A"===t[e+4]&&"T"===t[e+5]&&"A"===t[e+6]&&"["===t[e+7])for(e+=8;e<t.length;e++)if("]"===t[e]&&"]"===t[e+1]&&">"===t[e+2]){e+=2;break}return e}y.validate=function(t,e){e=Object.assign({},A,e);const n=[];let i=!1,r=!1;"\ufeff"===t[0]&&(t=t.substr(1));for(let o=0;o<t.length;o++)if("<"===t[o]&&"?"===t[o+1]){if(o+=2,o=L(t,o),o.err)return o}else{if("<"!==t[o]){if(R(t[o]))continue;return V("InvalidChar","char '"+t[o]+"' is not expected.",G(t,o))}{let a=o;if(o++,"!"===t[o]){o=C(t,o);continue}{let l=!1;"/"===t[o]&&(l=!0,o++);let u="";for(;o<t.length&&">"!==t[o]&&" "!==t[o]&&"\t"!==t[o]&&"\n"!==t[o]&&"\r"!==t[o];o++)u+=t[o];if(u=u.trim(),"/"===u[u.length-1]&&(u=u.substring(0,u.length-1),o--),s=u,!T.isName(s)){let e;return e=0===u.trim().length?"Invalid space after '<'.":"Tag '"+u+"' is an invalid name.",V("InvalidTag",e,G(t,o))}const d=_(t,o);if(!1===d)return V("InvalidAttr","Attributes for '"+u+"' have open quote.",G(t,o));let c=d.value;if(o=d.index,"/"===c[c.length-1]){const n=o-c.length;c=c.substring(0,c.length-1);const r=F(c,e);if(!0!==r)return V(r.err.code,r.err.msg,G(t,n+r.err.line));i=!0}else if(l){if(!d.tagClosed)return V("InvalidTag","Closing tag '"+u+"' doesn't have proper closing.",G(t,o));if(c.trim().length>0)return V("InvalidTag","Closing tag '"+u+"' can't have attributes or invalid starting.",G(t,a));if(0===n.length)return V("InvalidTag","Closing tag '"+u+"' has not been opened.",G(t,a));{const e=n.pop();if(u!==e.tagName){let n=G(t,e.tagStartPos);return V("InvalidTag","Expected closing tag '"+e.tagName+"' (opened in line "+n.line+", col "+n.col+") instead of closing tag '"+u+"'.",G(t,a))}0==n.length&&(r=!0)}}else{const s=F(c,e);if(!0!==s)return V(s.err.code,s.err.msg,G(t,o-c.length+s.err.line));if(!0===r)return V("InvalidXml","Multiple possible root nodes found.",G(t,o));-1!==e.unpairedTags.indexOf(u)||n.push({tagName:u,tagStartPos:a}),i=!0}for(o++;o<t.length;o++)if("<"===t[o]){if("!"===t[o+1]){o++,o=C(t,o);continue}if("?"!==t[o+1])break;if(o=L(t,++o),o.err)return o}else if("&"===t[o]){const e=D(t,o);if(-1==e)return V("InvalidChar","char '&' is not expected.",G(t,o));o=e}else if(!0===r&&!R(t[o]))return V("InvalidXml","Extra text at the end",G(t,o));"<"===t[o]&&o--}}}var s;return i?1==n.length?V("InvalidTag","Unclosed tag '"+n[0].tagName+"'.",G(t,n[0].tagStartPos)):!(n.length>0)||V("InvalidXml","Invalid '"+JSON.stringify(n.map((t=>t.tagName)),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):V("InvalidXml","Start tag expected.",1)};const $='"',P="'";function _(t,e){let n="",i="",r=!1;for(;e<t.length;e++){if(t[e]===$||t[e]===P)""===i?i=t[e]:i!==t[e]||(i="");else if(">"===t[e]&&""===i){r=!0;break}n+=t[e]}return""===i&&{value:n,index:e,tagClosed:r}}const S=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function F(t,e){const n=T.getAllMatches(t,S),i={};for(let t=0;t<n.length;t++){if(0===n[t][1].length)return V("InvalidAttr","Attribute '"+n[t][2]+"' has no space in starting.",j(n[t]));if(void 0!==n[t][3]&&void 0===n[t][4])return V("InvalidAttr","Attribute '"+n[t][2]+"' is without value.",j(n[t]));if(void 0===n[t][3]&&!e.allowBooleanAttributes)return V("InvalidAttr","boolean attribute '"+n[t][2]+"' is not allowed.",j(n[t]));const r=n[t][2];if(!M(r))return V("InvalidAttr","Attribute '"+r+"' is an invalid name.",j(n[t]));if(i.hasOwnProperty(r))return V("InvalidAttr","Attribute '"+r+"' is repeated.",j(n[t]));i[r]=1}return!0}function D(t,e){if(";"===t[++e])return-1;if("#"===t[e])return function(t,e){let n=/\d/;for("x"===t[e]&&(e++,n=/[\da-fA-F]/);e<t.length;e++){if(";"===t[e])return e;if(!t[e].match(n))break}return-1}(t,++e);let n=0;for(;e<t.length;e++,n++)if(!(t[e].match(/\w/)&&n<20)){if(";"===t[e])break;return-1}return e}function V(t,e,n){return{err:{code:t,msg:e,line:n.line||n,col:n.col}}}function M(t){return T.isName(t)}function G(t,e){const n=t.substring(0,e).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function j(t){return t.startIndex+t[1].length}var k={};const X={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,e,n){return t}};k.buildOptions=function(t){return Object.assign({},X,t)},k.defaultOptions=X;const U=O;function B(t,e){let n="";for(;e<t.length&&"'"!==t[e]&&'"'!==t[e];e++)n+=t[e];if(n=n.trim(),-1!==n.indexOf(" "))throw new Error("External entites are not supported");const i=t[e++];let r="";for(;e<t.length&&t[e]!==i;e++)r+=t[e];return[n,r,e]}function H(t,e){return"!"===t[e+1]&&"-"===t[e+2]&&"-"===t[e+3]}function q(t,e){return"!"===t[e+1]&&"E"===t[e+2]&&"N"===t[e+3]&&"T"===t[e+4]&&"I"===t[e+5]&&"T"===t[e+6]&&"Y"===t[e+7]}function Y(t,e){return"!"===t[e+1]&&"E"===t[e+2]&&"L"===t[e+3]&&"E"===t[e+4]&&"M"===t[e+5]&&"E"===t[e+6]&&"N"===t[e+7]&&"T"===t[e+8]}function K(t,e){return"!"===t[e+1]&&"A"===t[e+2]&&"T"===t[e+3]&&"T"===t[e+4]&&"L"===t[e+5]&&"I"===t[e+6]&&"S"===t[e+7]&&"T"===t[e+8]}function Z(t,e){return"!"===t[e+1]&&"N"===t[e+2]&&"O"===t[e+3]&&"T"===t[e+4]&&"A"===t[e+5]&&"T"===t[e+6]&&"I"===t[e+7]&&"O"===t[e+8]&&"N"===t[e+9]}function J(t){if(U.isName(t))return t;throw new Error(`Invalid entity name ${t}`)}const z=/^[-+]?0x[a-fA-F0-9]+$/,Q=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);const W={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};var tt=function(t){return"function"==typeof t?t:Array.isArray(t)?e=>{for(const n of t){if("string"==typeof n&&e===n)return!0;if(n instanceof RegExp&&n.test(e))return!0}}:()=>!1};const et=O,nt=class{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,e){"__proto__"===t&&(t="#__proto__"),this.child.push({[t]:e})}addChild(t){"__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child})}},it=function(t,e){const n={};if("O"!==t[e+3]||"C"!==t[e+4]||"T"!==t[e+5]||"Y"!==t[e+6]||"P"!==t[e+7]||"E"!==t[e+8])throw new Error("Invalid Tag instead of DOCTYPE");{e+=9;let i=1,r=!1,s=!1,o="";for(;e<t.length;e++)if("<"!==t[e]||s)if(">"===t[e]){if(s?"-"===t[e-1]&&"-"===t[e-2]&&(s=!1,i--):i--,0===i)break}else"["===t[e]?r=!0:o+=t[e];else{if(r&&q(t,e))e+=7,[entityName,val,e]=B(t,e+1),-1===val.indexOf("&")&&(n[J(entityName)]={regx:RegExp(`&${entityName};`,"g"),val});else if(r&&Y(t,e))e+=8;else if(r&&K(t,e))e+=8;else if(r&&Z(t,e))e+=9;else{if(!H)throw new Error("Invalid DOCTYPE");s=!0}i++,o=""}if(0!==i)throw new Error("Unclosed DOCTYPE")}return{entities:n,i:e}},rt=function(t,e={}){if(e=Object.assign({},W,e),!t||"string"!=typeof t)return t;let n=t.trim();if(void 0!==e.skipLike&&e.skipLike.test(n))return t;if(e.hex&&z.test(n))return Number.parseInt(n,16);{const r=Q.exec(n);if(r){const s=r[1],o=r[2];let a=(i=r[3])&&-1!==i.indexOf(".")?("."===(i=i.replace(/0+$/,""))?i="0":"."===i[0]?i="0"+i:"."===i[i.length-1]&&(i=i.substr(0,i.length-1)),i):i;const l=r[4]||r[6];if(!e.leadingZeros&&o.length>0&&s&&"."!==n[2])return t;if(!e.leadingZeros&&o.length>0&&!s&&"."!==n[1])return t;{const i=Number(n),r=""+i;return-1!==r.search(/[eE]/)||l?e.eNotation?i:t:-1!==n.indexOf(".")?"0"===r&&""===a||r===a||s&&r==="-"+a?i:t:o?a===r||s+a===r?i:t:n===r||n===s+r?i:t}}return t}var i},st=tt;function ot(t){const e=Object.keys(t);for(let n=0;n<e.length;n++){const i=e[n];this.lastEntities[i]={regex:new RegExp("&"+i+";","g"),val:t[i]}}}function at(t,e,n,i,r,s,o){if(void 0!==t&&(this.options.trimValues&&!i&&(t=t.trim()),t.length>0)){o||(t=this.replaceEntitiesValue(t));const i=this.options.tagValueProcessor(e,t,n,r,s);return null==i?t:typeof i!=typeof t||i!==t?i:this.options.trimValues||t.trim()===t?bt(t,this.options.parseTagValue,this.options.numberParseOptions):t}}function lt(t){if(this.options.removeNSPrefix){const e=t.split(":"),n="/"===t.charAt(0)?"/":"";if("xmlns"===e[0])return"";2===e.length&&(t=n+e[1])}return t}const ut=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function dt(t,e,n){if(!0!==this.options.ignoreAttributes&&"string"==typeof t){const n=et.getAllMatches(t,ut),i=n.length,r={};for(let t=0;t<i;t++){const i=this.resolveNameSpace(n[t][1]);if(this.ignoreAttributesFn(i,e))continue;let s=n[t][4],o=this.options.attributeNamePrefix+i;if(i.length)if(this.options.transformAttributeName&&(o=this.options.transformAttributeName(o)),"__proto__"===o&&(o="#__proto__"),void 0!==s){this.options.trimValues&&(s=s.trim()),s=this.replaceEntitiesValue(s);const t=this.options.attributeValueProcessor(i,s,e);r[o]=null==t?s:typeof t!=typeof s||t!==s?t:bt(s,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(r[o]=!0)}if(!Object.keys(r).length)return;if(this.options.attributesGroupName){const t={};return t[this.options.attributesGroupName]=r,t}return r}}const ct=function(t){t=t.replace(/\r\n?/g,"\n");const e=new nt("!xml");let n=e,i="",r="";for(let s=0;s<t.length;s++)if("<"===t[s])if("/"===t[s+1]){const e=Et(t,">",s,"Closing Tag is not closed.");let o=t.substring(s+2,e).trim();if(this.options.removeNSPrefix){const t=o.indexOf(":");-1!==t&&(o=o.substr(t+1))}this.options.transformTagName&&(o=this.options.transformTagName(o)),n&&(i=this.saveTextToParentTag(i,n,r));const a=r.substring(r.lastIndexOf(".")+1);if(o&&-1!==this.options.unpairedTags.indexOf(o))throw new Error(`Unpaired tag can not be used as closing tag: </${o}>`);let l=0;a&&-1!==this.options.unpairedTags.indexOf(a)?(l=r.lastIndexOf(".",r.lastIndexOf(".")-1),this.tagsNodeStack.pop()):l=r.lastIndexOf("."),r=r.substring(0,l),n=this.tagsNodeStack.pop(),i="",s=e}else if("?"===t[s+1]){let e=mt(t,s,!1,"?>");if(!e)throw new Error("Pi Tag is not closed.");if(i=this.saveTextToParentTag(i,n,r),this.options.ignoreDeclaration&&"?xml"===e.tagName||this.options.ignorePiTags);else{const t=new nt(e.tagName);t.add(this.options.textNodeName,""),e.tagName!==e.tagExp&&e.attrExpPresent&&(t[":@"]=this.buildAttributesMap(e.tagExp,r,e.tagName)),this.addChild(n,t,r)}s=e.closeIndex+1}else if("!--"===t.substr(s+1,3)){const e=Et(t,"--\x3e",s+4,"Comment is not closed.");if(this.options.commentPropName){const o=t.substring(s+4,e-2);i=this.saveTextToParentTag(i,n,r),n.add(this.options.commentPropName,[{[this.options.textNodeName]:o}])}s=e}else if("!D"===t.substr(s+1,2)){const e=it(t,s);this.docTypeEntities=e.entities,s=e.i}else if("!["===t.substr(s+1,2)){const e=Et(t,"]]>",s,"CDATA is not closed.")-2,o=t.substring(s+9,e);i=this.saveTextToParentTag(i,n,r);let a=this.parseTextData(o,n.tagname,r,!0,!1,!0,!0);null==a&&(a=""),this.options.cdataPropName?n.add(this.options.cdataPropName,[{[this.options.textNodeName]:o}]):n.add(this.options.textNodeName,a),s=e+2}else{let o=mt(t,s,this.options.removeNSPrefix),a=o.tagName;const l=o.rawTagName;let u=o.tagExp,d=o.attrExpPresent,c=o.closeIndex;this.options.transformTagName&&(a=this.options.transformTagName(a)),n&&i&&"!xml"!==n.tagname&&(i=this.saveTextToParentTag(i,n,r,!1));const h=n;if(h&&-1!==this.options.unpairedTags.indexOf(h.tagname)&&(n=this.tagsNodeStack.pop(),r=r.substring(0,r.lastIndexOf("."))),a!==e.tagname&&(r+=r?"."+a:a),this.isItStopNode(this.options.stopNodes,r,a)){let e="";if(u.length>0&&u.lastIndexOf("/")===u.length-1)"/"===a[a.length-1]?(a=a.substr(0,a.length-1),r=r.substr(0,r.length-1),u=a):u=u.substr(0,u.length-1),s=o.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(a))s=o.closeIndex;else{const n=this.readStopNodeData(t,l,c+1);if(!n)throw new Error(`Unexpected end of ${l}`);s=n.i,e=n.tagContent}const i=new nt(a);a!==u&&d&&(i[":@"]=this.buildAttributesMap(u,r,a)),e&&(e=this.parseTextData(e,a,r,!0,d,!0,!0)),r=r.substr(0,r.lastIndexOf(".")),i.add(this.options.textNodeName,e),this.addChild(n,i,r)}else{if(u.length>0&&u.lastIndexOf("/")===u.length-1){"/"===a[a.length-1]?(a=a.substr(0,a.length-1),r=r.substr(0,r.length-1),u=a):u=u.substr(0,u.length-1),this.options.transformTagName&&(a=this.options.transformTagName(a));const t=new nt(a);a!==u&&d&&(t[":@"]=this.buildAttributesMap(u,r,a)),this.addChild(n,t,r),r=r.substr(0,r.lastIndexOf("."))}else{const t=new nt(a);this.tagsNodeStack.push(n),a!==u&&d&&(t[":@"]=this.buildAttributesMap(u,r,a)),this.addChild(n,t,r),n=t}i="",s=c}}else i+=t[s];return e.child};function ht(t,e,n){const i=this.options.updateTag(e.tagname,n,e[":@"]);!1===i||("string"==typeof i?(e.tagname=i,t.addChild(e)):t.addChild(e))}const ft=function(t){if(this.options.processEntities){for(let e in this.docTypeEntities){const n=this.docTypeEntities[e];t=t.replace(n.regx,n.val)}for(let e in this.lastEntities){const n=this.lastEntities[e];t=t.replace(n.regex,n.val)}if(this.options.htmlEntities)for(let e in this.htmlEntities){const n=this.htmlEntities[e];t=t.replace(n.regex,n.val)}t=t.replace(this.ampEntity.regex,this.ampEntity.val)}return t};function pt(t,e,n,i){return t&&(void 0===i&&(i=0===Object.keys(e.child).length),void 0!==(t=this.parseTextData(t,e.tagname,n,!1,!!e[":@"]&&0!==Object.keys(e[":@"]).length,i))&&""!==t&&e.add(this.options.textNodeName,t),t=""),t}function gt(t,e,n){const i="*."+n;for(const n in t){const r=t[n];if(i===r||e===r)return!0}return!1}function Et(t,e,n,i){const r=t.indexOf(e,n);if(-1===r)throw new Error(i);return r+e.length-1}function mt(t,e,n,i=">"){const r=function(t,e,n=">"){let i,r="";for(let s=e;s<t.length;s++){let e=t[s];if(i)e===i&&(i="");else if('"'===e||"'"===e)i=e;else if(e===n[0]){if(!n[1])return{data:r,index:s};if(t[s+1]===n[1])return{data:r,index:s}}else"\t"===e&&(e=" ");r+=e}}(t,e+1,i);if(!r)return;let s=r.data;const o=r.index,a=s.search(/\s/);let l=s,u=!0;-1!==a&&(l=s.substring(0,a),s=s.substring(a+1).trimStart());const d=l;if(n){const t=l.indexOf(":");-1!==t&&(l=l.substr(t+1),u=l!==r.data.substr(t+1))}return{tagName:l,tagExp:s,closeIndex:o,attrExpPresent:u,rawTagName:d}}function Nt(t,e,n){const i=n;let r=1;for(;n<t.length;n++)if("<"===t[n])if("/"===t[n+1]){const s=Et(t,">",n,`${e} is not closed`);if(t.substring(n+2,s).trim()===e&&(r--,0===r))return{tagContent:t.substring(i,n),i:s};n=s}else if("?"===t[n+1])n=Et(t,"?>",n+1,"StopNode is not closed.");else if("!--"===t.substr(n+1,3))n=Et(t,"--\x3e",n+3,"StopNode is not closed.");else if("!["===t.substr(n+1,2))n=Et(t,"]]>",n,"StopNode is not closed.")-2;else{const i=mt(t,n,">");i&&((i&&i.tagName)===e&&"/"!==i.tagExp[i.tagExp.length-1]&&r++,n=i.closeIndex)}}function bt(t,e,n){if(e&&"string"==typeof t){const e=t.trim();return"true"===e||"false"!==e&&rt(t,n)}return et.isExist(t)?t:""}var wt={};function vt(t,e,n){let i;const r={};for(let s=0;s<t.length;s++){const o=t[s],a=xt(o);let l="";if(l=void 0===n?a:n+"."+a,a===e.textNodeName)void 0===i?i=o[a]:i+=""+o[a];else{if(void 0===a)continue;if(o[a]){let t=vt(o[a],e,l);const n=yt(t,e);o[":@"]?It(t,o[":@"],l,e):1!==Object.keys(t).length||void 0===t[e.textNodeName]||e.alwaysCreateTextNode?0===Object.keys(t).length&&(e.alwaysCreateTextNode?t[e.textNodeName]="":t=""):t=t[e.textNodeName],void 0!==r[a]&&r.hasOwnProperty(a)?(Array.isArray(r[a])||(r[a]=[r[a]]),r[a].push(t)):e.isArray(a,l,n)?r[a]=[t]:r[a]=t}}}return"string"==typeof i?i.length>0&&(r[e.textNodeName]=i):void 0!==i&&(r[e.textNodeName]=i),r}function xt(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const n=e[t];if(":@"!==n)return n}}function It(t,e,n,i){if(e){const r=Object.keys(e),s=r.length;for(let o=0;o<s;o++){const s=r[o];i.isArray(s,n+"."+s,!0,!0)?t[s]=[e[s]]:t[s]=e[s]}}}function yt(t,e){const{textNodeName:n}=e,i=Object.keys(t).length;return 0===i||!(1!==i||!t[n]&&"boolean"!=typeof t[n]&&0!==t[n])}wt.prettify=function(t,e){return vt(t,e)};const{buildOptions:Ot}=k,Tt=class{constructor(t){this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(t,e)=>String.fromCharCode(Number.parseInt(e,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(t,e)=>String.fromCharCode(Number.parseInt(e,16))}},this.addExternalEntities=ot,this.parseXml=ct,this.parseTextData=at,this.resolveNameSpace=lt,this.buildAttributesMap=dt,this.isItStopNode=gt,this.replaceEntitiesValue=ft,this.readStopNodeData=Nt,this.saveTextToParentTag=pt,this.addChild=ht,this.ignoreAttributesFn=st(this.options.ignoreAttributes)}},{prettify:At}=wt,Rt=y;function Lt(t,e,n,i){let r="",s=!1;for(let o=0;o<t.length;o++){const a=t[o],l=Ct(a);if(void 0===l)continue;let u="";if(u=0===n.length?l:`${n}.${l}`,l===e.textNodeName){let t=a[l];Pt(u,e)||(t=e.tagValueProcessor(l,t),t=_t(t,e)),s&&(r+=i),r+=t,s=!1;continue}if(l===e.cdataPropName){s&&(r+=i),r+=`<![CDATA[${a[l][0][e.textNodeName]}]]>`,s=!1;continue}if(l===e.commentPropName){r+=i+`\x3c!--${a[l][0][e.textNodeName]}--\x3e`,s=!0;continue}if("?"===l[0]){const t=$t(a[":@"],e),n="?xml"===l?"":i;let o=a[l][0][e.textNodeName];o=0!==o.length?" "+o:"",r+=n+`<${l}${o}${t}?>`,s=!0;continue}let d=i;""!==d&&(d+=e.indentBy);const c=i+`<${l}${$t(a[":@"],e)}`,h=Lt(a[l],e,u,d);-1!==e.unpairedTags.indexOf(l)?e.suppressUnpairedNode?r+=c+">":r+=c+"/>":h&&0!==h.length||!e.suppressEmptyNode?h&&h.endsWith(">")?r+=c+`>${h}${i}</${l}>`:(r+=c+">",h&&""!==i&&(h.includes("/>")||h.includes("</"))?r+=i+e.indentBy+h+i:r+=h,r+=`</${l}>`):r+=c+"/>",s=!0}return r}function Ct(t){const e=Object.keys(t);for(let n=0;n<e.length;n++){const i=e[n];if(t.hasOwnProperty(i)&&":@"!==i)return i}}function $t(t,e){let n="";if(t&&!e.ignoreAttributes)for(let i in t){if(!t.hasOwnProperty(i))continue;let r=e.attributeValueProcessor(i,t[i]);r=_t(r,e),!0===r&&e.suppressBooleanAttributes?n+=` ${i.substr(e.attributeNamePrefix.length)}`:n+=` ${i.substr(e.attributeNamePrefix.length)}="${r}"`}return n}function Pt(t,e){let n=(t=t.substr(0,t.length-e.textNodeName.length-1)).substr(t.lastIndexOf(".")+1);for(let i in e.stopNodes)if(e.stopNodes[i]===t||e.stopNodes[i]==="*."+n)return!0;return!1}function _t(t,e){if(t&&t.length>0&&e.processEntities)for(let n=0;n<e.entities.length;n++){const i=e.entities[n];t=t.replace(i.regex,i.val)}return t}const St=function(t,e){let n="";return e.format&&e.indentBy.length>0&&(n="\n"),Lt(t,e,"",n)},Ft=tt,Dt={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};function Vt(t){this.options=Object.assign({},Dt,t),!0===this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=Ft(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=jt),this.processTextOrObjNode=Mt,this.options.format?(this.indentate=Gt,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function Mt(t,e,n,i){const r=this.j2x(t,n+1,i.concat(e));return void 0!==t[this.options.textNodeName]&&1===Object.keys(t).length?this.buildTextValNode(t[this.options.textNodeName],e,r.attrStr,n):this.buildObjectNode(r.val,e,r.attrStr,n)}function Gt(t){return this.options.indentBy.repeat(t)}function jt(t){return!(!t.startsWith(this.options.attributeNamePrefix)||t===this.options.textNodeName)&&t.substr(this.attrPrefixLen)}Vt.prototype.build=function(t){return this.options.preserveOrder?St(t,this.options):(Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(t={[this.options.arrayNodeName]:t}),this.j2x(t,0,[]).val)},Vt.prototype.j2x=function(t,e,n){let i="",r="";const s=n.join(".");for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o))if(void 0===t[o])this.isAttribute(o)&&(r+="");else if(null===t[o])this.isAttribute(o)?r+="":"?"===o[0]?r+=this.indentate(e)+"<"+o+"?"+this.tagEndChar:r+=this.indentate(e)+"<"+o+"/"+this.tagEndChar;else if(t[o]instanceof Date)r+=this.buildTextValNode(t[o],o,"",e);else if("object"!=typeof t[o]){const n=this.isAttribute(o);if(n&&!this.ignoreAttributesFn(n,s))i+=this.buildAttrPairStr(n,""+t[o]);else if(!n)if(o===this.options.textNodeName){let e=this.options.tagValueProcessor(o,""+t[o]);r+=this.replaceEntitiesValue(e)}else r+=this.buildTextValNode(t[o],o,"",e)}else if(Array.isArray(t[o])){const i=t[o].length;let s="",a="";for(let l=0;l<i;l++){const i=t[o][l];if(void 0===i);else if(null===i)"?"===o[0]?r+=this.indentate(e)+"<"+o+"?"+this.tagEndChar:r+=this.indentate(e)+"<"+o+"/"+this.tagEndChar;else if("object"==typeof i)if(this.options.oneListGroup){const t=this.j2x(i,e+1,n.concat(o));s+=t.val,this.options.attributesGroupName&&i.hasOwnProperty(this.options.attributesGroupName)&&(a+=t.attrStr)}else s+=this.processTextOrObjNode(i,o,e,n);else if(this.options.oneListGroup){let t=this.options.tagValueProcessor(o,i);t=this.replaceEntitiesValue(t),s+=t}else s+=this.buildTextValNode(i,o,"",e)}this.options.oneListGroup&&(s=this.buildObjectNode(s,o,a,e)),r+=s}else if(this.options.attributesGroupName&&o===this.options.attributesGroupName){const e=Object.keys(t[o]),n=e.length;for(let r=0;r<n;r++)i+=this.buildAttrPairStr(e[r],""+t[o][e[r]])}else r+=this.processTextOrObjNode(t[o],o,e,n);return{attrStr:i,val:r}},Vt.prototype.buildAttrPairStr=function(t,e){return e=this.options.attributeValueProcessor(t,""+e),e=this.replaceEntitiesValue(e),this.options.suppressBooleanAttributes&&"true"===e?" "+t:" "+t+'="'+e+'"'},Vt.prototype.buildObjectNode=function(t,e,n,i){if(""===t)return"?"===e[0]?this.indentate(i)+"<"+e+n+"?"+this.tagEndChar:this.indentate(i)+"<"+e+n+this.closeTag(e)+this.tagEndChar;{let r="</"+e+this.tagEndChar,s="";return"?"===e[0]&&(s="?",r=""),!n&&""!==n||-1!==t.indexOf("<")?!1!==this.options.commentPropName&&e===this.options.commentPropName&&0===s.length?this.indentate(i)+`\x3c!--${t}--\x3e`+this.newLine:this.indentate(i)+"<"+e+n+s+this.tagEndChar+t+this.indentate(i)+r:this.indentate(i)+"<"+e+n+s+">"+t+r}},Vt.prototype.closeTag=function(t){let e="";return-1!==this.options.unpairedTags.indexOf(t)?this.options.suppressUnpairedNode||(e="/"):e=this.options.suppressEmptyNode?"/":`></${t}`,e},Vt.prototype.buildTextValNode=function(t,e,n,i){if(!1!==this.options.cdataPropName&&e===this.options.cdataPropName)return this.indentate(i)+`<![CDATA[${t}]]>`+this.newLine;if(!1!==this.options.commentPropName&&e===this.options.commentPropName)return this.indentate(i)+`\x3c!--${t}--\x3e`+this.newLine;if("?"===e[0])return this.indentate(i)+"<"+e+n+"?"+this.tagEndChar;{let r=this.options.tagValueProcessor(e,t);return r=this.replaceEntitiesValue(r),""===r?this.indentate(i)+"<"+e+n+this.closeTag(e)+this.tagEndChar:this.indentate(i)+"<"+e+n+">"+r+"</"+e+this.tagEndChar}},Vt.prototype.replaceEntitiesValue=function(t){if(t&&t.length>0&&this.options.processEntities)for(let e=0;e<this.options.entities.length;e++){const n=this.options.entities[e];t=t.replace(n.regex,n.val)}return t};var kt={XMLParser:class{constructor(t){this.externalEntities={},this.options=Ot(t)}parse(t,e){if("string"==typeof t);else{if(!t.toString)throw new Error("XML data is accepted in String or Bytes[] form.");t=t.toString()}if(e){!0===e&&(e={});const n=Rt.validate(t,e);if(!0!==n)throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`)}const n=new Tt(this.options);n.addExternalEntities(this.externalEntities);const i=n.parseXml(t);return this.options.preserveOrder||void 0===i?i:At(i,this.options)}addEntity(t,e){if(-1!==e.indexOf("&"))throw new Error("Entity value can't have '&'");if(-1!==t.indexOf("&")||-1!==t.indexOf(";"))throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if("&"===e)throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=e}},XMLValidator:y,XMLBuilder:Vt};class Xt{_view;constructor(t){Ut(t),this._view=t}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 icon(){return this._view.icon}set icon(t){this._view.icon=t}get order(){return this._view.order}set order(t){this._view.order=t}get params(){return this._view.params}set params(t){this._view.params=t}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(t){this._view.expanded=t}get defaultSortKey(){return this._view.defaultSortKey}get loadChildViews(){return this._view.loadChildViews}}const Ut=function(t){if(!t.id||"string"!=typeof t.id)throw new Error("View id is required and must be a string");if(!t.name||"string"!=typeof t.name)throw new Error("View name is required and must be a string");if("caption"in t&&"string"!=typeof t.caption)throw new Error("View caption must be a string");if(!t.getContents||"function"!=typeof t.getContents)throw new Error("View getContents is required and must be a function");if(!t.icon||"string"!=typeof t.icon||!function(t){if("string"!=typeof t)throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);if(0===(t=t.trim()).length)return!1;if(!0!==kt.XMLValidator.validate(t))return!1;let e;const n=new kt.XMLParser;try{e=n.parse(t)}catch{return!1}return!!e&&!!Object.keys(e).some((t=>"svg"===t.toLowerCase()))}(t.icon))throw new Error("View icon is required and must be a valid svg string");if("order"in t&&"number"!=typeof t.order)throw new Error("View order must be a number");if(t.columns&&t.columns.forEach((t=>{if(!(t instanceof x))throw new Error("View columns must be an array of Column. Invalid column found")})),t.emptyView&&"function"!=typeof t.emptyView)throw new Error("View emptyView must be a function");if(t.parent&&"string"!=typeof t.parent)throw new Error("View parent must be a string");if("sticky"in t&&"boolean"!=typeof t.sticky)throw new Error("View sticky must be a boolean");if("expanded"in t&&"boolean"!=typeof t.expanded)throw new Error("View expanded must be a boolean");if(t.defaultSortKey&&"string"!=typeof t.defaultSortKey)throw new Error("View defaultSortKey must be a string");if(t.loadChildViews&&"function"!=typeof t.loadChildViews)throw new Error("View loadChildViews must be a function");return!0};var Bt="object"==typeof l&&l.env&&l.env.NODE_DEBUG&&/\bsemver\b/i.test(l.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{},Ht={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},qt={exports:{}};!function(t,e){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:r}=Ht,s=Bt,o=(e=t.exports={}).re=[],a=e.safeRe=[],l=e.src=[],u=e.t={};let d=0;const c="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",r],[c,i]],f=(t,e,n)=>{const i=(t=>{for(const[e,n]of h)t=t.split(`${e}*`).join(`${e}{0,${n}}`).split(`${e}+`).join(`${e}{1,${n}}`);return t})(e),r=d++;s(t,r,e),u[t]=r,l[r]=e,o[r]=new RegExp(e,n?"g":void 0),a[r]=new RegExp(i,n?"g":void 0)};f("NUMERICIDENTIFIER","0|[1-9]\\d*"),f("NUMERICIDENTIFIERLOOSE","\\d+"),f("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${c}*`),f("MAINVERSION",`(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})`),f("MAINVERSIONLOOSE",`(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})`),f("PRERELEASEIDENTIFIER",`(?:${l[u.NUMERICIDENTIFIER]}|${l[u.NONNUMERICIDENTIFIER]})`),f("PRERELEASEIDENTIFIERLOOSE",`(?:${l[u.NUMERICIDENTIFIERLOOSE]}|${l[u.NONNUMERICIDENTIFIER]})`),f("PRERELEASE",`(?:-(${l[u.PRERELEASEIDENTIFIER]}(?:\\.${l[u.PRERELEASEIDENTIFIER]})*))`),f("PRERELEASELOOSE",`(?:-?(${l[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[u.PRERELEASEIDENTIFIERLOOSE]})*))`),f("BUILDIDENTIFIER",`${c}+`),f("BUILD",`(?:\\+(${l[u.BUILDIDENTIFIER]}(?:\\.${l[u.BUILDIDENTIFIER]})*))`),f("FULLPLAIN",`v?${l[u.MAINVERSION]}${l[u.PRERELEASE]}?${l[u.BUILD]}?`),f("FULL",`^${l[u.FULLPLAIN]}$`),f("LOOSEPLAIN",`[v=\\s]*${l[u.MAINVERSIONLOOSE]}${l[u.PRERELEASELOOSE]}?${l[u.BUILD]}?`),f("LOOSE",`^${l[u.LOOSEPLAIN]}$`),f("GTLT","((?:<|>)?=?)"),f("XRANGEIDENTIFIERLOOSE",`${l[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),f("XRANGEIDENTIFIER",`${l[u.NUMERICIDENTIFIER]}|x|X|\\*`),f("XRANGEPLAIN",`[v=\\s]*(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:${l[u.PRERELEASE]})?${l[u.BUILD]}?)?)?`),f("XRANGEPLAINLOOSE",`[v=\\s]*(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:${l[u.PRERELEASELOOSE]})?${l[u.BUILD]}?)?)?`),f("XRANGE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAIN]}$`),f("XRANGELOOSE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAINLOOSE]}$`),f("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),f("COERCE",`${l[u.COERCEPLAIN]}(?:$|[^\\d])`),f("COERCEFULL",l[u.COERCEPLAIN]+`(?:${l[u.PRERELEASE]})?(?:${l[u.BUILD]})?(?:$|[^\\d])`),f("COERCERTL",l[u.COERCE],!0),f("COERCERTLFULL",l[u.COERCEFULL],!0),f("LONETILDE","(?:~>?)"),f("TILDETRIM",`(\\s*)${l[u.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",f("TILDE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAIN]}$`),f("TILDELOOSE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAINLOOSE]}$`),f("LONECARET","(?:\\^)"),f("CARETTRIM",`(\\s*)${l[u.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",f("CARET",`^${l[u.LONECARET]}${l[u.XRANGEPLAIN]}$`),f("CARETLOOSE",`^${l[u.LONECARET]}${l[u.XRANGEPLAINLOOSE]}$`),f("COMPARATORLOOSE",`^${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]})$|^$`),f("COMPARATOR",`^${l[u.GTLT]}\\s*(${l[u.FULLPLAIN]})$|^$`),f("COMPARATORTRIM",`(\\s*)${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]}|${l[u.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",f("HYPHENRANGE",`^\\s*(${l[u.XRANGEPLAIN]})\\s+-\\s+(${l[u.XRANGEPLAIN]})\\s*$`),f("HYPHENRANGELOOSE",`^\\s*(${l[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[u.XRANGEPLAINLOOSE]})\\s*$`),f("STAR","(<|>)?=?\\s*\\*"),f("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),f("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(qt,qt.exports);var Yt=qt.exports;Object.freeze({loose:!0}),Object.freeze({});const Kt=/^[0-9]+$/,Zt=(t,e)=>{const n=Kt.test(t),i=Kt.test(e);return n&&i&&(t=+t,e=+e),t===e?0:n&&!i?-1:i&&!n?1:t<e?-1:1};var Jt={compareIdentifiers:Zt,rcompareIdentifiers:(t,e)=>Zt(e,t)};const{MAX_LENGTH:zt,MAX_SAFE_INTEGER:Qt}=Ht,{safeRe:Wt,t:te}=Yt,{compareIdentifiers:ee}=Jt;a.m;const ne=function(t){return(void 0===window._nc_newfilemenu&&(window._nc_newfilemenu=new d,i.o.debug("NewFileMenu initialized")),window._nc_newfilemenu).getEntries(t).sort(((t,e)=>void 0!==t.order&&void 0!==e.order&&t.order!==e.order?t.order-e.order:t.displayName.localeCompare(e.displayName,void 0,{numeric:!0,sensitivity:"base"})))}}},r={};function s(t){var e=r[t];if(void 0!==e)return e.exports;var n=r[t]={id:t,loaded:!1,exports:{}};return i[t].call(n.exports,n,n.exports,s),n.loaded=!0,n.exports}s.m=i,t=[],s.O=(e,n,i,r)=>{if(!n){var o=1/0;for(d=0;d<t.length;d++){n=t[d][0],i=t[d][1],r=t[d][2];for(var a=!0,l=0;l<n.length;l++)(!1&r||o>=r)&&Object.keys(s.O).every((t=>s.O[t](n[l])))?n.splice(l--,1):(a=!1,r<o&&(o=r));if(a){t.splice(d--,1);var u=i();void 0!==u&&(e=u)}}return e}r=r||0;for(var d=t.length;d>0&&t[d-1][2]>r;d--)t[d]=t[d-1];t[d]=[n,i,r]},s.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return s.d(e,{a:e}),e},s.d=(t,e)=>{for(var n in e)s.o(e,n)&&!s.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},s.f={},s.e=t=>Promise.all(Object.keys(s.f).reduce(((e,n)=>(s.f[n](t,e),e)),[])),s.u=t=>t+"-"+t+".js?v="+{5706:"3153330af47fc26a725a",5828:"251f4c2fee5cd4300ac4",6127:"da37b69cd9ee64a1836b",6473:"29a59b355eab986be8fd",9087:"5468bd8bc172b0c7610d"}[t],s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),s.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),e={},n="nextcloud:",s.l=(t,i,r,o)=>{if(e[t])e[t].push(i);else{var a,l;if(void 0!==r)for(var u=document.getElementsByTagName("script"),d=0;d<u.length;d++){var c=u[d];if(c.getAttribute("src")==t||c.getAttribute("data-webpack")==n+r){a=c;break}}a||(l=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,s.nc&&a.setAttribute("nonce",s.nc),a.setAttribute("data-webpack",n+r),a.src=t),e[t]=[i];var h=(n,i)=>{a.onerror=a.onload=null,clearTimeout(f);var r=e[t];if(delete e[t],a.parentNode&&a.parentNode.removeChild(a),r&&r.forEach((t=>t(i))),n)return n(i)},f=setTimeout(h.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=h.bind(null,a.onerror),a.onload=h.bind(null,a.onload),l&&document.head.appendChild(a)}},s.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),s.j=5102,(()=>{var t;s.g.importScripts&&(t=s.g.location+"");var e=s.g.document;if(!t&&e&&(e.currentScript&&"SCRIPT"===e.currentScript.tagName.toUpperCase()&&(t=e.currentScript.src),!t)){var n=e.getElementsByTagName("script");if(n.length)for(var i=n.length-1;i>-1&&(!t||!/^http(s?):/.test(t));)t=n[i--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),s.p=t})(),(()=>{s.b=document.baseURI||self.location.href;var t={5102:0};s.f.j=(e,n)=>{var i=s.o(t,e)?t[e]:void 0;if(0!==i)if(i)n.push(i[2]);else{var r=new Promise(((n,r)=>i=t[e]=[n,r]));n.push(i[2]=r);var o=s.p+s.u(e),a=new Error;s.l(o,(n=>{if(s.o(t,e)&&(0!==(i=t[e])&&(t[e]=void 0),i)){var r=n&&("load"===n.type?"missing":n.type),o=n&&n.target&&n.target.src;a.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",a.name="ChunkLoadError",a.type=r,a.request=o,i[1](a)}}),"chunk-"+e,e)}},s.O.j=e=>0===t[e];var e=(e,n)=>{var i,r,o=n[0],a=n[1],l=n[2],u=0;if(o.some((e=>0!==t[e]))){for(i in a)s.o(a,i)&&(s.m[i]=a[i]);if(l)var d=l(s)}for(e&&e(n);u<o.length;u++)r=o[u],s.o(t,r)&&t[r]&&t[r][0](),t[r]=0;return s.O(d)},n=self.webpackChunknextcloud=self.webpackChunknextcloud||[];n.forEach(e.bind(null,0)),n.push=e.bind(null,n.push.bind(n))})(),s.nc=void 0;var o=s.O(void 0,[4208],(()=>s(51528)));o=s.O(o)})();
  2. //# sourceMappingURL=files_sharing-init-public.js.map?v=a0cf8530ff4117c69ce8