vendor: 16,848 bytes, lines 1-6
1import{aT as Yt,bm as Xt,bl as Ye,a$ as Zt,b6 as Jt,r as q,j as g,bp as Qt,C as er,b7 as tr,R as re}from"./index-MK_YrAO_.js";import{U as rr}from"./upload-w8RiQYaS.js";import{E as nr}from"./external-link-Cna9LSxn.js";import{T as or}from"./trash-2-DpYURe5I.js";/** 2 * @license lucide-react v0.462.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const ir=Yt("Film",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 3v18",key:"bbkbws"}],["path",{d:"M3 7.5h4",key:"zfgn84"}],["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M3 16.5h4",key:"1230mu"}],["path",{d:"M17 3v18",key:"in4fa5"}],["path",{d:"M17 7.5h4",key:"myr1c1"}],["path",{d:"M17 16.5h4",key:"go4c1d"}]]);function Le(e){"@babel/helpers - typeof";return Le=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Le(e)}function ar(e,t,r){return Object.defineProperty(e,"prototype",{writable:!1}),e}function sr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lr(e,t,r){return t=he(t),ur(e,qe()?Reflect.construct(t,r||[],he(e).constructor):t.apply(e,r))}function ur(e,t){if(t&&(Le(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return fr(e)}function fr(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function cr(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&pe(e,t)}function Ce(e){var t=typeof Map=="function"?new Map:void 0;return Ce=function(n){if(n===null||!hr(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(n))return t.get(n);t.set(n,o)}function o(){return pr(n,arguments,he(this).constructor)}return o.prototype=Object.create(n.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),pe(o,n)},Ce(e)}function pr(e,t,r){if(qe())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,t);var o=new(e.bind.apply(e,n));return r&&pe(o,r.prototype),o}function qe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(qe=function(){return!!e})()}function hr(e){try{return Function.toString.call(e).indexOf("[native code]")!==-1}catch{return typeof e=="function"}}function pe(e,t){return pe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},pe(e,t)}function he(e){return he=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},he(e)}var be=function(e){function t(r){var n,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;if(sr(this,t),n=lr(this,t,[r]),n.originalRequest=s,n.originalResponse=u,n.causingError=o,o!=null&&(r+=", caused by ".concat(o.toString())),s!=null){var p=s.getHeader("X-Request-ID")||"n/a",c=s.getMethod(),m=s.getURL(),v=u?u.getStatus():"n/a",y=u?u.getBody()||"":"n/a";r+=", originated from request (method: ".concat(c,", url: ").concat(m,", response code: ").concat(v,", response text: ").concat(y,", request id: ").concat(p,")")}return n.message=r,n}return cr(t,e),ar(t)}(Ce(Error));function de(e){"@babel/helpers - typeof";return de=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},de(e)}function dr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,vr(n.key),n)}}function mr(e,t,r){return t&&yr(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function vr(e){var t=gr(e,"string");return de(t)=="symbol"?t:t+""}function gr(e,t){if(de(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(de(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var br=function(){function e(){dr(this,e)}return mr(e,[{key:"listAllUploads",value:function(){return Promise.resolve([])}},{key:"findUploadsByFingerprint",value:function(r){return Promise.resolve([])}},{key:"removeUpload",value:function(r){return Promise.resolve()}},{key:"addUpload",value:function(r,n){return Promise.resolve(null)}}])}();const xt="3.7.8",_r=xt,le=typeof Buffer=="function",Xe=typeof TextDecoder=="function"?new TextDecoder:void 0,Ze=typeof TextEncoder=="function"?new TextEncoder:void 0,wr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",ue=Array.prototype.slice.call(wr),_e=(e=>{let t={};return e.forEach((r,n)=>t[r]=n),t})(ue),Sr=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,O=String.fromCharCode.bind(String),Je=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),Ut=e=>e.replace(/=/g,"").replace(/[+\/]/g,t=>t=="+"?"-":"_"),Pt=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),Et=e=>{let t,r,n,o,s="";const u=e.length%3;for(let p=0;p<e.length;){if((r=e.charCodeAt(p++))>255||(n=e.charCodeAt(p++))>255||(o=e.charCodeAt(p++))>255)throw new TypeError("invalid character found");t=r<<16|n<<8|o,s+=ue[t>>18&63]+ue[t>>12&63]+ue[t>>6&63]+ue[t&63]}return u?s.slice(0,u-3)+"===".substring(u):s},He=typeof btoa=="function"?e=>btoa(e):le?e=>Buffer.from(e,"binary").toString("base64"):Et,Ae=le?e=>Buffer.from(e).toString("base64"):e=>{let r=[];for(let n=0,o=e.length;n<o;n+=4096)r.push(O.apply(null,e.subarray(n,n+4096)));return He(r.join(""))},xe=(e,t=!1)=>t?Ut(Ae(e)):Ae(e),xr=e=>{if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?O(192|t>>>6)+O(128|t&63):O(224|t>>>12&15)+O(128|t>>>6&63)+O(128|t&63)}else{var t=65536+(e.charCodeAt(0)-55296)*1024+(e.charCodeAt(1)-56320);return O(240|t>>>18&7)+O(128|t>>>12&63)+O(128|t>>>6&63)+O(128|t&63)}},Ur=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,jt=e=>e.replace(Ur,xr),Qe=le?e=>Buffer.from(e,"utf8").toString("base64"):Ze?e=>Ae(Ze.encode(e)):e=>He(jt(e)),ae=(e,t=!1)=>t?Ut(Qe(e)):Qe(e),et=e=>ae(e,!0),Pr=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,Er=e=>{switch(e.length){case 4:var t=(7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3),r=t-65536;return O((r>>>10)+55296)+O((r&1023)+56320);case 3:return O((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return O((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},Ot=e=>e.replace(Pr,Er),kt=e=>{if(e=e.replace(/\s+/g,""),!Sr.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(e.length&3));let t,r,n,o=[];for(let s=0;s<e.length;)t=_e[e.charAt(s++)]<<18|_e[e.charAt(s++)]<<12|(r=_e[e.charAt(s++)])<<6|(n=_e[e.charAt(s++)]),r===64?o.push(O(t>>16&255)):n===64?o.push(O(t>>16&255,t>>8&255)):o.push(O(t>>16&255,t>>8&255,t&255));return o.join("")},Me=typeof atob=="function"?e=>atob(Pt(e)):le?e=>Buffer.from(e,"base64").toString("binary"):kt,Rt=le?e=>Je(Buffer.from(e,"base64")):e=>Je(Me(e).split("").map(t=>t.charCodeAt(0))),Tt=e=>Rt(Lt(e)),jr=le?e=>Buffer.from(e,"base64").toString("utf8"):Xe?e=>Xe.decode(Rt(e)):e=>Ot(Me(e)),Lt=e=>Pt(e.replace(/[-_]/g,t=>t=="-"?"+":"/")),ze=e=>jr(Lt(e)),Or=e=>{if(typeof e!="string")return!1;const t=e.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},Ct=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),At=function(){const e=(t,r)=>Object.defineProperty(String.prototype,t,Ct(r));e("fromBase64",function(){return ze(this)}),e("toBase64",function(t){return ae(this,t)}),e("toBase64URI",function(){return ae(this,!0)}),e("toBase64URL",function(){return ae(this,!0)}),e("toUint8Array",function(){return Tt(this)})},zt=function(){const e=(t,r)=>Object.defineProperty(Uint8Array.prototype,t,Ct(r));e("toBase64",function(t){return xe(this,t)}),e("toBase64URI",function(){return xe(this,!0)}),e("toBase64URL",function(){return xe(this,!0)})},kr=()=>{At(),zt()},Rr={version:xt,VERSION:_r,atob:Me,atobPolyfill:kt,btoa:He,btoaPolyfill:Et,fromBase64:ze,toBase64:ae,encode:ae,encodeURI:et,encodeURL:et,utob:jt,btou:Ot,decode:ze,isValid:Or,fromUint8Array:xe,toUint8Array:Tt,extendString:At,extendUint8Array:zt,extendBuiltins:kr};var Tr=function(t,r){if(r=r.split(":")[0],t=+t,!t)return!1;switch(r){case"http":case"ws":return t!==80;case"https":case"wss":return t!==443;case"ftp":return t!==21;case"gopher":return t!==70;case"file":return!1}return t!==0},Ge={},Lr=Object.prototype.hasOwnProperty,Cr;function tt(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return null}}function rt(e){try{return encodeURIComponent(e)}catch{return null}}function Ar(e){for(var t=/([^=?#&]+)=?([^&]*)/g,r={},n;n=t.exec(e);){var o=tt(n[1]),s=tt(n[2]);o===null||s===null||o in r||(r[o]=s)}return r}function zr(e,t){t=t||"";var r=[],n,o;typeof t!="string"&&(t="?");for(o in e)if(Lr.call(e,o)){if(n=e[o],!n&&(n===null||n===Cr||isNaN(n))&&(n=""),o=rt(o),n=rt(n),o===null||n===null)continue;r.push(o+"="+n)}return r.length?t+r.join("&"):""}Ge.stringify=zr;Ge.parse=Ar;var Dt=Tr,Oe=Ge,Dr=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,$t=/[\n\r\t]/g,$r=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,Ft=/:\d+$/,Fr=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,Ir=/^[a-zA-Z]:/;function Ke(e){return(e||"").toString().replace(Dr,"")}var De=[["#","hash"],["?","query"],function(t,r){return M(r.protocol)?t.replace(/\\/g,"/"):t},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],nt={hash:1,query:1};function It(e){var t;typeof window<"u"?t=window:typeof Ye<"u"?t=Ye:typeof self<"u"?t=self:t={};var r=t.location||{};e=e||r;var n={},o=typeof e,s;if(e.protocol==="blob:")n=new G(unescape(e.pathname),{});else if(o==="string"){n=new G(e,{});for(s in nt)delete n[s]}else if(o==="object"){for(s in e)s in nt||(n[s]=e[s]);n.slashes===void 0&&(n.slashes=$r.test(e.href))}return n}function M(e){return e==="file:"||e==="ftp:"||e==="http:"||e==="https:"||e==="ws:"||e==="wss:"}function Bt(e,t){e=Ke(e),e=e.replace($t,""),t=t||{};var r=Fr.exec(e),n=r[1]?r[1].toLowerCase():"",o=!!r[2],s=!!r[3],u=0,p;return o?s?(p=r[2]+r[3]+r[4],u=r[2].length+r[3].length):(p=r[2]+r[4],u=r[2].length):s?(p=r[3]+r[4],u=r[3].length):p=r[4],n==="file:"?u>=2&&(p=p.slice(2)):M(n)?p=r[4]:n?o&&(p=p.slice(2)):u>=2&&M(t.protocol)&&(p=r[4]),{protocol:n,slashes:o||M(n),slashesCount:u,rest:p}}function Br(e,t){if(e==="")return t;for(var r=(t||"/").split("/").slice(0,-1).concat(e.split("/")),n=r.length,o=r[n-1],s=!1,u=0;n--;)r[n]==="."?r.splice(n,1):r[n]===".."?(r.splice(n,1),u++):u&&(n===0&&(s=!0),r.splice(n,1),u--);return s&&r.unshift(""),(o==="."||o==="..")&&r.push(""),r.join("/")}function G(e,t,r){if(e=Ke(e),e=e.replace($t,""),!(this instanceof G))return new G(e,t,r);var n,o,s,u,p,c,m=De.slice(),v=typeof t,y=this,P=0;for(v!=="object"&&v!=="string"&&(r=t,t=null),r&&typeof r!="function"&&(r=Oe.parse),t=It(t),o=Bt(e||"",t),n=!o.protocol&&!o.slashes,y.slashes=o.slashes||n&&t.slashes,y.protocol=o.protocol||t.protocol||"",e=o.rest,(o.protocol==="file:"&&(o.slashesCount!==2||Ir.test(e))||!o.slashes&&(o.protocol||o.slashesCount<2||!M(y.protocol)))&&(m[3]=[/(.*)/,"pathname"]);P<m.length;P++){if(u=m[P],typeof u=="function"){e=u(e,y);continue}s=u[0],c=u[1],s!==s?y[c]=e:typeof s=="string"?(p=s==="@"?e.lastIndexOf(s):e.indexOf(s),~p&&(typeof u[2]=="number"?(y[c]=e.slice(0,p),e=e.slice(p+u[2])):(y[c]=e.slice(p),e=e.slice(0,p)))):(p=s.exec(e))&&(y[c]=p[1],e=e.slice(0,p.index)),y[c]=y[c]||n&&u[3]&&t[c]||"",u[4]&&(y[c]=y[c].toLowerCase())}r&&(y.query=r(y.query)),n&&t.slashes&&y.pathname.charAt(0)!=="/"&&(y.pathname!==""||t.pathname!=="")&&(y.pathname=Br(y.pathname,t.pathname)),y.pathname.charAt(0)!=="/"&&M(y.protocol)&&(y.pathname="/"+y.pathname),Dt(y.port,y.protocol)||(y.host=y.hostname,y.port=""),y.username=y.password="",y.auth&&(p=y.auth.indexOf(":"),~p?(y.username=y.auth.slice(0,p),y.username=encodeURIComponent(decodeURIComponent(y.username)),y.password=y.auth.slice(p+1),y.password=encodeURIComponent(decodeURIComponent(y.password))):y.username=encodeURIComponent(decodeURIComponent(y.auth)),y.auth=y.password?y.username+":"+y.password:y.username),y.origin=y.protocol!=="file:"&&M(y.protocol)&&y.host?y.protocol+"//"+y.host:"null",y.href=y.toString()}function Nr(e,t,r){var n=this;switch(e){case"query":typeof t=="string"&&t.length&&(t=(r||Oe.parse)(t)),n[e]=t;break;case"port":n[e]=t,Dt(t,n.protocol)?t&&(n.host=n.hostname+":"+t):(n.host=n.hostname,n[e]="");break;case"hostname":n[e]=t,n.port&&(t+=":"+n.port),n.host=t;break;case"host":n[e]=t,Ft.test(t)?(t=t.split(":"),n.port=t.pop(),n.hostname=t.join(":")):(n.hostname=t,n.port="");break;case"protocol":n.protocol=t.toLowerCase(),n.slashes=!r;break;case"pathname":case"hash":if(t){var o=e==="pathname"?"/":"#";n[e]=t.charAt(0)!==o?o+t:t}else n[e]=t;break;case"username":case"password":n[e]=encodeURIComponent(t);break;case"auth":var s=t.indexOf(":");~s?(n.username=t.slice(0,s),n.username=encodeURIComponent(decodeURIComponent(n.username)),n.password=t.slice(s+1),n.password=encodeURIComponent(decodeURIComponent(n.password))):n.username=encodeURIComponent(decodeURIComponent(t))}for(var u=0;u<De.length;u++){var p=De[u];p[4]&&(n[p[1]]=n[p[1]].toLowerCase())}return n.auth=n.password?n.username+":"+n.password:n.username,n.origin=n.protocol!=="file:"&&M(n.protocol)&&n.host?n.protocol+"//"+n.host:"null",n.href=n.toString(),n}function qr(e){(!e||typeof e!="function")&&(e=Oe.stringify);var t,r=this,n=r.host,o=r.protocol;o&&o.charAt(o.length-1)!==":"&&(o+=":");var s=o+(r.protocol&&r.slashes||M(r.protocol)?"//":"");return r.username?(s+=r.username,r.password&&(s+=":"+r.password),s+="@"):r.password?(s+=":"+r.password,s+="@"):r.protocol!=="file:"&&M(r.protocol)&&!n&&r.pathname!=="/"&&(s+="@"),(n[n.length-1]===":"||Ft.test(r.hostname)&&!r.port)&&(n+=":"),s+=n+r.pathname,t=typeof r.query=="object"?e(r.query):r.query,t&&(s+=t.charAt(0)!=="?"?"?"+t:t),r.hash&&(s+=r.hash),s}G.prototype={set:Nr,toString:qr};G.extractProtocol=Bt;G.location=It;G.trimLeft=Ke;G.qs=Oe;var Hr=G;const Mr=Xt(Hr);function Gr(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=Math.random()*16|0,r=e==="x"?t:t&3|8;return r.toString(16)})}function $e(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */$e=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(l,i,a){l[i]=a.value},s=typeof Symbol=="function"?Symbol:{},u=s.iterator||"@@iterator",p=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function m(l,i,a){return Object.defineProperty(l,i,{value:a,enumerable:!0,configurable:!0,writable:!0}),l[i]}try{m({},"")}catch{m=function(a,f,d){return a[f]=d}}function v(l,i,a,f){var d=i&&i.prototype instanceof D?i:D,h=Object.create(d.prototype),_=new V(f||[]);return o(h,"_invoke",{value:L(l,a,_)}),h}function y(l,i,a){try{return{type:"normal",arg:l.call(i,a)}}catch(f){return{type:"throw",arg:f}}}t.wrap=v;var P="suspendedStart",X="suspendedYield",B="executing",k="completed",x={};function D(){}function E(){}function U(){}var R={};m(R,u,function(){return this});var K=Object.getPrototypeOf,$=K&&K(K(N([])));$&&$!==r&&n.call($,u)&&(R=$);var T=U.prototype=D.prototype=Object.create(R);function J(l){["next","throw","return"].forEach(function(i){m(l,i,function(a){return this._invoke(i,a)})})}function b(l,i){function a(d,h,_,w){var S=y(l[d],l,h);if(S.type!=="throw"){var C=S.arg,j=C.value;return j&&Q(j)=="object"&&n.call(j,"__await")?i.resolve(j.__await).then(function(A){a("next",A,_,w)},function(A){a("throw",A,_,w)}):i.resolve(j).then(function(A){C.value=A,_(C)},function(A){return a("throw",A,_,w)})}w(S.arg)}var f;o(this,"_invoke",{value:function(h,_){function w(){return new i(function(S,C){a(h,_,S,C)})}return f=f?f.then(w,w):w()}})}function L(l,i,a){var f=P;return function(d,h){if(f===B)throw Error("Generator is already running");if(f===k){if(d==="throw")throw h;return{value:e,done:!0}}for(a.method=d,a.arg=h;;){var _=a.delegate;if(_){var w=F(_,a);if(w){if(w===x)continue;return w}}
vendor: 5,064 bytes, line 6
6if(a.method==="next")a.sent=a._sent=a.arg;else if(a.method==="throw"){if(f===P)throw f=k,a.arg;a.dispatchException(a.arg)}else a.method==="return"&&a.abrupt("return",a.arg);f=B;var S=y(l,i,a);if(S.type==="normal"){if(f=a.done?k:X,S.arg===x)continue;return{value:S.arg,done:a.done}}S.type==="throw"&&(f=k,a.method="throw",a.arg=S.arg)}}}function F(l,i){var a=i.method,f=l.iterator[a];if(f===e)return i.delegate=null,a==="throw"&&l.iterator.return&&(i.method="return",i.arg=e,F(l,i),i.method==="throw")||a!=="return"&&(i.method="throw",i.arg=new TypeError("The iterator does not provide a '"+a+"' method")),x;var d=y(f,l.iterator,i.arg);if(d.type==="throw")return i.method="throw",i.arg=d.arg,i.delegate=null,x;var h=d.arg;return h?h.done?(i[l.resultName]=h.value,i.next=l.nextLoc,i.method!=="return"&&(i.method="next",i.arg=e),i.delegate=null,x):h:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,x)}function W(l){var i={tryLoc:l[0]};1 in l&&(i.catchLoc=l[1]),2 in l&&(i.finallyLoc=l[2],i.afterLoc=l[3]),this.tryEntries.push(i)}function z(l){var i=l.completion||{};i.type="normal",delete i.arg,l.completion=i}function V(l){this.tryEntries=[{tryLoc:"root"}],l.forEach(W,this),this.reset(!0)}function N(l){if(l||l===""){var i=l[u];if(i)return i.call(l);if(typeof l.next=="function")return l;if(!isNaN(l.length)){var a=-1,f=function d(){for(;++a<l.length;)if(n.call(l,a))return d.value=l[a],d.done=!1,d;return d.value=e,d.done=!0,d};return f.next=f}}throw new TypeError(Q(l)+" is not iterable")}return E.prototype=U,o(T,"constructor",{value:U,configurable:!0}),o(U,"constructor",{value:E,configurable:!0}),E.displayName=m(U,c,"GeneratorFunction"),t.isGeneratorFunction=function(l){var i=typeof l=="function"&&l.constructor;return!!i&&(i===E||(i.displayName||i.name)==="GeneratorFunction")},t.mark=function(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,U):(l.__proto__=U,m(l,c,"GeneratorFunction")),l.prototype=Object.create(T),l},t.awrap=function(l){return{__await:l}},J(b.prototype),m(b.prototype,p,function(){return this}),t.AsyncIterator=b,t.async=function(l,i,a,f,d){d===void 0&&(d=Promise);var h=new b(v(l,i,a,f),d);return t.isGeneratorFunction(i)?h:h.next().then(function(_){return _.done?_.value:h.next()})},J(T),m(T,c,"Generator"),m(T,u,function(){return this}),m(T,"toString",function(){return"[object Generator]"}),t.keys=function(l){var i=Object(l),a=[];for(var f in i)a.push(f);return a.reverse(),function d(){for(;a.length;){var h=a.pop();if(h in i)return d.value=h,d.done=!1,d}return d.done=!0,d}},t.values=N,V.prototype={constructor:V,reset:function(i){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(z),!i)for(var a in this)a.charAt(0)==="t"&&n.call(this,a)&&!isNaN(+a.slice(1))&&(this[a]=e)},stop:function(){this.done=!0;var i=this.tryEntries[0].completion;if(i.type==="throw")throw i.arg;return this.rval},dispatchException:function(i){if(this.done)throw i;var a=this;function f(C,j){return _.type="throw",_.arg=i,a.next=C,j&&(a.method="next",a.arg=e),!!j}for(var d=this.tryEntries.length-1;d>=0;--d){var h=this.tryEntries[d],_=h.completion;if(h.tryLoc==="root")return f("end");if(h.tryLoc<=this.prev){var w=n.call(h,"catchLoc"),S=n.call(h,"finallyLoc");if(w&&S){if(this.prev<h.catchLoc)return f(h.catchLoc,!0);if(this.prev<h.finallyLoc)return f(h.finallyLoc)}else if(w){if(this.prev<h.catchLoc)return f(h.catchLoc,!0)}else{if(!S)throw Error("try statement without catch or finally");if(this.prev<h.finallyLoc)return f(h.finallyLoc)}}}},abrupt:function(i,a){for(var f=this.tryEntries.length-1;f>=0;--f){var d=this.tryEntries[f];if(d.tryLoc<=this.prev&&n.call(d,"finallyLoc")&&this.prev<d.finallyLoc){var h=d;break}}h&&(i==="break"||i==="continue")&&h.tryLoc<=a&&a<=h.finallyLoc&&(h=null);var _=h?h.completion:{};return _.type=i,_.arg=a,h?(this.method="next",this.next=h.finallyLoc,x):this.complete(_)},complete:function(i,a){if(i.type==="throw")throw i.arg;return i.type==="break"||i.type==="continue"?this.next=i.arg:i.type==="return"?(this.rval=this.arg=i.arg,this.method="return",this.next="end"):i.type==="normal"&&a&&(this.next=a),x},finish:function(i){for(var a=this.tryEntries.length-1;a>=0;--a){var f=this.tryEntries[a];if(f.finallyLoc===i)return this.complete(f.completion,f.afterLoc),z(f),x}},catch:function(i){for(var a=this.tryEntries.length-1;a>=0;--a){var f=this.tryEntries[a];if(f.tryLoc===i){var d=f.completion;if(d.type==="throw"){var h=d.arg;z(f)}return h}}throw Error("illegal catch attempt")},delegateYield:function(i,a,f){return this.delegate={iterator:N(i),resultName:a,nextLoc:f},this.method==="next"&&(this.arg=e),x}},t}function ot(e,t,r,n,o,s,u){try{var p=e[s](u),c=p.value}catch(m){r(m);return}p.done?t(c):Promise.resolve(c).then(n,o)}function Kr(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var s=e.apply(t,r);function u(c){ot(s,n,o,u,p,"next",c)}function p(c){ot(s,n,o,u,p,"throw",c)}u(void 0)})}}function Nt(e,t){return Yr(e)||Vr(e,t)||qt(e,t)||Wr()}
vendor: 12,596 bytes, lines 6-8
6function Wr(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 7In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Vr(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,s,u,p=[],c=!0,m=!1;try{if(s=(r=r.call(e)).next,t!==0)for(;!(c=(n=s.call(r)).done)&&(p.push(n.value),p.length!==t);c=!0);}catch(v){m=!0,o=v}finally{try{if(!c&&r.return!=null&&(u=r.return(),Object(u)!==u))return}finally{if(m)throw o}}return p}}function Yr(e){if(Array.isArray(e))return e}function Q(e){"@babel/helpers - typeof";return Q=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Q(e)}function Xr(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=qt(e))||t){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(m){throw m},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 8In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s=!0,u=!1,p;return{s:function(){r=r.call(e)},n:function(){var m=r.next();return s=m.done,m},e:function(m){u=!0,p=m},f:function(){try{!s&&r.return!=null&&r.return()}finally{if(u)throw p}}}}function qt(e,t){if(e){if(typeof e=="string")return it(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return it(e,t)}}function it(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function at(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function ne(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?at(Object(r),!0).forEach(function(n){Zr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):at(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Zr(e,t,r){return t=Ht(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Jr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function st(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ht(n.key),n)}}function Qr(e,t,r){return t&&st(e.prototype,t),r&&st(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ht(e){var t=en(e,"string");return Q(t)=="symbol"?t:t+""}function en(e,t){if(Q(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Q(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ue="tus-v1",Pe="ietf-draft-03",fe="ietf-draft-05",tn={endpoint:null,uploadUrl:null,metadata:{},metadataForPartialUploads:{},fingerprint:null,uploadSize:null,onProgress:null,onChunkComplete:null,onSuccess:null,onError:null,onUploadUrlAvailable:null,overridePatchMethod:!1,headers:{},addRequestId:!1,onBeforeRequest:null,onAfterResponse:null,onShouldRetry:Mt,chunkSize:Number.POSITIVE_INFINITY,retryDelays:[0,1e3,3e3,5e3],parallelUploads:1,parallelUploadBoundaries:null,storeFingerprintForResuming:!0,removeFingerprintOnSuccess:!1,uploadLengthDeferred:!1,uploadDataDuringCreation:!1,urlStorage:null,fileReader:null,httpStack:null,protocol:Ue},Ee=function(){function e(t,r){Jr(this,e),"resume"in r&&console.log("tus: The `resume` option has been removed in tus-js-client v2. Please use the URL storage API instead."),this.options=r,this.options.chunkSize=Number(this.options.chunkSize),this._urlStorage=this.options.urlStorage,this.file=t,this.url=null,this._req=null,this._fingerprint=null,this._urlStorageKey=null,this._offset=null,this._aborted=!1,this._size=null,this._source=null,this._retryAttempt=0,this._retryTimeout=null,this._offsetBeforeRetry=0,this._parallelUploads=null,this._parallelUploadUrls=null}return Qr(e,[{key:"findPreviousUploads",value:function(){var r=this;return this.options.fingerprint(this.file,this.options).then(function(n){return r._urlStorage.findUploadsByFingerprint(n)})}},{key:"resumeFromPreviousUpload",value:function(r){this.url=r.uploadUrl||null,this._parallelUploadUrls=r.parallelUploadUrls||null,this._urlStorageKey=r.urlStorageKey}},{key:"start",value:function(){var r=this,n=this.file;if(!n){this._emitError(new Error("tus: no file or stream to upload provided"));return}if(![Ue,Pe,fe].includes(this.options.protocol)){this._emitError(new Error("tus: unsupported protocol ".concat(this.options.protocol)));return}if(!this.options.endpoint&&!this.options.uploadUrl&&!this.url){this._emitError(new Error("tus: neither an endpoint or an upload URL is provided"));return}var o=this.options.retryDelays;if(o!=null&&Object.prototype.toString.call(o)!=="[object Array]"){this._emitError(new Error("tus: the `retryDelays` option must either be an array or null"));return}if(this.options.parallelUploads>1)for(var s=0,u=["uploadUrl","uploadSize","uploadLengthDeferred"];s<u.length;s++){var p=u[s];if(this.options[p]){this._emitError(new Error("tus: cannot use the ".concat(p," option when parallelUploads is enabled")));return}}if(this.options.parallelUploadBoundaries){if(this.options.parallelUploads<=1){this._emitError(new Error("tus: cannot use the `parallelUploadBoundaries` option when `parallelUploads` is disabled"));return}if(this.options.parallelUploads!==this.options.parallelUploadBoundaries.length){this._emitError(new Error("tus: the `parallelUploadBoundaries` must have the same length as the value of `parallelUploads`"));return}}this.options.fingerprint(n,this.options).then(function(c){return r._fingerprint=c,r._source?r._source:r.options.fileReader.openFile(n,r.options.chunkSize)}).then(function(c){if(r._source=c,r.options.uploadLengthDeferred)r._size=null;else if(r.options.uploadSize!=null){if(r._size=Number(r.options.uploadSize),Number.isNaN(r._size)){r._emitError(new Error("tus: cannot convert `uploadSize` option into a number"));return}}else if(r._size=r._source.size,r._size==null){r._emitError(new Error("tus: cannot automatically derive upload's size from input. Specify it manually using the `uploadSize` option or use the `uploadLengthDeferred` option"));return}r.options.parallelUploads>1||r._parallelUploadUrls!=null?r._startParallelUpload():r._startSingleUpload()}).catch(function(c){r._emitError(c)})}},{key:"_startParallelUpload",value:function(){var r,n=this,o=this._size,s=0;this._parallelUploads=[];var u=this._parallelUploadUrls!=null?this._parallelUploadUrls.length:this.options.parallelUploads,p=(r=this.options.parallelUploadBoundaries)!==null&&r!==void 0?r:nn(this._source.size,u);this._parallelUploadUrls&&p.forEach(function(v,y){v.uploadUrl=n._parallelUploadUrls[y]||null}),this._parallelUploadUrls=new Array(p.length);var c=p.map(function(v,y){var P=0;return n._source.slice(v.start,v.end).then(function(X){var B=X.value;return new Promise(function(k,x){var D=ne(ne({},n.options),{},{uploadUrl:v.uploadUrl||null,storeFingerprintForResuming:!1,removeFingerprintOnSuccess:!1,parallelUploads:1,parallelUploadBoundaries:null,metadata:n.options.metadataForPartialUploads,headers:ne(ne({},n.options.headers),{},{"Upload-Concat":"partial"}),onSuccess:k,onError:x,onProgress:function(R){s=s-P+R,P=R,n._emitProgress(s,o)},onUploadUrlAvailable:function(){n._parallelUploadUrls[y]=E.url,n._parallelUploadUrls.filter(function(R){return!!R}).length===p.length&&n._saveUploadInUrlStorage()}}),E=new e(B,D);E.start(),n._parallelUploads.push(E)})})}),m;Promise.all(c).then(function(){m=n._openRequest("POST",n.options.endpoint),m.setHeader("Upload-Concat","final;".concat(n._parallelUploadUrls.join(" ")));var v=lt(n.options.metadata);return v!==""&&m.setHeader("Upload-Metadata",v),n._sendRequest(m,null)}).then(function(v){if(!oe(v.getStatus(),200)){n._emitHttpError(m,v,"tus: unexpected response while creating upload");return}var y=v.getHeader("Location");if(y==null){n._emitHttpError(m,v,"tus: invalid or missing Location header");return}n.url=pt(n.options.endpoint,y),"Created upload at ".concat(n.url),n._emitSuccess(v)}).catch(function(v){n._emitError(v)})}},{key:"_startSingleUpload",value:function(){if(this._aborted=!1,this.url!=null){"Resuming upload from previous URL: ".concat(this.url),this._resumeUpload();return}if(this.options.uploadUrl!=null){"Resuming upload from provided URL: ".concat(this.options.uploadUrl),this.url=this.options.uploadUrl,this._resumeUpload();return}this._createUpload()}},{key:"abort",value:function(r){var n=this;if(this._parallelUploads!=null){var o=Xr(this._parallelUploads),s;try{for(o.s();!(s=o.n()).done;){var u=s.value;u.abort(r)}}catch(p){o.e(p)}finally{o.f()}}return this._req!==null&&this._req.abort(),this._aborted=!0,this._retryTimeout!=null&&(clearTimeout(this._retryTimeout),this._retryTimeout=null),!r||this.url==null?Promise.resolve():e.terminate(this.url,this.options).then(function(){return n._removeFromUrlStorage()})}},{key:"_emitHttpError",value:function(r,n,o,s){this._emitError(new be(o,s,r,n))}},{key:"_emitError",value:function(r){var n=this;if(!this._aborted){if(this.options.retryDelays!=null){var o=this._offset!=null&&this._offset>this._offsetBeforeRetry;if(o&&(this._retryAttempt=0),ct(r,this._retryAttempt,this.options)){var s=this.options.retryDelays[this._retryAttempt++];this._offsetBeforeRetry=this._offset,this._retryTimeout=setTimeout(function(){n.start()},s);return}}if(typeof this.options.onError=="function")this.options.onError(r);else throw r}}},{key:"_emitSuccess",value:function(r){this.options.removeFingerprintOnSuccess&&this._removeFromUrlStorage(),typeof this.options.onSuccess=="function"&&this.options.onSuccess({lastResponse:r})}},{key:"_emitProgress",value:function(r,n){typeof this.options.onProgress=="function"&&this.options.onProgress(r,n)}},{key:"_emitChunkComplete",value:function(r,n,o){typeof this.options.onChunkComplete=="function"&&this.options.onChunkComplete(r,n,o)}},{key:"_createUpload",value:function(){var r=this;if(!this.options.endpoint){this._emitError(new Error("tus: unable to create upload because no endpoint is provided"));return}var n=this._openRequest("POST",this.options.endpoint);this.options.uploadLengthDeferred?n.setHeader("Upload-Defer-Length","1"):n.setHeader("Upload-Length","".concat(this._size));var o=lt(this.options.metadata);o!==""&&n.setHeader("Upload-Metadata",o);var s;this.options.uploadDataDuringCreation&&!this.options.uploadLengthDeferred?(this._offset=0,s=this._addChunkToRequest(n)):((this.options.protocol===Pe||this.options.protocol===fe)&&n.setHeader("Upload-Complete","?0"),s=this._sendRequest(n,null)),s.then(function(u){if(!oe(u.getStatus(),200)){r._emitHttpError(n,u,"tus: unexpected response while creating upload");return}var p=u.getHeader("Location");if(p==null){r._emitHttpError(n,u,"tus: invalid or missing Location header");return}if(r.url=pt(r.options.endpoint,p),"Created upload at ".concat(r.url),typeof r.options.onUploadUrlAvailable=="function"&&r.options.onUploadUrlAvailable(),r._size===0){r._emitSuccess(u),r._source.close();return}r._saveUploadInUrlStorage().then(function(){r.options.uploadDataDuringCreation?r._handleUploadResponse(n,u):(r._offset=0,r._performUpload())})}).catch(function(u){r._emitHttpError(n,null,"tus: failed to create upload",u)})}},{key:"_resumeUpload",value:function(){var r=this,n=this._openRequest("HEAD",this.url),o=this._sendRequest(n,null);o.then(function(s){var u=s.getStatus();if(!oe(u,200)){if(u===423){r._emitHttpError(n,s,"tus: upload is currently locked; retry later");return}if(oe(u,400)&&r._removeFromUrlStorage(),!r.options.endpoint){r._emitHttpError(n,s,"tus: unable to resume upload (new upload cannot be created without an endpoint)");return}r.url=null,r._createUpload();return}var p=Number.parseInt(s.getHeader("Upload-Offset"),10);if(Number.isNaN(p)){r._emitHttpError(n,s,"tus: invalid or missing offset value");return}var c=Number.parseInt(s.getHeader("Upload-Length"),10);if(Number.isNaN(c)&&!r.options.uploadLengthDeferred&&r.options.protocol===Ue){r._emitHttpError(n,s,"tus: invali
8d or missing length value");return}typeof r.options.onUploadUrlAvailable=="function"&&r.options.onUploadUrlAvailable(),r._saveUploadInUrlStorage().then(function(){if(p===c){r._emitProgress(c,c),r._emitSuccess(s);return}r._offset=p,r._performUpload()})}).catch(function(s){r._emitHttpError(n,null,"tus: failed to resume upload",s)})}},{key:"_performUpload",value:function(){var r=this;if(!this._aborted){var n;this.options.overridePatchMethod?(n=this._openRequest("POST",this.url),n.setHeader("X-HTTP-Method-Override","PATCH")):n=this._openRequest("PATCH",this.url),n.setHeader("Upload-Offset","".concat(this._offset));var o=this._addChunkToRequest(n);o.then(function(s){if(!oe(s.getStatus(),200)){r._emitHttpError(n,s,"tus: unexpected response while uploading chunk");return}r._handleUploadResponse(n,s)}).catch(function(s){r._aborted||r._emitHttpError(n,null,"tus: failed to upload chunk at offset ".concat(r._offset),s)})}}},{key:"_addChunkToRequest",value:function(r){var n=this,o=this._offset,s=this._offset+this.options.chunkSize;return r.setProgressHandler(function(u){n._emitProgress(o+u,n._size)}),this.options.protocol===Ue?r.setHeader("Content-Type","application/offset+octet-stream"):this.options.protocol===fe&&r.setHeader("Content-Type","application/partial-upload"),(s===Number.POSITIVE_INFINITY||s>this._size)&&!this.options.uploadLengthDeferred&&(s=this._size),this._source.slice(o,s).then(function(u){var p=u.value,c=u.done,m=p!=null&&p.size?p.size:0;n.options.uploadLengthDeferred&&c&&(n._size=n._offset+m,r.setHeader("Upload-Length","".concat(n._size)));var v=n._offset+m;return!n.options.uploadLengthDeferred&&c&&v!==n._size?Promise.reject(new Error("upload was configured with a size of ".concat(n._size," bytes, but the source is done after ").concat(v," bytes"))):p===null?n._sendRequest(r):((n.options.protocol===Pe||n.options.protocol===fe)&&r.setHeader("Upload-Complete",c?"?1":"?0"),n._emitProgress(n._offset,n._size),n._sendRequest(r,p))})}},{key:"_handleUploadResponse",value:function(r,n){var o=Number.parseInt(n.getHeader("Upload-Offset"),10);if(Number.isNaN(o)){this._emitHttpError(r,n,"tus: invalid or missing offset value");return}if(this._emitProgress(o,this._size),this._emitChunkComplete(o-this._offset,o,this._size),this._offset=o,o===this._size){this._emitSuccess(n),this._source.close();return}this._performUpload()}},{key:"_openRequest",value:function(r,n){var o=ut(r,n,this.options);return this._req=o,o}},{key:"_removeFromUrlStorage",value:function(){var r=this;this._urlStorageKey&&(this._urlStorage.removeUpload(this._urlStorageKey).catch(function(n){r._emitError(n)}),this._urlStorageKey=null)}},{key:"_saveUploadInUrlStorage",value:function(){var r=this;if(!this.options.storeFingerprintForResuming||!this._fingerprint||this._urlStorageKey!==null)return Promise.resolve();var n={size:this._size,metadata:this.options.metadata,creationTime:new Date().toString()};return this._parallelUploads?n.parallelUploadUrls=this._parallelUploadUrls:n.uploadUrl=this.url,this._urlStorage.addUpload(this._fingerprint,n).then(function(o){r._urlStorageKey=o})}},{key:"_sendRequest",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return ft(r,n,this.options)}}],[{key:"terminate",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=ut("DELETE",r,n);return ft(o,null,n).then(function(s){if(s.getStatus()!==204)throw new be("tus: unexpected response while terminating upload",null,o,s)}).catch(function(s){if(s instanceof be||(s=new be("tus: failed to terminate upload",s,o,null)),!ct(s,0,n))throw s;var u=n.retryDelays[0],p=n.retryDelays.slice(1),c=ne(ne({},n),{},{retryDelays:p});return new Promise(function(m){return setTimeout(m,u)}).then(function(){return e.terminate(r,c)})})}}])}();function lt(e){return Object.entries(e).map(function(t){var r=Nt(t,2),n=r[0],o=r[1];return"".concat(n," ").concat(Rr.encode(String(o)))}).join(",")}function oe(e,t){return e>=t&&e<t+100}function ut(e,t,r){var n=r.httpStack.createRequest(e,t);r.protocol===Pe?n.setHeader("Upload-Draft-Interop-Version","5"):r.protocol===fe?n.setHeader("Upload-Draft-Interop-Version","6"):n.setHeader("Tus-Resumable","1.0.0");for(var o=r.headers||{},s=0,u=Object.entries(o);s<u.length;s++){var p=Nt(u[s],2),c=p[0],m=p[1];n.setHeader(c,m)}if(r.addRequestId){var v=Gr();n.setHeader("X-Request-ID",v)}return n}function ft(e,t,r){return Fe.apply(this,arguments)}function Fe(){return Fe=Kr($e().mark(function e(t,r,n){var o;return $e().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(typeof n.onBeforeRequest!="function"){u.next=3;break}return u.next=3,n.onBeforeRequest(t);case 3:return u.next=5,t.send(r);case 5:if(o=u.sent,typeof n.onAfterResponse!="function"){u.next=9;break}return u.next=9,n.onAfterResponse(t,o);case 9:return u.abrupt("return",o);case 10:case"end":return u.stop()}},e)})),Fe.apply(this,arguments)}function rn(){var e=!0;return typeof navigator<"u"&&navigator.onLine===!1&&(e=!1),e}function ct(e,t,r){return r.retryDelays==null||t>=r.retryDelays.length||e.originalRequest==null?!1:r&&typeof r.onShouldRetry=="function"?r.onShouldRetry(e,t,r):Mt(e)}function Mt(e){var t=e.originalResponse?e.originalResponse.getStatus():0;return(!oe(t,400)||t===409||t===423)&&rn()}function pt(e,t){return new Mr(t,e).toString()}function nn(e,t){for(var r=Math.floor(e/t),n=[],o=0;o<t;o++)n.push({start:r*o,end:r*(o+1)});return n[t-1].end=e,n}Ee.defaultOptions=tn;var Gt=function(){return typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative"};function on(e){return new Promise(function(t,r){var n=new XMLHttpRequest;n.responseType="blob",n.onload=function(){var o=n.response;t(o)},n.onerror=function(o){r(o)},n.open("GET",e),n.send()})}var an=function(){return typeof window<"u"&&(typeof window.PhoneGap<"u"||typeof window.Cordova<"u"||typeof window.cordova<"u")};function sn(e){return new Promise(function(t,r){var n=new FileReader;n.onload=function(){var o=new Uint8Array(n.result);t({value:o})},n.onerror=function(o){r(o)},n.readAsArrayBuffer(e)})}function ye(e){"@babel/helpers - typeof";return ye=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ye(e)}function ln(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function un(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,cn(n.key),n)}}function fn(e,t,r){return t&&un(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function cn(e){var t=pn(e,"string");return ye(t)=="symbol"?t:t+""}function pn(e,t){if(ye(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ye(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var ht=function(){function e(t){ln(this,e),this._file=t,this.size=t.size}return fn(e,[{key:"slice",value:function(r,n){if(an())return sn(this._file.slice(r,n));var o=this._file.slice(r,n),s=n>=this.size;return Promise.resolve({value:o,done:s})}},{key:"close",value:function(){}}])}();function me(e){"@babel/helpers - typeof";return me=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},me(e)}function hn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,mn(n.key),n)}}function yn(e,t,r){return t&&dn(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function mn(e){var t=vn(e,"string");return me(t)=="symbol"?t:t+""}function vn(e,t){if(me(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(me(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function dt(e){return e===void 0?0:e.size!==void 0?e.size:e.length}function gn(e,t){if(e.concat)return e.concat(t);if(e instanceof Blob)return new Blob([e,t],{type:e.type});if(e.set){var r=new e.constructor(e.length+t.length);return r.set(e),r.set(t,e.length),r}throw new Error("Unknown data type")}var bn=function(){function e(t){hn(this,e),this._buffer=void 0,this._bufferOffset=0,this._reader=t,this._done=!1}return yn(e,[{key:"slice",value:function(r,n){return r<this._bufferOffset?Promise.reject(new Error("Requested data is before the reader's current offset")):this._readUntilEnoughDataOrDone(r,n)}},{key:"_readUntilEnoughDataOrDone",value:function(r,n){var o=this,s=n<=this._bufferOffset+dt(this._buffer);if(this._done||s){var u=this._getDataFromBuffer(r,n),p=u==null?this._done:!1;return Promise.resolve({value:u,done:p})}return this._reader.read().then(function(c){var m=c.value,v=c.done;return v?o._done=!0:o._buffer===void 0?o._buffer=m:o._buffer=gn(o._buffer,m),o._readUntilEnoughDataOrDone(r,n)})}},{key:"_getDataFromBuffer",value:function(r,n){r>this._bufferOffset&&(this._buffer=this._buffer.slice(r-this._bufferOffset),this._bufferOffset=r);var o=dt(this._buffer)===0;return this._done&&o?null:this._buffer.slice(0,n-r)}},{key:"close",value:function(){this._reader.cancel&&this._reader.cancel()}}])}();function ee(e){"@babel/helpers - typeof";return ee=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ee(e)}function Ie(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Ie=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(l,i,a){l[i]=a.value},s=typeof Symbol=="function"?Symbol:{},u=s.iterator||"@@iterator",p=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function m(l,i,a){return Object.defineProperty(l,i,{value:a,enumerable:!0,configurable:!0,writable:!0}),l[i]}try{m({},"")}catch{m=function(a,f,d){return a[f]=d}}function v(l,i,a,f){var d=i&&i.prototype instanceof D?i:D,h=Object.create(d.prototype),_=new V(f||[]);return o(h,"_invoke",{value:L(l,a,_)}),h}function y(l,i,a){try{return{type:"normal",arg:l.call(i,a)}}catch(f){return{type:"throw",arg:f}}}t.wrap=v;var P="suspendedStart",X="suspendedYield",B="executing",k="completed",x={};function D(){}function E(){}function U(){}var R={};m(R,u,function(){return this});var K=Object.getPrototypeOf,$=K&&K(K(N([])));$&&$!==r&&n.call($,u)&&(R=$);var T=U.prototype=D.prototype=Object.create(R);function J(l){["next","throw","return"].forEach(function(i){m(l,i,function(a){return this._invoke(i,a)})})}function b(l,i){function a(d,h,_,w){var S=y(l[d],l,h);if(S.type!=="throw"){var C=S.arg,j=C.value;return j&&ee(j)=="object"&&n.call(j,"__await")?i.resolve(j.__await).then(function(A){a("next",A,_,w)},function(A){a("throw",A,_,w)}):i.resolve(j).then(function(A){C.value=A,_(C)},function(A){return a("throw",A,_,w)})}w(S.arg)}var f;o(this,"_invoke",{value:function(h,_){function w(){return new i(function(S,C){a(h,_,S,C)})}return f=f?f.then(w,w):w()}})}function L(l,i,a){var f=P;return function(d,h){if(f===B)throw Error("Generator is already running");if(f===k){if(d==="throw")throw h;return{value:e,done:!0}}for(a.method=d,a.arg=h;;){var _=a.delegate;if(_){var w=F(_,a);if(w){if(w===x)continue;return w}}
vendor: 6,144 bytes, line 8
8if(a.method==="next")a.sent=a._sent=a.arg;else if(a.method==="throw"){if(f===P)throw f=k,a.arg;a.dispatchException(a.arg)}else a.method==="return"&&a.abrupt("return",a.arg);f=B;var S=y(l,i,a);if(S.type==="normal"){if(f=a.done?k:X,S.arg===x)continue;return{value:S.arg,done:a.done}}S.type==="throw"&&(f=k,a.method="throw",a.arg=S.arg)}}}function F(l,i){var a=i.method,f=l.iterator[a];if(f===e)return i.delegate=null,a==="throw"&&l.iterator.return&&(i.method="return",i.arg=e,F(l,i),i.method==="throw")||a!=="return"&&(i.method="throw",i.arg=new TypeError("The iterator does not provide a '"+a+"' method")),x;var d=y(f,l.iterator,i.arg);if(d.type==="throw")return i.method="throw",i.arg=d.arg,i.delegate=null,x;var h=d.arg;return h?h.done?(i[l.resultName]=h.value,i.next=l.nextLoc,i.method!=="return"&&(i.method="next",i.arg=e),i.delegate=null,x):h:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,x)}function W(l){var i={tryLoc:l[0]};1 in l&&(i.catchLoc=l[1]),2 in l&&(i.finallyLoc=l[2],i.afterLoc=l[3]),this.tryEntries.push(i)}function z(l){var i=l.completion||{};i.type="normal",delete i.arg,l.completion=i}function V(l){this.tryEntries=[{tryLoc:"root"}],l.forEach(W,this),this.reset(!0)}function N(l){if(l||l===""){var i=l[u];if(i)return i.call(l);if(typeof l.next=="function")return l;if(!isNaN(l.length)){var a=-1,f=function d(){for(;++a<l.length;)if(n.call(l,a))return d.value=l[a],d.done=!1,d;return d.value=e,d.done=!0,d};return f.next=f}}throw new TypeError(ee(l)+" is not iterable")}return E.prototype=U,o(T,"constructor",{value:U,configurable:!0}),o(U,"constructor",{value:E,configurable:!0}),E.displayName=m(U,c,"GeneratorFunction"),t.isGeneratorFunction=function(l){var i=typeof l=="function"&&l.constructor;return!!i&&(i===E||(i.displayName||i.name)==="GeneratorFunction")},t.mark=function(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,U):(l.__proto__=U,m(l,c,"GeneratorFunction")),l.prototype=Object.create(T),l},t.awrap=function(l){return{__await:l}},J(b.prototype),m(b.prototype,p,function(){return this}),t.AsyncIterator=b,t.async=function(l,i,a,f,d){d===void 0&&(d=Promise);var h=new b(v(l,i,a,f),d);return t.isGeneratorFunction(i)?h:h.next().then(function(_){return _.done?_.value:h.next()})},J(T),m(T,c,"Generator"),m(T,u,function(){return this}),m(T,"toString",function(){return"[object Generator]"}),t.keys=function(l){var i=Object(l),a=[];for(var f in i)a.push(f);return a.reverse(),function d(){for(;a.length;){var h=a.pop();if(h in i)return d.value=h,d.done=!1,d}return d.done=!0,d}},t.values=N,V.prototype={constructor:V,reset:function(i){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(z),!i)for(var a in this)a.charAt(0)==="t"&&n.call(this,a)&&!isNaN(+a.slice(1))&&(this[a]=e)},stop:function(){this.done=!0;var i=this.tryEntries[0].completion;if(i.type==="throw")throw i.arg;return this.rval},dispatchException:function(i){if(this.done)throw i;var a=this;function f(C,j){return _.type="throw",_.arg=i,a.next=C,j&&(a.method="next",a.arg=e),!!j}for(var d=this.tryEntries.length-1;d>=0;--d){var h=this.tryEntries[d],_=h.completion;if(h.tryLoc==="root")return f("end");if(h.tryLoc<=this.prev){var w=n.call(h,"catchLoc"),S=n.call(h,"finallyLoc");if(w&&S){if(this.prev<h.catchLoc)return f(h.catchLoc,!0);if(this.prev<h.finallyLoc)return f(h.finallyLoc)}else if(w){if(this.prev<h.catchLoc)return f(h.catchLoc,!0)}else{if(!S)throw Error("try statement without catch or finally");if(this.prev<h.finallyLoc)return f(h.finallyLoc)}}}},abrupt:function(i,a){for(var f=this.tryEntries.length-1;f>=0;--f){var d=this.tryEntries[f];if(d.tryLoc<=this.prev&&n.call(d,"finallyLoc")&&this.prev<d.finallyLoc){var h=d;break}}h&&(i==="break"||i==="continue")&&h.tryLoc<=a&&a<=h.finallyLoc&&(h=null);var _=h?h.completion:{};return _.type=i,_.arg=a,h?(this.method="next",this.next=h.finallyLoc,x):this.complete(_)},complete:function(i,a){if(i.type==="throw")throw i.arg;return i.type==="break"||i.type==="continue"?this.next=i.arg:i.type==="return"?(this.rval=this.arg=i.arg,this.method="return",this.next="end"):i.type==="normal"&&a&&(this.next=a),x},finish:function(i){for(var a=this.tryEntries.length-1;a>=0;--a){var f=this.tryEntries[a];if(f.finallyLoc===i)return this.complete(f.completion,f.afterLoc),z(f),x}},catch:function(i){for(var a=this.tryEntries.length-1;a>=0;--a){var f=this.tryEntries[a];if(f.tryLoc===i){var d=f.completion;if(d.type==="throw"){var h=d.arg;z(f)}return h}}throw Error("illegal catch attempt")},delegateYield:function(i,a,f){return this.delegate={iterator:N(i),resultName:a,nextLoc:f},this.method==="next"&&(this.arg=e),x}},t}function yt(e,t,r,n,o,s,u){try{var p=e[s](u),c=p.value}catch(m){r(m);return}p.done?t(c):Promise.resolve(c).then(n,o)}function _n(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var s=e.apply(t,r);function u(c){yt(s,n,o,u,p,"next",c)}function p(c){yt(s,n,o,u,p,"throw",c)}u(void 0)})}}function wn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Sn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Un(n.key),n)}}function xn(e,t,r){return t&&Sn(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Un(e){var t=Pn(e,"string");return ee(t)=="symbol"?t:t+""}function Pn(e,t){if(ee(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ee(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var En=function(){function e(){wn(this,e)}return xn(e,[{key:"openFile",value:function(){var t=_n(Ie().mark(function n(o,s){var u;return Ie().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(!(Gt()&&o&&typeof o.uri<"u")){c.next=11;break}return c.prev=1,c.next=4,on(o.uri);case 4:return u=c.sent,c.abrupt("return",new ht(u));case 8:throw c.prev=8,c.t0=c.catch(1),new Error("tus: cannot fetch `file.uri` as Blob, make sure the uri is correct and accessible. ".concat(c.t0));
8case 11:if(!(typeof o.slice=="function"&&typeof o.size<"u")){c.next=13;break}return c.abrupt("return",Promise.resolve(new ht(o)));case 13:if(typeof o.read!="function"){c.next=18;break}if(s=Number(s),Number.isFinite(s)){c.next=17;break}return c.abrupt("return",Promise.reject(new Error("cannot create source for stream without a finite value for the `chunkSize` option")));case 17:return c.abrupt("return",Promise.resolve(new bn(o,s)));case 18:return c.abrupt("return",Promise.reject(new Error("source object may only be an instance of File, Blob, or Reader in this environment")));case 19:case"end":return c.stop()}},n,null,[[1,8]])}));function r(n,o){return t.apply(this,arguments)}return r}()}])}();function jn(e,t){return Gt()?Promise.resolve(On(e,t)):Promise.resolve(["tus-br",e.name,e.type,e.size,e.lastModified,t.endpoint].join("-"))}function On(e,t){var r=e.exif?kn(JSON.stringify(e.exif)):"noexif";return["tus-rn",e.name||"noname",e.size||"nosize",r,t.endpoint].join("/")}function kn(e){var t=0;if(e.length===0)return t;for(var r=0;r<e.length;r++){var n=e.charCodeAt(r);t=(t<<5)-t+n,t&=t}return t}function ve(e){"@babel/helpers - typeof";return ve=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ve(e)}function We(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Rn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Tn(n.key),n)}}function Ve(e,t,r){return t&&Rn(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Tn(e){var t=Ln(e,"string");return ve(t)=="symbol"?t:t+""}function Ln(e,t){if(ve(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ve(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Cn=function(){function e(){We(this,e)}return Ve(e,[{key:"createRequest",value:function(r,n){return new An(r,n)}},{key:"getName",value:function(){return"XHRHttpStack"}}])}(),An=function(){function e(t,r){We(this,e),this._xhr=new XMLHttpRequest,this._xhr.open(t,r,!0),this._method=t,this._url=r,this._headers={}}return Ve(e,[{key:"getMethod",value:function(){return this._method}},{key:"getURL",value:function(){return this._url}},{key:"setHeader",value:function(r,n){this._xhr.setRequestHeader(r,n),this._headers[r]=n}},{key:"getHeader",value:function(r){return this._headers[r]}},{key:"setProgressHandler",value:function(r){"upload"in this._xhr&&(this._xhr.upload.onprogress=function(n){n.lengthComputable&&r(n.loaded)})}},{key:"send",value:function(){var r=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return new Promise(function(o,s){r._xhr.onload=function(){o(new zn(r._xhr))},r._xhr.onerror=function(u){s(u)},r._xhr.send(n)})}},{key:"abort",value:function(){return this._xhr.abort(),Promise.resolve()}},{key:"getUnderlyingObject",value:function(){return this._xhr}}])}(),zn=function(){function e(t){We(this,e),this._xhr=t}return Ve(e,[{key:"getStatus",value:function(){return this._xhr.status}},{key:"getHeader",value:function(r){return this._xhr.getResponseHeader(r)}},{key:"getBody",value:function(){return this._xhr.responseText}},{key:"getUnderlyingObject",value:function(){return this._xhr}}])}();function ge(e){"@babel/helpers - typeof";return ge=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ge(e)}function Dn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,In(n.key),n)}}function Fn(e,t,r){return t&&$n(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function In(e){var t=Bn(e,"string");return ge(t)=="symbol"?t:t+""}function Bn(e,t){if(ge(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ge(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Be=!1;try{Be="localStorage"in window;var ke="tusSupport",mt=localStorage.getItem(ke);localStorage.setItem(ke,mt),mt===null&&localStorage.removeItem(ke)}catch(e){if(e.code===e.SECURITY_ERR||e.code===e.QUOTA_EXCEEDED_ERR)Be=!1;else throw e}var Nn=Be,qn=function(){function e(){Dn(this,e)}return Fn(e,[{key:"findAllUploads",value:function(){var r=this._findEntries("tus::");return Promise.resolve(r)}},{key:"findUploadsByFingerprint",value:function(r){var n=this._findEntries("tus::".concat(r,"::"));return Promise.resolve(n)}},{key:"removeUpload",value:function(r){return localStorage.removeItem(r),Promise.resolve()}},{key:"addUpload",value:function(r,n){var o=Math.round(Math.random()*1e12),s="tus::".concat(r,"::").concat(o);return localStorage.setItem(s,JSON.stringify(n)),Promise.resolve(s)}},{key:"_findEntries",value:function(r){for(var n=[],o=0;o<localStorage.length;o++){var s=localStorage.key(o);if(s.indexOf(r)===0)try{var u=JSON.parse(localStorage.getItem(s));u.urlStorageKey=s,n.push(u)}catch{}}return n}}])}();function se(e){"@babel/helpers - typeof";return se=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},se(e)}function Hn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Mn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Wt(n.key),n)}}function Gn(e,t,r){return r&&Mn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Kn(e,t,r){return t=je(t),Wn(e,Kt()?Reflect.construct(t,r||[],je(e).constructor):t.apply(e,r))}function Wn(e,t){if(t&&(se(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Vn(e)}function Vn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Kt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Kt=function(){return!!e})()}function je(e){return je=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},je(e)}function Yn(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ne(e,t)}function Ne(e,t){return Ne=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Ne(e,t)}function vt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function ie(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};
8t%2?vt(Object(r),!0).forEach(function(n){Xn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vt(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Xn(e,t,r){return t=Wt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Wt(e){var t=Zn(e,"string");return se(t)=="symbol"?t:t+""}function Zn(e,t){if(se(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(se(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var gt=ie(ie({},Ee.defaultOptions),{},{httpStack:new Cn,fileReader:new En,urlStorage:Nn?new qn:new br,fingerprint:jn}),Jn=function(e){function t(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Hn(this,t),n=ie(ie({},gt),n),Kn(this,t,[r,n])}return Yn(t,e),Gn(t,null,[{key:"terminate",value:function(n){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return o=ie(ie({},gt),o),Ee.terminate(n,o)}}])}(Ee);const bt="https://rmprnnyfuaqmjchjrgmh.supabase.co",ce="var(--ck-bg)",Qn="var(--ck-bg-alt)",te="var(--ck-ink)",I="var(--ck-gold)",eo="hsl(var(--ck-deep-orange))",Z="var(--ck-border)",Y="var(--ck-muted)",_t=2*1024**3,Re="2.00 GB",to=/^[a-z0-9][a-z0-9-]{1,60}[a-z0-9]$/;function we(e){if(!e)return" - ";const t=e/1024**3;return t>=1?`${t.toFixed(2)} GB`:`${(e/1024**2).toFixed(0)} MB`}const Se={fontFamily:"'Bricolage Grotesque', sans-serif",color:te,letterSpacing:"-0.02em"},H={fontFamily:"Sora, sans-serif",color:te},wt={width:"100%",padding:"10px 14px",borderRadius:8,background:ce,border:`1.5px solid ${Z}`,fontFamily:"Sora, sans-serif",fontSize:14,color:te,outline:"none"},Te={display:"block",fontFamily:"Sora, sans-serif",fontSize:11,fontWeight:700,letterSpacing:"0.18em",textTransform:"uppercase",color:I,marginBottom:8},so=()=>{const{user:e}=Zt(),{toast:t}=Jt(),[r,n]=q.useState([]),[o,s]=q.useState(!0),[u,p]=q.useState(""),[c,m]=q.useState(""),[v,y]=q.useState(null),[P,X]=q.useState(!1),[B,k]=q.useState(0),[x,D]=q.useState(null),E=q.useRef(null),U=async()=>{s(!0);const{data:b,error:L}=await re.from("webinars").select("id, slug, title, video_path, duration_seconds, file_size_bytes, created_at").order("created_at",{ascending:!1});L?t({title:"Failed to load webinars",description:L.message,variant:"destructive"}):n(b??[]),s(!1)};q.useEffect(()=>{U()},[]);const R=b=>`${window.location.origin}/webinar-embed/${b}`,K=async b=>{await navigator.clipboard.writeText(R(b)),D(b),setTimeout(()=>D(null),1500)},$=async b=>{var L,F;if(b.preventDefault(),!(!v||!u||!c)){if(v.size>_t){t({title:"Video is too large",description:`This backend currently accepts videos up to ${Re}. Your file is ${we(v.size)}. Download the next smaller Vimeo MP4 (usually 720p) and upload that instead.`,variant:"destructive"});return}if(!to.test(u)){t({title:"Invalid slug",description:"Use lowercase letters, numbers and dashes only (e.g. jonah-masterclass).",variant:"destructive"});return}X(!0),k(0);try{const W=((L=v.name.split(".").pop())==null?void 0:L.toLowerCase())||"mp4",z=`${e.id}/${u}/${Date.now()}.${W}`,{data:V}=await re.auth.getSession(),N=(F=V.session)==null?void 0:F.access_token;if(!N)throw new Error("Not signed in.");await new Promise((d,h)=>{new Jn(v,{endpoint:`${bt}/storage/v1/upload/resumable`,retryDelays:[0,3e3,5e3,1e4,2e4],headers:{authorization:`Bearer ${N}`,"x-upsert":"false"},uploadDataDuringCreation:!1,removeFingerprintOnSuccess:!0,metadata:{bucketName:"webinars",objectName:z,contentType:v.type||"video/mp4",cacheControl:"3600"},chunkSize:6291456,onError:w=>h(w),onProgress:(w,S)=>{k(Math.round(w/S*100))},onSuccess:()=>d()}).start()});const l=await ro(v).catch(()=>null),{error:i}=await re.from("webinars").insert({slug:u,title:c,video_path:z,duration_seconds:l?Math.round(l):null,file_size_bytes:v.size,created_by:(e==null?void 0:e.id)??null});if(i)throw await re.storage.from("webinars").remove([z]),i;k(100);const a=`${bt}/functions/v1/get-webinar-url/${u}.mp4?healthcheck=1`;let f=!1;try{const d=await fetch(a,{method:"GET",headers:{Range:"bytes=0-1","Cache-Control":"no-cache"}});
8f=d.status===200||d.status===206}catch{f=!1}t(f?{title:"Webinar uploaded",description:`Stream verified · /webinar-embed/${u}`}:{title:"Uploaded - but file is not streaming yet",description:"The row was saved, but a 1-byte range probe of the stored MP4 came back unreachable. The multipart upload likely didn't finalize cleanly. Delete this row and re-upload.",variant:"destructive"}),p(""),m(""),y(null),E.current&&(E.current.value=""),U()}catch(W){const z=W instanceof Error?W.message:String(W);t({title:"Upload failed",description:z,variant:"destructive"})}finally{X(!1),k(0)}}},T=async b=>{if(!confirm(`Delete "${b.title}"? This removes the video file too.`))return;const{error:L}=await re.storage.from("webinars").remove([b.video_path]);L&&t({title:"Storage delete failed",description:L.message,variant:"destructive"});const{error:F}=await re.from("webinars").delete().eq("id",b.id);if(F){t({title:"DB delete failed",description:F.message,variant:"destructive"});return}t({title:"Webinar deleted"}),U()},J=v&&v.size>_t;return g.jsxs("div",{className:"max-w-5xl mx-auto",children:[g.jsxs("div",{className:"mb-10",children:[g.jsx("p",{style:{...H,fontSize:11,fontWeight:700,color:I,letterSpacing:"0.22em",textTransform:"uppercase",marginBottom:12},children:"⪠Webinars"}),g.jsx("h1",{style:{...Se,fontSize:44,fontWeight:700,lineHeight:1.05,marginBottom:12},children:"Host fake-live webinars."}),g.jsxs("p",{style:{...H,fontSize:16,lineHeight:1.6,color:Y,maxWidth:640},children:["Upload your webinar video and embed it anywhere with a clean, no-controls player. Use the best Vimeo MP4 that stays under ",Re,"; for long webinars that is usually 720p."]})]}),g.jsxs("form",{onSubmit:$,className:"mb-12 p-7",style:{background:Qn,border:`1px solid ${Z}`,borderRadius:16},children:[g.jsxs("h2",{style:{...Se,fontSize:22,fontWeight:700,marginBottom:20,display:"flex",alignItems:"center",gap:10},children:[g.jsx(rr,{size:18,style:{color:I}})," Upload a webinar"]}),g.jsxs("div",{className:"grid md:grid-cols-2 gap-5 mb-5",children:[g.jsxs("div",{children:[g.jsx("label",{style:Te,children:"Title"}),g.jsx("input",{type:"text",value:c,onChange:b=>m(b.target.value),placeholder:"Jonah's Boogie Masterclass",required:!0,style:wt,onFocus:b=>b.currentTarget.style.borderColor=I,onBlur:b=>b.currentTarget.style.borderColor=Z})]}),g.jsxs("div",{children:[g.jsx("label",{style:Te,children:"Slug (embed URL)"}),g.jsx("input",{type:"text",value:u,onChange:b=>p(b.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"")),placeholder:"jonah-masterclass",required:!0,style:{...wt,fontFamily:"'JetBrains Mono', monospace"},onFocus:b=>b.currentTarget.style.borderColor=I,onBlur:b=>b.currentTarget.style.borderColor=Z}),g.jsxs("p",{style:{...H,fontSize:11,color:Y,marginTop:6},children:["Will live at"," ",g.jsxs("span",{style:{fontFamily:"'JetBrains Mono', monospace",color:te},children:["/webinar-embed/",u||"your-slug"]})]})]})]}),g.jsxs("div",{className:"mb-5",children:[g.jsx("label",{style:Te,children:"Video file (.mp4)"}),g.jsx("input",{ref:E,type:"file",accept:"video/mp4,video/webm,video/quicktime",onChange:b=>{var L;return y(((L=b.target.files)==null?void 0:L[0])??null)},required:!0,style:{...H,fontSize:14,color:Y,display:"block",width:"100%"},className:"file:mr-3 file:py-2 file:px-4 file:rounded-full file:border-0 file:text-xs file:font-bold file:uppercase file:tracking-wider file:cursor-pointer"}),g.jsx("style",{children:` 9 .ck-root input[type="file"]::file-selector-button { 10 background: ${I}; 11 color: ${ce}; 12 font-family: 'Sora', sans-serif; 13 letter-spacing: 0.1em; 14 } 15 .ck-root input[type="file"]::file-selector-button:hover { background: ${eo}; } 16 `}),v&&g.jsxs("p",{style:{...H,fontSize:12,color:Y,marginTop:8},children:["Selected: ",g.jsx("strong",{style:{color:te},children:v.name})," - ",we(v.size)]}),J&&g.jsxs("p",{style:{...H,fontSize:13,color:"var(--ck-down)",marginTop:8,display:"flex",alignItems:"flex-start",gap:6},children:[g.jsx(Qt,{size:14,style:{flexShrink:0,marginTop:2}}),"This file is ",we(v.size),", but the current upload limit is ",Re,". Download the next smaller Vimeo MP4, usually 720p."]})]}),P&&g.jsxs("div",{className:"mb-5",children:[g.jsx("div",{style:{height:6,background:Z,borderRadius:999,overflow:"hidden"},children:g.jsx("div",{style:{height:"100%",background:I,width:`${B}%`,transition:"width 300ms cubic-bezier(0.22,1,0.36,1)"}})}),g.jsxs("p",{style:{...H,fontSize:12,color:Y,marginTop:8},children:["Uploading⦠",B,"% - keep this tab open."]})]}),g.jsx("button",{type:"submit",disabled:P||!v||!u||!c,style:{padding:"14px 28px",borderRadius:999,background:I,color:ce,fontFamily:"Sora, sans-serif",fontSize:13,fontWeight:800,letterSpacing:"0.16em",textTransform:"uppercase",border:"none",cursor:P||!v||!u||!c?"not-allowed":"pointer",opacity:P||!v||!u||!c?.5:1,boxShadow:"none",transition:"all 200ms cubic-bezier(0.22,1,0.36,1)"},children:P?"Uploadingâ¦":"Upload webinar"})]}),g.jsxs("div",{children:[g.jsxs("h2",{style:{...Se,fontSize:22,fontWeight:700,marginBottom:18,display:"flex",alignItems:"center",gap:10},children:[g.jsx(ir,{size:18,style:{color:I}}
16)," Your webinars"]}),o?g.jsx("p",{style:{...H,fontSize:14,color:Y},children:"Loadingâ¦"}):r.length===0?g.jsx("p",{style:{...H,fontSize:14,color:Y},children:"No webinars yet. Upload your first above."}):g.jsx("div",{className:"space-y-3",children:r.map(b=>g.jsxs("div",{className:"p-5 flex items-center justify-between gap-4",style:{background:ce,border:`1px solid ${Z}`,borderRadius:14},children:[g.jsxs("div",{className:"min-w-0 flex-1",children:[g.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[g.jsx("h3",{style:{...Se,fontSize:16,fontWeight:700},className:"truncate",children:b.title}),g.jsxs("span",{style:{...H,fontSize:10,color:Y,letterSpacing:"0.14em",textTransform:"uppercase"},children:[we(b.file_size_bytes),b.duration_seconds?` · ${Math.floor(b.duration_seconds/60)}m ${b.duration_seconds%60}s`:""]})]}),g.jsx("code",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:11,color:Y,display:"block"},className:"truncate",children:R(b.slug)})]}),g.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[g.jsx(St,{onClick:()=>K(b.slug),title:"Copy embed URL",children:x===b.slug?g.jsx(er,{size:14}):g.jsx(tr,{size:14})}),g.jsx("a",{href:R(b.slug),target:"_blank",rel:"noopener noreferrer",title:"Open embed page",style:Vt,children:g.jsx(nr,{size:14})}),g.jsx(St,{onClick:()=>T(b),title:"Delete",danger:!0,children:g.jsx(or,{size:14})})]})]},b.id))})]})]})},Vt={padding:8,borderRadius:8,border:`1px solid ${Z}`,background:ce,color:te,display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:"pointer",transition:"all 200ms cubic-bezier(0.22,1,0.36,1)"},St=({children:e,onClick:t,title:r,danger:n})=>g.jsx("button",{onClick:t,title:r,style:Vt,onMouseEnter:o=>{o.currentTarget.style.borderColor=n?"var(--ck-down)":I,o.currentTarget.style.color=n?"var(--ck-down)":I},onMouseLeave:o=>{o.currentTarget.style.borderColor=Z,o.currentTarget.style.color=te},children:e});function ro(e){return new Promise((t,r)=>{const n=document.createElement("video");n.preload="metadata",n.onloadedmetadata=()=>{const o=n.duration;URL.revokeObjectURL(n.src),t(o)},n.onerror=()=>r(new Error("Could not read video metadata")),n.src=URL.createObjectURL(e)})}export{so as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.