@lifesg/web-frontend-engine 2.0.0-alpha.18 → 2.0.0-alpha.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/chunks/{file-upload-manager.6f91498f.js → file-upload-manager.6091aa9e.js} +2 -2
- package/chunks/file-upload-manager.6091aa9e.js.map +1 -0
- package/chunks/{index.01911ac9.js → index.cb4c93a5.js} +6 -6
- package/{cjs/chunks/index.33c9bcbb.js.map → chunks/index.cb4c93a5.js.map} +1 -1
- package/chunks/{index.c8228568.js → index.dcdbe23e.js} +2 -2
- package/chunks/{index.c8228568.js.map → index.dcdbe23e.js.map} +1 -1
- package/chunks/{index.94a6f552.js → index.df1ee6f5.js} +2 -2
- package/chunks/{index.94a6f552.js.map → index.df1ee6f5.js.map} +1 -1
- package/chunks/{location-modal.96339252.js → location-modal.b47d92b7.js} +2 -2
- package/chunks/{location-modal.96339252.js.map → location-modal.b47d92b7.js.map} +1 -1
- package/cjs/chunks/{file-upload-manager.2465d276.js → file-upload-manager.858f342f.js} +2 -2
- package/cjs/chunks/file-upload-manager.858f342f.js.map +1 -0
- package/cjs/chunks/{index.c8a96a82.js → index.3cfca5cf.js} +2 -2
- package/cjs/chunks/{index.c8a96a82.js.map → index.3cfca5cf.js.map} +1 -1
- package/cjs/chunks/{index.33c9bcbb.js → index.7db1a25b.js} +6 -6
- package/cjs/chunks/index.7db1a25b.js.map +1 -0
- package/cjs/chunks/{index.dbac2c71.js → index.ade37699.js} +2 -2
- package/cjs/chunks/{index.dbac2c71.js.map → index.ade37699.js.map} +1 -1
- package/cjs/chunks/{location-modal.07158be4.js → location-modal.ff0cd21c.js} +2 -2
- package/cjs/chunks/{location-modal.07158be4.js.map → location-modal.ff0cd21c.js.map} +1 -1
- package/cjs/index.js +1 -1
- package/components/shared/error-messages.d.ts +1 -0
- package/context-providers/yup/types.d.ts +8 -1
- package/index.js +1 -1
- package/package.json +1 -1
- package/chunks/file-upload-manager.6f91498f.js.map +0 -1
- package/chunks/index.01911ac9.js.map +0 -1
- package/cjs/chunks/file-upload-manager.2465d276.js.map +0 -1
|
@@ -176,7 +176,7 @@ var Bp=!1;Bp||(Bp=!0,jp.ENGLISH=new jp("en"),jp.US=new jp("en","US","en"),jp.UK=
|
|
|
176
176
|
* @copyright (c) 2017, Philipp Thuerwaechter & Pattrick Hueper
|
|
177
177
|
* @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
|
|
178
178
|
*/
|
|
179
|
-
Rf((function(e){Object.getOwnPropertyNames(Pp.prototype).forEach((function(t){"constructor"!==t&&(e.DateTimeFormatterBuilder.prototype[t]=Pp.prototype[t])})),Object.getOwnPropertyNames(Up.prototype).forEach((function(t){"constructor"!==t&&(e.DateTimeFormatter.prototype[t]=Up.prototype[t])})),e.DateTimeFormatter.RFC_1123_DATE_TIME=Up.RFC_1123_DATE_TIME}));var Vp=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i},Hp=sn,Gp=Rr;var Yp=function(e){return"symbol"==typeof e||Gp(e)&&"[object Symbol]"==Hp(e)},Wp=Vp,qp=Hr,Kp=Yp,Jp=qt?qt.prototype:void 0,Xp=Jp?Jp.toString:void 0;var Qp=function e(t){if("string"==typeof t)return t;if(qp(t))return Wp(t,e)+"";if(Kp(t))return Xp?Xp.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n},eh=Qp;var th=function(e){return null==e?"":eh(e)};var nh=function(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r<i;)a[r]=e[r+t];return a},rh=nh;var ih=function(e,t,n){var r=e.length;return n=void 0===n?r:n,!t&&n>=r?e:rh(e,t,n)},ah=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");var oh=function(e){return ah.test(e)};var sh=function(e){return e.split("")},uh="\\ud800-\\udfff",ch="["+uh+"]",lh="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",dh="\\ud83c[\\udffb-\\udfff]",fh="[^"+uh+"]",ph="(?:\\ud83c[\\udde6-\\uddff]){2}",hh="[\\ud800-\\udbff][\\udc00-\\udfff]",mh="(?:"+lh+"|"+dh+")"+"?",gh="[\\ufe0e\\ufe0f]?",yh=gh+mh+("(?:\\u200d(?:"+[fh,ph,hh].join("|")+")"+gh+mh+")*"),_h="(?:"+[fh+lh+"?",lh,ph,hh,ch].join("|")+")",vh=RegExp(dh+"(?="+dh+")|"+_h+yh,"g");var bh=function(e){return e.match(vh)||[]},Eh=sh,Sh=oh,Ah=bh;var xh=function(e){return Sh(e)?Ah(e):Eh(e)},wh=ih,Th=oh,Mh=xh,Oh=th;var Ch=function(e){return function(t){t=Oh(t);var n=Th(t)?Mh(t):void 0,r=n?n[0]:t.charAt(0),i=n?wh(n,1).join(""):t.slice(1);return r[e]()+i}},Nh=Ch("toUpperCase"),Dh=th,Lh=Nh;var Ih=function(e){return Lh(Dh(e).toLowerCase())};function kh(e){return new DataView(e.buffer,e.byteOffset)}const $h={len:1,get:(e,t)=>kh(e).getUint8(t),put:(e,t,n)=>(kh(e).setUint8(t,n),t+1)},Rh={len:2,get:(e,t)=>kh(e).getUint16(t,!0),put:(e,t,n)=>(kh(e).setUint16(t,n,!0),t+2)},Fh={len:2,get:(e,t)=>kh(e).getUint16(t),put:(e,t,n)=>(kh(e).setUint16(t,n),t+2)},zh={len:4,get:(e,t)=>kh(e).getUint32(t,!0),put:(e,t,n)=>(kh(e).setUint32(t,n,!0),t+4)},Ph={len:4,get:(e,t)=>kh(e).getUint32(t),put:(e,t,n)=>(kh(e).setUint32(t,n),t+4)},jh={len:4,get:(e,t)=>kh(e).getInt32(t),put:(e,t,n)=>(kh(e).setInt32(t,n),t+4)},Zh={len:8,get:(e,t)=>kh(e).getBigUint64(t,!0),put:(e,t,n)=>(kh(e).setBigUint64(t,n,!0),t+8)};class Uh{constructor(e,t){this.len=e,this.encoding=t,this.textDecoder=new TextDecoder(t)}get(e,t){return this.textDecoder.decode(e.subarray(t,t+this.len))}}class Bh extends Error{constructor(){super("End-Of-Stream")}}class Vh{constructor(){this.maxStreamReadSize=1048576,this.endOfStream=!1,this.peekQueue=[]}async peek(e,t,n){const r=await this.read(e,t,n);return this.peekQueue.push(e.subarray(t,t+r)),r}async read(e,t,n){if(0===n)return 0;let r=this.readFromPeekBuffer(e,t,n);if(r+=await this.readRemainderFromStream(e,t+r,n-r),0===r)throw new Bh;return r}readFromPeekBuffer(e,t,n){let r=n,i=0;for(;this.peekQueue.length>0&&r>0;){const n=this.peekQueue.pop();if(!n)throw new Error("peekData should be defined");const a=Math.min(n.length,r);e.set(n.subarray(0,a),t+i),i+=a,r-=a,a<n.length&&this.peekQueue.push(n.subarray(a))}return i}async readRemainderFromStream(e,t,n){let r=n,i=0;for(;r>0&&!this.endOfStream;){const n=Math.min(r,this.maxStreamReadSize),a=await this.readFromStream(e,t+i,n);if(0===a)break;i+=a,r-=a}return i}}class Hh extends Vh{constructor(e){super(),this.reader=e.getReader({mode:"byob"})}async readFromStream(e,t,n){if(this.endOfStream)throw new Bh;const r=await this.reader.read(new Uint8Array(n));return r.done&&(this.endOfStream=r.done),r.value?(e.set(r.value,t),r.value.byteLength):0}abort(){return this.reader.cancel()}async close(){await this.abort(),this.reader.releaseLock()}}class Gh{constructor(e){this.numBuffer=new Uint8Array(8),this.position=0,this.onClose=e?.onClose,e?.abortSignal&&e.abortSignal.addEventListener("abort",(()=>{this.abort()}))}async readToken(e,t=this.position){const n=new Uint8Array(e.len);if(await this.readBuffer(n,{position:t})<e.len)throw new Bh;return e.get(n,0)}async peekToken(e,t=this.position){const n=new Uint8Array(e.len);if(await this.peekBuffer(n,{position:t})<e.len)throw new Bh;return e.get(n,0)}async readNumber(e){if(await this.readBuffer(this.numBuffer,{length:e.len})<e.len)throw new Bh;return e.get(this.numBuffer,0)}async peekNumber(e){if(await this.peekBuffer(this.numBuffer,{length:e.len})<e.len)throw new Bh;return e.get(this.numBuffer,0)}async ignore(e){if(void 0!==this.fileInfo.size){const t=this.fileInfo.size-this.position;if(e>t)return this.position+=t,t}return this.position+=e,e}async close(){await this.abort(),await(this.onClose?.())}normalizeOptions(e,t){if(t&&void 0!==t.position&&t.position<this.position)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");return t?{mayBeLess:!0===t.mayBeLess,offset:t.offset?t.offset:0,length:t.length?t.length:e.length-(t.offset?t.offset:0),position:t.position?t.position:this.position}:{mayBeLess:!1,offset:0,length:e.length,position:this.position}}abort(){return Promise.resolve()}}class Yh extends Gh{constructor(e,t){super(t),this.streamReader=e,this.fileInfo=t?.fileInfo??{}}async readBuffer(e,t){const n=this.normalizeOptions(e,t),r=n.position-this.position;if(r>0)return await this.ignore(r),this.readBuffer(e,t);if(r<0)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");if(0===n.length)return 0;const i=await this.streamReader.read(e,n.offset,n.length);if(this.position+=i,(!t||!t.mayBeLess)&&i<n.length)throw new Bh;return i}async peekBuffer(e,t){const n=this.normalizeOptions(e,t);let r=0;if(n.position){const t=n.position-this.position;if(t>0){const i=new Uint8Array(n.length+t);return r=await this.peekBuffer(i,{mayBeLess:n.mayBeLess}),e.set(i.subarray(t),n.offset),r-t}if(t<0)throw new Error("Cannot peek from a negative offset in a stream")}if(n.length>0){try{r=await this.streamReader.peek(e,n.offset,n.length)}catch(e){if(t?.mayBeLess&&e instanceof Bh)return 0;throw e}if(!n.mayBeLess&&r<n.length)throw new Bh}return r}async ignore(e){const t=Math.min(256e3,e),n=new Uint8Array(t);let r=0;for(;r<e;){const i=e-r,a=await this.readBuffer(n,{length:Math.min(t,i)});if(a<0)return a;r+=a}return r}abort(){return this.streamReader.abort()}supportsRandomAccess(){return!1}}class Wh extends Gh{constructor(e,t){super(t),this.uint8Array=e,this.fileInfo={...t?.fileInfo??{},size:e.length}}async readBuffer(e,t){if(t?.position){if(t.position<this.position)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");this.position=t.position}const n=await this.peekBuffer(e,t);return this.position+=n,n}async peekBuffer(e,t){const n=this.normalizeOptions(e,t),r=Math.min(this.uint8Array.length-n.position,n.length);if(!n.mayBeLess&&r<n.length)throw new Bh;return e.set(this.uint8Array.subarray(n.position,n.position+r),n.offset),r}close(){return super.close()}supportsRandomAccess(){return!0}setPosition(e){this.position=e}}function qh(e){const{byteLength:t}=e;return 6===t?e.getUint16(0)*2**32+e.getUint32(2):5===t?e.getUint8(0)*2**32+e.getUint32(1):4===t?e.getUint32(0):3===t?65536*e.getUint8(0)+e.getUint16(1):2===t?e.getUint16(0):1===t?e.getUint8(0):void 0}function Kh(e,t){const n=e.length,r=t.length;if(0===r)return-1;if(r>n)return-1;const i=n-r;for(let n=0;n<=i;n++){let i=!0;for(let a=0;a<r;a++)if(e[n+a]!==t[a]){i=!1;break}if(i)return n}return-1}new globalThis.TextDecoder("utf8"),new globalThis.TextEncoder,Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));const Jh={get:(e,t)=>127&e[t+3]|e[t+2]<<7|e[t+1]<<14|e[t]<<21,len:4},Xh=4100;function Qh(e,t,n){n={offset:0,...n};for(const[r,i]of t.entries())if(n.mask){if(i!==(n.mask[r]&e[r+n.offset]))return!1}else if(i!==e[r+n.offset])return!1;return!0}class em{constructor(e){this.detectors=e?.customDetectors,this.tokenizerOptions={abortSignal:e?.signal},this.fromTokenizer=this.fromTokenizer.bind(this),this.fromBuffer=this.fromBuffer.bind(this),this.parse=this.parse.bind(this)}async fromTokenizer(e){const t=e.position;for(const n of this.detectors||[]){const r=await n(e);if(r)return r;if(t!==e.position)return}return this.parse(e)}async fromBuffer(e){if(!(e instanceof Uint8Array||e instanceof ArrayBuffer))throw new TypeError(`Expected the \`input\` argument to be of type \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof e}\``);const t=e instanceof Uint8Array?e:new Uint8Array(e);var n,r;if(t?.length>1)return this.fromTokenizer((n=t,r=this.tokenizerOptions,new Wh(n,r)))}async fromBlob(e){return this.fromStream(e.stream())}async fromStream(e){const t=await(n=e,r=this.tokenizerOptions,new Yh(new Hh(n),r));var n,r;try{return await this.fromTokenizer(t)}finally{await t.close()}}async toDetectionStream(e,t){const{sampleSize:n=Xh}=t;let r,i;const a=e.getReader({mode:"byob"});try{const{value:e,done:t}=await a.read(new Uint8Array(n));if(i=e,!t&&e)try{r=await this.fromBuffer(e.slice(0,n))}catch(e){if(!(e instanceof Bh))throw e;r=void 0}i=e}finally{a.releaseLock()}const o=new TransformStream({async start(e){e.enqueue(i)},transform(e,t){t.enqueue(e)}}),s=e.pipeThrough(o);return s.fileType=r,s}check(e,t){return Qh(this.buffer,e,t)}checkString(e,t){return this.check(function(e){return[...e].map((e=>e.charCodeAt(0)))}(e),t)}async parse(e){if(this.buffer=new Uint8Array(Xh),void 0===e.fileInfo.size&&(e.fileInfo.size=Number.MAX_SAFE_INTEGER),this.tokenizer=e,await e.peekBuffer(this.buffer,{length:12,mayBeLess:!0}),this.check([66,77]))return{ext:"bmp",mime:"image/bmp"};if(this.check([11,119]))return{ext:"ac3",mime:"audio/vnd.dolby.dd-raw"};if(this.check([120,1]))return{ext:"dmg",mime:"application/x-apple-diskimage"};if(this.check([77,90]))return{ext:"exe",mime:"application/x-msdownload"};if(this.check([37,33]))return await e.peekBuffer(this.buffer,{length:24,mayBeLess:!0}),this.checkString("PS-Adobe-",{offset:2})&&this.checkString(" EPSF-",{offset:14})?{ext:"eps",mime:"application/eps"}:{ext:"ps",mime:"application/postscript"};if(this.check([31,160])||this.check([31,157]))return{ext:"Z",mime:"application/x-compress"};if(this.check([199,113]))return{ext:"cpio",mime:"application/x-cpio"};if(this.check([96,234]))return{ext:"arj",mime:"application/x-arj"};if(this.check([239,187,191]))return this.tokenizer.ignore(3),this.parse(e);if(this.check([71,73,70]))return{ext:"gif",mime:"image/gif"};if(this.check([73,73,188]))return{ext:"jxr",mime:"image/vnd.ms-photo"};if(this.check([31,139,8]))return{ext:"gz",mime:"application/gzip"};if(this.check([66,90,104]))return{ext:"bz2",mime:"application/x-bzip2"};if(this.checkString("ID3")){await e.ignore(6);const t=await e.readToken(Jh);return e.position+t>e.fileInfo.size?{ext:"mp3",mime:"audio/mpeg"}:(await e.ignore(t),this.fromTokenizer(e))}if(this.checkString("MP+"))return{ext:"mpc",mime:"audio/x-musepack"};if((67===this.buffer[0]||70===this.buffer[0])&&this.check([87,83],{offset:1}))return{ext:"swf",mime:"application/x-shockwave-flash"};if(this.check([255,216,255]))return this.check([247],{offset:3})?{ext:"jls",mime:"image/jls"}:{ext:"jpg",mime:"image/jpeg"};if(this.check([79,98,106,1]))return{ext:"avro",mime:"application/avro"};if(this.checkString("FLIF"))return{ext:"flif",mime:"image/flif"};if(this.checkString("8BPS"))return{ext:"psd",mime:"image/vnd.adobe.photoshop"};if(this.checkString("WEBP",{offset:8}))return{ext:"webp",mime:"image/webp"};if(this.checkString("MPCK"))return{ext:"mpc",mime:"audio/x-musepack"};if(this.checkString("FORM"))return{ext:"aif",mime:"audio/aiff"};if(this.checkString("icns",{offset:0}))return{ext:"icns",mime:"image/icns"};if(this.check([80,75,3,4])){try{for(;e.position+30<e.fileInfo.size;){await e.readBuffer(this.buffer,{length:30});const n=new DataView(this.buffer.buffer),r={compressedSize:n.getUint32(18,!0),uncompressedSize:n.getUint32(22,!0),filenameLength:n.getUint16(26,!0),extraFieldLength:n.getUint16(28,!0)};if(r.filename=await e.readToken(new Uh(r.filenameLength,"utf-8")),await e.ignore(r.extraFieldLength),/classes\d*\.dex/.test(r.filename))return{ext:"apk",mime:"application/vnd.android.package-archive"};if("META-INF/mozilla.rsa"===r.filename)return{ext:"xpi",mime:"application/x-xpinstall"};if(r.filename.endsWith(".rels")||r.filename.endsWith(".xml")){switch(r.filename.split("/")[0]){case"_rels":default:break;case"word":return{ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"};case"ppt":return{ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"};case"xl":return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};case"visio":return{ext:"vsdx",mime:"application/vnd.visio"}}}if(r.filename.startsWith("xl/"))return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};if(r.filename.startsWith("3D/")&&r.filename.endsWith(".model"))return{ext:"3mf",mime:"model/3mf"};if("mimetype"===r.filename&&r.compressedSize===r.uncompressedSize){let i=await e.readToken(new Uh(r.compressedSize,"utf-8"));switch(i=i.trim(),i){case"application/epub+zip":return{ext:"epub",mime:"application/epub+zip"};case"application/vnd.oasis.opendocument.text":return{ext:"odt",mime:"application/vnd.oasis.opendocument.text"};case"application/vnd.oasis.opendocument.spreadsheet":return{ext:"ods",mime:"application/vnd.oasis.opendocument.spreadsheet"};case"application/vnd.oasis.opendocument.presentation":return{ext:"odp",mime:"application/vnd.oasis.opendocument.presentation"}}}if(0===r.compressedSize){let a=-1;for(;a<0&&e.position<e.fileInfo.size;)await e.peekBuffer(this.buffer,{mayBeLess:!0}),a=Kh(this.buffer,new Uint8Array([80,75,3,4])),await e.ignore(a>=0?a:this.buffer.length)}else await e.ignore(r.compressedSize)}}catch(o){if(!(o instanceof Bh))throw o}return{ext:"zip",mime:"application/zip"}}if(this.checkString("OggS")){await e.ignore(28);const s=new Uint8Array(8);return await e.readBuffer(s),Qh(s,[79,112,117,115,72,101,97,100])?{ext:"opus",mime:"audio/ogg; codecs=opus"}:Qh(s,[128,116,104,101,111,114,97])?{ext:"ogv",mime:"video/ogg"}:Qh(s,[1,118,105,100,101,111,0])?{ext:"ogm",mime:"video/ogg"}:Qh(s,[127,70,76,65,67])?{ext:"oga",mime:"audio/ogg"}:Qh(s,[83,112,101,101,120,32,32])?{ext:"spx",mime:"audio/ogg"}:Qh(s,[1,118,111,114,98,105,115])?{ext:"ogg",mime:"audio/ogg"}:{ext:"ogx",mime:"application/ogg"}}if(this.check([80,75])&&(3===this.buffer[2]||5===this.buffer[2]||7===this.buffer[2])&&(4===this.buffer[3]||6===this.buffer[3]||8===this.buffer[3]))return{ext:"zip",mime:"application/zip"};if(this.checkString("ftyp",{offset:4})&&96&this.buffer[8]){const u=new Uh(4,"latin1").get(this.buffer,8).replace("\0"," ").trim();switch(u){case"avif":case"avis":return{ext:"avif",mime:"image/avif"};case"mif1":return{ext:"heic",mime:"image/heif"};case"msf1":return{ext:"heic",mime:"image/heif-sequence"};case"heic":case"heix":return{ext:"heic",mime:"image/heic"};case"hevc":case"hevx":return{ext:"heic",mime:"image/heic-sequence"};case"qt":return{ext:"mov",mime:"video/quicktime"};case"M4V":case"M4VH":case"M4VP":return{ext:"m4v",mime:"video/x-m4v"};case"M4P":return{ext:"m4p",mime:"video/mp4"};case"M4B":return{ext:"m4b",mime:"audio/mp4"};case"M4A":return{ext:"m4a",mime:"audio/x-m4a"};case"F4V":return{ext:"f4v",mime:"video/mp4"};case"F4P":return{ext:"f4p",mime:"video/mp4"};case"F4A":return{ext:"f4a",mime:"audio/mp4"};case"F4B":return{ext:"f4b",mime:"audio/mp4"};case"crx":return{ext:"cr3",mime:"image/x-canon-cr3"};default:return u.startsWith("3g")?u.startsWith("3g2")?{ext:"3g2",mime:"video/3gpp2"}:{ext:"3gp",mime:"video/3gpp"}:{ext:"mp4",mime:"video/mp4"}}}if(this.checkString("MThd"))return{ext:"mid",mime:"audio/midi"};if(this.checkString("wOFF")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return{ext:"woff",mime:"font/woff"};if(this.checkString("wOF2")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return{ext:"woff2",mime:"font/woff2"};if(this.check([212,195,178,161])||this.check([161,178,195,212]))return{ext:"pcap",mime:"application/vnd.tcpdump.pcap"};if(this.checkString("DSD "))return{ext:"dsf",mime:"audio/x-dsf"};if(this.checkString("LZIP"))return{ext:"lz",mime:"application/x-lzip"};if(this.checkString("fLaC"))return{ext:"flac",mime:"audio/x-flac"};if(this.check([66,80,71,251]))return{ext:"bpg",mime:"image/bpg"};if(this.checkString("wvpk"))return{ext:"wv",mime:"audio/wavpack"};if(this.checkString("%PDF")){try{await e.ignore(1350);const c=10485760,l=new Uint8Array(Math.min(c,e.fileInfo.size));if(await e.readBuffer(l,{mayBeLess:!0}),function(e,t){return-1!==Kh(e,t)}(l,(new TextEncoder).encode("AIPrivateData")))return{ext:"ai",mime:"application/postscript"}}catch(d){if(!(d instanceof Bh))throw d}return{ext:"pdf",mime:"application/pdf"}}if(this.check([0,97,115,109]))return{ext:"wasm",mime:"application/wasm"};if(this.check([73,73])){const f=await this.readTiffHeader(!1);if(f)return f}if(this.check([77,77])){const p=await this.readTiffHeader(!0);if(p)return p}if(this.checkString("MAC "))return{ext:"ape",mime:"audio/ape"};if(this.check([26,69,223,163])){async function h(){const t=await e.peekNumber($h);let n=128,r=0;for(;!(t&n)&&0!==n;)++r,n>>=1;const i=new Uint8Array(r+1);return await e.readBuffer(i),i}async function m(){const e=await h(),t=await h();t[0]^=128>>t.length-1;const n=Math.min(6,t.length),r=new DataView(e.buffer),i=new DataView(t.buffer,t.length-n,n);return{id:qh(r),len:qh(i)}}async function g(t){for(;t>0;){const n=await m();if(17026===n.id){return(await e.readToken(new Uh(n.len))).replaceAll(/\00.*$/g,"")}await e.ignore(n.len),--t}}const y=await m();switch(await g(y.len)){case"webm":return{ext:"webm",mime:"video/webm"};case"matroska":return{ext:"mkv",mime:"video/x-matroska"};default:return}}if(this.check([82,73,70,70])){if(this.check([65,86,73],{offset:8}))return{ext:"avi",mime:"video/vnd.avi"};if(this.check([87,65,86,69],{offset:8}))return{ext:"wav",mime:"audio/wav"};if(this.check([81,76,67,77],{offset:8}))return{ext:"qcp",mime:"audio/qcelp"}}if(this.checkString("SQLi"))return{ext:"sqlite",mime:"application/x-sqlite3"};if(this.check([78,69,83,26]))return{ext:"nes",mime:"application/x-nintendo-nes-rom"};if(this.checkString("Cr24"))return{ext:"crx",mime:"application/x-google-chrome-extension"};if(this.checkString("MSCF")||this.checkString("ISc("))return{ext:"cab",mime:"application/vnd.ms-cab-compressed"};if(this.check([237,171,238,219]))return{ext:"rpm",mime:"application/x-rpm"};if(this.check([197,208,211,198]))return{ext:"eps",mime:"application/eps"};if(this.check([40,181,47,253]))return{ext:"zst",mime:"application/zstd"};if(this.check([127,69,76,70]))return{ext:"elf",mime:"application/x-elf"};if(this.check([33,66,68,78]))return{ext:"pst",mime:"application/vnd.ms-outlook"};if(this.checkString("PAR1"))return{ext:"parquet",mime:"application/x-parquet"};if(this.check([207,250,237,254]))return{ext:"macho",mime:"application/x-mach-binary"};if(this.check([79,84,84,79,0]))return{ext:"otf",mime:"font/otf"};if(this.checkString("#!AMR"))return{ext:"amr",mime:"audio/amr"};if(this.checkString("{\\rtf"))return{ext:"rtf",mime:"application/rtf"};if(this.check([70,76,86,1]))return{ext:"flv",mime:"video/x-flv"};if(this.checkString("IMPM"))return{ext:"it",mime:"audio/x-it"};if(this.checkString("-lh0-",{offset:2})||this.checkString("-lh1-",{offset:2})||this.checkString("-lh2-",{offset:2})||this.checkString("-lh3-",{offset:2})||this.checkString("-lh4-",{offset:2})||this.checkString("-lh5-",{offset:2})||this.checkString("-lh6-",{offset:2})||this.checkString("-lh7-",{offset:2})||this.checkString("-lzs-",{offset:2})||this.checkString("-lz4-",{offset:2})||this.checkString("-lz5-",{offset:2})||this.checkString("-lhd-",{offset:2}))return{ext:"lzh",mime:"application/x-lzh-compressed"};if(this.check([0,0,1,186])){if(this.check([33],{offset:4,mask:[241]}))return{ext:"mpg",mime:"video/MP1S"};if(this.check([68],{offset:4,mask:[196]}))return{ext:"mpg",mime:"video/MP2P"}}if(this.checkString("ITSF"))return{ext:"chm",mime:"application/vnd.ms-htmlhelp"};if(this.check([202,254,186,190]))return{ext:"class",mime:"application/java-vm"};if(this.check([253,55,122,88,90,0]))return{ext:"xz",mime:"application/x-xz"};if(this.checkString("<?xml "))return{ext:"xml",mime:"application/xml"};if(this.check([55,122,188,175,39,28]))return{ext:"7z",mime:"application/x-7z-compressed"};if(this.check([82,97,114,33,26,7])&&(0===this.buffer[6]||1===this.buffer[6]))return{ext:"rar",mime:"application/x-rar-compressed"};if(this.checkString("solid "))return{ext:"stl",mime:"model/stl"};if(this.checkString("AC")){const _=new Uh(4,"latin1").get(this.buffer,2);if(_.match("^d*")&&_>=1e3&&_<=1050)return{ext:"dwg",mime:"image/vnd.dwg"}}if(this.checkString("070707"))return{ext:"cpio",mime:"application/x-cpio"};if(this.checkString("BLENDER"))return{ext:"blend",mime:"application/x-blender"};if(this.checkString("!<arch>")){await e.ignore(8);return"debian-binary"===await e.readToken(new Uh(13,"ascii"))?{ext:"deb",mime:"application/x-deb"}:{ext:"ar",mime:"application/x-unix-archive"}}if(this.checkString("WEBVTT")&&["\n","\r","\t"," ","\0"].some((e=>this.checkString(e,{offset:6}))))return{ext:"vtt",mime:"text/vtt"};if(this.check([137,80,78,71,13,10,26,10])){async function v(){return{length:await e.readToken(jh),type:await e.readToken(new Uh(4,"latin1"))}}await e.ignore(8);do{const b=await v();if(b.length<0)return;switch(b.type){case"IDAT":return{ext:"png",mime:"image/png"};case"acTL":return{ext:"apng",mime:"image/apng"};default:await e.ignore(b.length+4)}}while(e.position+8<e.fileInfo.size);return{ext:"png",mime:"image/png"}}if(this.check([65,82,82,79,87,49,0,0]))return{ext:"arrow",mime:"application/x-apache-arrow"};if(this.check([103,108,84,70,2,0,0,0]))return{ext:"glb",mime:"model/gltf-binary"};if(this.check([102,114,101,101],{offset:4})||this.check([109,100,97,116],{offset:4})||this.check([109,111,111,118],{offset:4})||this.check([119,105,100,101],{offset:4}))return{ext:"mov",mime:"video/quicktime"};if(this.check([73,73,82,79,8,0,0,0,24]))return{ext:"orf",mime:"image/x-olympus-orf"};if(this.checkString("gimp xcf "))return{ext:"xcf",mime:"image/x-xcf"};if(this.check([73,73,85,0,24,0,0,0,136,231,116,216]))return{ext:"rw2",mime:"image/x-panasonic-rw2"};if(this.check([48,38,178,117,142,102,207,17,166,217])){async function E(){const t=new Uint8Array(16);return await e.readBuffer(t),{id:t,size:Number(await e.readToken(Zh))}}for(await e.ignore(30);e.position+24<e.fileInfo.size;){const S=await E();let A=S.size-24;if(Qh(S.id,[145,7,220,183,183,169,207,17,142,230,0,192,12,32,83,101])){const x=new Uint8Array(16);if(A-=await e.readBuffer(x),Qh(x,[64,158,105,248,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"audio/x-ms-asf"};if(Qh(x,[192,239,25,188,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"video/x-ms-asf"};break}await e.ignore(A)}return{ext:"asf",mime:"application/vnd.ms-asf"}}if(this.check([171,75,84,88,32,49,49,187,13,10,26,10]))return{ext:"ktx",mime:"image/ktx"};if((this.check([126,16,4])||this.check([126,24,4]))&&this.check([48,77,73,69],{offset:4}))return{ext:"mie",mime:"application/x-mie"};if(this.check([39,10,0,0,0,0,0,0,0,0,0,0],{offset:2}))return{ext:"shp",mime:"application/x-esri-shape"};if(this.check([255,79,255,81]))return{ext:"j2c",mime:"image/j2c"};if(this.check([0,0,0,12,106,80,32,32,13,10,135,10])){await e.ignore(20);switch(await e.readToken(new Uh(4,"ascii"))){case"jp2 ":return{ext:"jp2",mime:"image/jp2"};case"jpx ":return{ext:"jpx",mime:"image/jpx"};case"jpm ":return{ext:"jpm",mime:"image/jpm"};case"mjp2":return{ext:"mj2",mime:"image/mj2"};default:return}}if(this.check([255,10])||this.check([0,0,0,12,74,88,76,32,13,10,135,10]))return{ext:"jxl",mime:"image/jxl"};if(this.check([254,255]))return this.check([0,60,0,63,0,120,0,109,0,108],{offset:2})?{ext:"xml",mime:"application/xml"}:void 0;if(this.check([0,0,1,186])||this.check([0,0,1,179]))return{ext:"mpg",mime:"video/mpeg"};if(this.check([0,1,0,0,0]))return{ext:"ttf",mime:"font/ttf"};if(this.check([0,0,1,0]))return{ext:"ico",mime:"image/x-icon"};if(this.check([0,0,2,0]))return{ext:"cur",mime:"image/x-icon"};if(this.check([208,207,17,224,161,177,26,225]))return{ext:"cfb",mime:"application/x-cfb"};if(await e.peekBuffer(this.buffer,{length:Math.min(256,e.fileInfo.size),mayBeLess:!0}),this.check([97,99,115,112],{offset:36}))return{ext:"icc",mime:"application/vnd.iccprofile"};if(this.checkString("**ACE",{offset:7})&&this.checkString("**",{offset:12}))return{ext:"ace",mime:"application/x-ace-compressed"};if(this.checkString("BEGIN:")){if(this.checkString("VCARD",{offset:6}))return{ext:"vcf",mime:"text/vcard"};if(this.checkString("VCALENDAR",{offset:6}))return{ext:"ics",mime:"text/calendar"}}if(this.checkString("FUJIFILMCCD-RAW"))return{ext:"raf",mime:"image/x-fujifilm-raf"};if(this.checkString("Extended Module:"))return{ext:"xm",mime:"audio/x-xm"};if(this.checkString("Creative Voice File"))return{ext:"voc",mime:"audio/x-voc"};if(this.check([4,0,0,0])&&this.buffer.length>=16){const w=new DataView(this.buffer.buffer).getUint32(12,!0);if(w>12&&this.buffer.length>=w+16)try{const T=(new TextDecoder).decode(this.buffer.slice(16,w+16));if(JSON.parse(T).files)return{ext:"asar",mime:"application/x-asar"}}catch{}}if(this.check([6,14,43,52,2,5,1,1,13,1,2,1,1,2]))return{ext:"mxf",mime:"application/mxf"};if(this.checkString("SCRM",{offset:44}))return{ext:"s3m",mime:"audio/x-s3m"};if(this.check([71])&&this.check([71],{offset:188}))return{ext:"mts",mime:"video/mp2t"};if(this.check([71],{offset:4})&&this.check([71],{offset:196}))return{ext:"mts",mime:"video/mp2t"};if(this.check([66,79,79,75,77,79,66,73],{offset:60}))return{ext:"mobi",mime:"application/x-mobipocket-ebook"};if(this.check([68,73,67,77],{offset:128}))return{ext:"dcm",mime:"application/dicom"};if(this.check([76,0,0,0,1,20,2,0,0,0,0,0,192,0,0,0,0,0,0,70]))return{ext:"lnk",mime:"application/x.ms.shortcut"};if(this.check([98,111,111,107,0,0,0,0,109,97,114,107,0,0,0,0]))return{ext:"alias",mime:"application/x.apple.alias"};if(this.checkString("Kaydara FBX Binary \0"))return{ext:"fbx",mime:"application/x.autodesk.fbx"};if(this.check([76,80],{offset:34})&&(this.check([0,0,1],{offset:8})||this.check([1,0,2],{offset:8})||this.check([2,0,2],{offset:8})))return{ext:"eot",mime:"application/vnd.ms-fontobject"};if(this.check([6,6,237,245,216,29,70,229,189,49,239,231,254,116,183,29]))return{ext:"indd",mime:"application/x-indesign"};if(await e.peekBuffer(this.buffer,{length:Math.min(512,e.fileInfo.size),mayBeLess:!0}),function(e,t=0){const n=Number.parseInt(new Uh(6).get(e,148).replace(/\0.*$/,"").trim(),8);if(Number.isNaN(n))return!1;let r=256;for(let n=t;n<t+148;n++)r+=e[n];for(let n=t+156;n<t+512;n++)r+=e[n];return n===r}(this.buffer))return{ext:"tar",mime:"application/x-tar"};if(this.check([255,254]))return this.check([60,0,63,0,120,0,109,0,108,0],{offset:2})?{ext:"xml",mime:"application/xml"}:this.check([255,14,83,0,107,0,101,0,116,0,99,0,104,0,85,0,112,0,32,0,77,0,111,0,100,0,101,0,108,0],{offset:2})?{ext:"skp",mime:"application/vnd.sketchup.skp"}:void 0;if(this.checkString("-----BEGIN PGP MESSAGE-----"))return{ext:"pgp",mime:"application/pgp-encrypted"};if(this.buffer.length>=2&&this.check([255,224],{offset:0,mask:[255,224]})){if(this.check([16],{offset:1,mask:[22]}))return this.check([8],{offset:1,mask:[8]}),{ext:"aac",mime:"audio/aac"};if(this.check([2],{offset:1,mask:[6]}))return{ext:"mp3",mime:"audio/mpeg"};if(this.check([4],{offset:1,mask:[6]}))return{ext:"mp2",mime:"audio/mpeg"};if(this.check([6],{offset:1,mask:[6]}))return{ext:"mp1",mime:"audio/mpeg"}}}async readTiffTag(e){const t=await this.tokenizer.readToken(e?Fh:Rh);switch(this.tokenizer.ignore(10),t){case 50341:return{ext:"arw",mime:"image/x-sony-arw"};case 50706:return{ext:"dng",mime:"image/x-adobe-dng"}}}async readTiffIFD(e){const t=await this.tokenizer.readToken(e?Fh:Rh);for(let n=0;n<t;++n){const t=await this.readTiffTag(e);if(t)return t}}async readTiffHeader(e){const t=(e?Fh:Rh).get(this.buffer,2),n=(e?Ph:zh).get(this.buffer,4);if(42===t){if(n>=6){if(this.checkString("CR",{offset:8}))return{ext:"cr2",mime:"image/x-canon-cr2"};if(n>=8&&(this.check([28,0,254,0],{offset:8})||this.check([31,0,11,0],{offset:8})))return{ext:"nef",mime:"image/x-nikon-nef"}}await this.tokenizer.ignore(n);return await this.readTiffIFD(e)??{ext:"tif",mime:"image/tiff"}}if(43===t)return{ext:"tif",mime:"image/tiff"}}}new Set(["jpg","png","apng","gif","webp","flif","xcf","cr2","cr3","orf","arw","dng","nef","rw2","raf","tif","bmp","icns","jxr","psd","indd","zip","tar","rar","gz","bz2","7z","dmg","mp4","mid","mkv","webm","mov","avi","mpg","mp2","mp3","m4a","oga","ogg","ogv","opus","flac","wav","spx","amr","pdf","epub","elf","macho","exe","swf","rtf","wasm","woff","woff2","eot","ttf","otf","ico","flv","ps","xz","sqlite","nes","crx","xpi","cab","deb","ar","rpm","Z","lz","cfb","mxf","mts","blend","bpg","docx","pptx","xlsx","3gp","3g2","j2c","jp2","jpm","jpx","mj2","aif","qcp","odt","ods","odp","xml","mobi","heic","cur","ktx","ape","wv","dcm","ics","glb","pcap","dsf","lnk","alias","voc","ac3","m4v","m4p","m4b","f4v","f4p","f4b","f4a","mie","asf","ogm","ogx","mpc","arrow","shp","aac","mp1","it","s3m","xm","ai","skp","avif","eps","lzh","pgp","asar","stl","chm","3mf","zst","jxl","vcf","jls","pst","dwg","parquet","class","arj","cpio","ace","avro","icc","fbx","vsdx","vtt","apk"]),new Set(["image/jpeg","image/png","image/gif","image/webp","image/flif","image/x-xcf","image/x-canon-cr2","image/x-canon-cr3","image/tiff","image/bmp","image/vnd.ms-photo","image/vnd.adobe.photoshop","application/x-indesign","application/epub+zip","application/x-xpinstall","application/vnd.oasis.opendocument.text","application/vnd.oasis.opendocument.spreadsheet","application/vnd.oasis.opendocument.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/zip","application/x-tar","application/x-rar-compressed","application/gzip","application/x-bzip2","application/x-7z-compressed","application/x-apple-diskimage","application/x-apache-arrow","video/mp4","audio/midi","video/x-matroska","video/webm","video/quicktime","video/vnd.avi","audio/wav","audio/qcelp","audio/x-ms-asf","video/x-ms-asf","application/vnd.ms-asf","video/mpeg","video/3gpp","audio/mpeg","audio/mp4","video/ogg","audio/ogg","audio/ogg; codecs=opus","application/ogg","audio/x-flac","audio/ape","audio/wavpack","audio/amr","application/pdf","application/x-elf","application/x-mach-binary","application/x-msdownload","application/x-shockwave-flash","application/rtf","application/wasm","font/woff","font/woff2","application/vnd.ms-fontobject","font/ttf","font/otf","image/x-icon","video/x-flv","application/postscript","application/eps","application/x-xz","application/x-sqlite3","application/x-nintendo-nes-rom","application/x-google-chrome-extension","application/vnd.ms-cab-compressed","application/x-deb","application/x-unix-archive","application/x-rpm","application/x-compress","application/x-lzip","application/x-cfb","application/x-mie","application/mxf","video/mp2t","application/x-blender","image/bpg","image/j2c","image/jp2","image/jpx","image/jpm","image/mj2","audio/aiff","application/xml","application/x-mobipocket-ebook","image/heif","image/heif-sequence","image/heic","image/heic-sequence","image/icns","image/ktx","application/dicom","audio/x-musepack","text/calendar","text/vcard","text/vtt","model/gltf-binary","application/vnd.tcpdump.pcap","audio/x-dsf","application/x.ms.shortcut","application/x.apple.alias","audio/x-voc","audio/vnd.dolby.dd-raw","audio/x-m4a","image/apng","image/x-olympus-orf","image/x-sony-arw","image/x-adobe-dng","image/x-nikon-nef","image/x-panasonic-rw2","image/x-fujifilm-raf","video/x-m4v","video/3gpp2","application/x-esri-shape","audio/aac","audio/x-it","audio/x-s3m","audio/x-xm","video/MP1S","video/MP2P","application/vnd.sketchup.skp","image/avif","application/x-lzh-compressed","application/pgp-encrypted","application/x-asar","model/stl","application/vnd.ms-htmlhelp","model/3mf","image/jxl","application/zstd","image/jls","application/vnd.ms-outlook","image/vnd.dwg","application/x-parquet","application/java-vm","application/x-arj","application/x-cpio","application/x-ace-compressed","application/avro","application/vnd.iccprofile","application/x.autodesk.fbx","application/vnd.visio","application/vnd.android.package-archive"]),exports.FileHelper=void 0,function(e){e.truncateFileName=(e,n)=>{let r,i=e,a=0;if(n&&n.current&&(r=t(n.current),a=n.current.getBoundingClientRect().width),r&&r.measureText(e).width>a){const t="...";let n="",o="",s=0,u=e.length-1,c=t,l=c;for(;s<u;){if(n+=e.charAt(s),c=n+t+o,r.measureText(c).width>a){i=l;break}if(l=c,o=e.charAt(u)+o,c=n+t+o,r.measureText(c).width>a){i=l;break}l=c,s++,u--}}return i};const t=e=>{const t=document.createDocumentFragment(),n=document.createElement("canvas");t.appendChild(n);const r=n.getContext("2d"),i=window.getComputedStyle(e);return r.font=i.font?i.font:`${i.fontSize}" "${i.fontFamily}`,r};e.fileToDataUrl=async e=>{if(window&&window.FileReader)return new Promise(((t,n)=>{const r=new FileReader;r.readAsDataURL(e),r.onload=()=>t(r.result),r.onerror=e=>n(e)}))},e.dataUrlToBlob=async e=>(await fetch(e)).blob(),e.getFilesizeFromBase64=e=>{const t=e.length;return.75*t-(e.substring(t-2,2).match(/=/g)?.length||0)},e.extensionsToSentence=e=>{const t=e.map((e=>`.${e.toUpperCase()}`)),n=t.indexOf(".JPG");return n>-1&&t.splice(n+1,0,".JPEG"),new Intl.ListFormat("en-GB",{style:"long",type:"disjunction"}).format(t)},e.fileExtensionToMimeType=e=>{switch(e.toLowerCase()){case"jpg":case"jpeg":return"image/jpeg";case"png":return"image/png";case"gif":return"image/gif";case"heic":return"image/heic";case"heif":return"image/heif";case"webp":return"image/webp"}},e.getType=async e=>{const t=await e.arrayBuffer(),n=await async function(e){return(new em).fromBuffer(e)}(t);if(!n&&e.type.startsWith("text")){const t=e.name||".txt";return{mime:e.type,ext:t.substring(t.lastIndexOf(".")+1,t.length)}}return n},e.deduplicateFileName=(t,n,r,i=r,a=1)=>{if(t.filter(((e,t)=>t!==n)).includes(r)){const o=i.split("."),s=o.pop();return s?(r=o.join(".").concat(` (${a}).`).concat(s),e.deduplicateFileName(t,n,r,i,++a)):r}return r},e.sanitizeFileName=e=>{const t=e.split(".");let n,r;2===t.length&&""===t[0]?r=e:t.length>1?(n=t.pop(),r=t.join(".")):r=t.join(".");let i=r.replace(/[^\u0020-\u007E]*/g,"");return i||(i="file"),n?`${i}.${n}`:`${i}`},e.blobToFile=(e,t)=>{const{name:n,lastModified:r}=t;return new File([e],n,{type:e.type,lastModified:r})}}(exports.FileHelper||(exports.FileHelper={}));const tm={COMMON:{FIELD_REQUIRED:"This field is required.",REQUIRED_OPTION:"An option is required.",REQUIRED_OPTIONS:"Both options are required."},CONTACT:{INVALID_SINGAPORE_NUMBER:"Invalid Singapore number.",INVALID_INTERNATIONAL_NUMBER:"Invalid international number."},DATE:{MUST_BE_FUTURE:"Date must be in the future.",MUST_BE_PAST:"Date must be in the past.",CANNOT_BE_FUTURE:"Date cannot be in the future.",CANNOT_BE_PAST:"Date cannot be in the past.",MIN_DATE:e=>`Date cannot be earlier than ${e}.`,MAX_DATE:e=>`Date cannot be later than ${e}.`,DISABLED_DATES:"Date is not allowed.",INVALID:"Invalid date.",WITHIN_DAYS:e=>{const{numberOfDays:t,fromDate:n}=e,r=Math.abs(t);return`Date must be within ${r} ${1!==r?"days":"day"} ${t>0?"from":"prior to"} ${n?` ${n}`:" today"}.`},BEYOND_DAYS:e=>{const{numberOfDays:t,fromDate:n}=e,r=Math.abs(t);return`Date must be beyond ${r} ${1!==r?"days":"day"} ${t>0?"from":"prior to"} ${n?` ${n}`:" today"}.`}},DATE_RANGE:{MUST_BE_FUTURE:"Dates must be in the future.",MUST_BE_PAST:"Dates must be in the past.",CANNOT_BE_FUTURE:"Dates cannot be in the future.",CANNOT_BE_PAST:"Dates cannot be in the past.",MIN_DATE:e=>`Dates cannot be earlier than ${e}.`,MAX_DATE:e=>`Dates cannot be later than ${e}.`,DISABLED_DATES:"Date range should not include disabled dates.",INVALID:"Invalid dates",REQUIRED:"Both dates are required",MUST_HAVE_NUMBER_OF_DAYS:e=>`Selection should have ${e} days.`},EMAIL:{INVALID:"Invalid email address."},ESIGNATURE:{UPLOAD:"Signature not uploaded."},GENERIC:{INVALID:"Invalid input",UNSUPPORTED:"This component is not supported by the engine."},UPLOAD:(t="file",n=`${t}s`)=>({REQUIRED:`Upload at least 1 ${t}.`,MAX_FILES:e=>`Upload failed. You can only upload a maximum of ${e} ${1!==e?n:t}.`,MAX_FILES_WITH_REMAINING:e=>`Upload failed. You can only upload ${e} more ${1===e?t:n}. To upload more ${n}, you may wish to delete your previously uploaded ${n}.`,MAX_FILE_SIZE:e=>`Upload failed. ${Ih(t)} exceeds the maximum size of ${e} KB.`,GENERIC:"Upload failed. Please try again.",FILE_TYPE:e=>`Upload failed. Only ${exports.FileHelper.extensionsToSentence(e)} files are accepted.`,MODAL:{FILE_TYPE:{TITLE:`Unsupported ${t} format`,DESCRIPTION:(t,n)=>e.jsxs(e.Fragment,{children:[t," could not be uploaded. Try again with a"," ",exports.FileHelper.extensionsToSentence(n)," file."]})},GENERIC_ERROR:{TITLE:`${Ih(t)} not uploaded`,DESCRIPTION:t=>e.jsxs(e.Fragment,{children:["There was a problem uploading ",t,". Please try again."]})},MAX_FILE_SIZE:{TITLE:`${Ih(t)} exceeds maximum size`,DESCRIPTION:(t,n)=>e.jsxs(e.Fragment,{children:[t," exceeds the maximum size of ",n," KB."]})}}}),SLIDER:{MUST_BE_INCREMENTAL:"Input must be incremental."},UNIT_NUMBER:{INVALID:"Invalid unit number."},LOCATION:{MUST_HAVE_POSTAL_CODE:"Selected location must have postal code."},ARRAY_FIELD:{INVALID:"One or more of the sections is incomplete",REQUIRED:"At least one section must be filled in"}};var nm;!function(e){function t(e,t,n){if(e)try{const r=qd.ofPattern(t).withResolverStyle(Wl.STRICT).withLocale(jp.ENGLISH);switch(n){case"date":return mf.parse(e,r);case"time":return _f.parse(e,r);case"datetime":return yf.parse(e,r);default:return}}catch(e){return}}function n(e){const{numberOfDays:n,fromDate:r,dateFormat:i="uuuu-MM-dd"}=e,a=r&&t(r,i,"date")||mf.now();return n>=0?{startDate:a,endDate:a.plusDays(n)}:{startDate:a.plusDays(n),endDate:a}}e.formatDateTime=(e,t,n,r)=>{if(e)try{const i=qd.ofPattern(t).withResolverStyle(Wl.STRICT).withLocale(jp.ENGLISH);switch(n){case"date":return mf.parse(e).format(i);case"time":return _f.parse(e).format(i);case"datetime":return yf.parse(e).format(i);default:return r||tm.GENERIC.INVALID}}catch(e){return r||tm.GENERIC.INVALID}},e.toLocalDateOrTime=t,e.calculateWithinDaysRange=n,e.calculateDisabledWithinDaysRange=function(e){const{numberOfDays:t,inclusive:r}=e,{startDate:i,endDate:a}=n(e);return t>=0?{startDate:r?i:i.plusDays(1),endDate:a}:{startDate:i,endDate:r?a:a.minusDays(1)}},e.calculateDisabledBeyondDaysRange=function(e){const{numberOfDays:n,fromDate:r,dateFormat:i="uuuu-MM-dd"}=e,a=r&&t(r,i,"date")||mf.now(),o={startDate:void 0,endDate:void 0};return n>=0?o.startDate=a.plusDays(n+1):o.endDate=a.plusDays(n-1),o},e.checkWithinDays=function(e,r){if(!e)return!0;const{dateFormat:i="uuuu-MM-dd"}=r,a=t(e,i,"date");if(!a)return!1;const{startDate:o,endDate:s}=n(r),{numberOfDays:u,inclusive:c}=r;if(u>=0){const e=c?o.minusDays(1):o,t=s.plusDays(1);return a.isAfter(e)&&a.isBefore(t)}{const e=o.minusDays(1),t=c?s.plusDays(1):s;return a.isAfter(e)&&a.isBefore(t)}},e.checkBeyondDays=function(e,n){if(!e)return!0;const{dateFormat:r="uuuu-MM-dd"}=n,i=t(e,r,"date");if(!i)return!1;const{numberOfDays:a,fromDate:o}=n,s=o&&t(o,r,"date")||mf.now();return a>=0?i.isAfter(s.plusDays(a)):i.isBefore(s.plusDays(a))}}(nm||(nm={})),exports.GeoLocationHelper=void 0,function(e){const t=async(e,t)=>new Promise(((n,r)=>{"geolocation"in navigator?navigator.geolocation.getCurrentPosition((({coords:e})=>n({lat:e.latitude,lng:e.longitude})),(e=>r(e)),{enableHighAccuracy:!0,timeout:e,maximumAge:t}):r(new Error("geolocation not supported in this browser"))}));e.getCurrentLocation=async(e={})=>{const{maxAttempts:n=3,timeout:r=2e3,maximumAge:i=2e3}=e;let a=0;do{a++;try{return await t(r,i)}catch(e){if(a>=n||!e||e.code!==e.TIMEOUT)throw e}}while(a<n);throw"Failed to get current location"}}(exports.GeoLocationHelper||(exports.GeoLocationHelper={}));const rm=()=>Array(5).fill(0).map((()=>Math.random().toString(36).slice(2))).join("");class im{constructor(e){if(function(e){return"object"!=typeof e||void 0===e.length||void 0===e.readUInt8||void 0===e.readUInt16LE||void 0===e.readUInt16BE||void 0===e.readUInt32LE||void 0===e.readUInt32BE||void 0===e.readInt32LE||void 0===e.readInt32BE}(e))throw new Error("DataView: Passed buffer type is unsupported.");this.buffer=e,this.byteLength=this.buffer.length}getUint8(e){return this.buffer.readUInt8(e)}getUint16(e,t){return t?this.buffer.readUInt16LE(e):this.buffer.readUInt16BE(e)}getUint32(e,t){return t?this.buffer.readUInt32LE(e):this.buffer.readUInt32BE(e)}getInt32(e,t){return t?this.buffer.readInt32LE(e):this.buffer.readInt32BE(e)}}function am(e,t,n){try{return new DataView(e,t,n)}catch(r){return new im(e,t,n)}}function om(e,t,n){const r=[];for(let i=0;i<n&&t+i<e.byteLength;i++)r.push(e.getUint8(t+i));return lm(r)}function sm(e,t){const n=[];let r=0;for(;t+r<e.byteLength;){const i=e.getUint8(t+r);if(0===i)break;n.push(i),r++}return lm(n)}function um(e,t,n){const r=[];for(let i=0;i<n&&t+i<e.byteLength;i+=2)r.push(e.getUint16(t+i));return 0===r[r.length-1]&&r.pop(),lm(r)}function cm(e,t){const n=e.getUint8(t);return[n,om(e,t+1,n)]}function lm(e){return e.map((e=>String.fromCharCode(e))).join("")}function dm(){for(let e=1;e<arguments.length;e++)for(const t in arguments[e])arguments[0][t]=arguments[e][t];return arguments[0]}function fm(e,t,n){let r=!1;Object.defineProperty(e,t,{get:()=>(r||(r=!0,Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:n.apply(e),writable:!0})),e[t]),configurable:!0,enumerable:!0})}function pm(e){return"undefined"!=typeof btoa?"string"==typeof e?btoa(e):btoa(Array.prototype.reduce.call(new Uint8Array(e),((e,t)=>e+String.fromCharCode(t)),"")):"undefined"!=typeof Buffer?void 0!==Buffer.from?Buffer.from(e).toString("base64"):new Buffer(e).toString("base64"):void 0}function hm(e,t){return new Array(t+1).join(e)}const mm=void 0;function gm(e,t,n,r="string"){if(0===t&&"function"==typeof DecompressionStream){const t=new DecompressionStream("deflate"),i=new Blob([e]).stream().pipeThrough(t);return"dataview"===r?new Response(i).arrayBuffer().then((e=>new DataView(e))):new Response(i).arrayBuffer().then((e=>new TextDecoder(n).decode(e)))}return void 0!==t?Promise.reject(`Unknown compression method ${t}.`):e}var ym=!0,_m=!0;function vm(e){return e.map((e=>String.fromCharCode(e))).join("")}function bm(e){if(e.length>=8){const t=vm(e.slice(0,8));if("ASCII\0\0\0"===t)return vm(e.slice(8));if("JIS\0\0\0\0\0"===t)return"[JIS encoded text]";if("UNICODE\0"===t)return"[Unicode encoded text]";if("\0\0\0\0\0\0\0\0"===t)return"[Undefined encoding]"}return"Undefined"}function Em(e){return e[0][0]/e[0][1]+e[1][0]/e[1][1]/60+e[2][0]/e[2][1]/3600}const Sm=18761,Am=19789;var xm={BIG_ENDIAN:Am,LITTLE_ENDIAN:Sm,getByteOrder:function(e,t){if(e.getUint16(t)===Sm)return Sm;if(e.getUint16(t)===Am)return Am;throw new Error("Illegal byte order value. Faulty image.")}};var wm={isTiffFile:function(e){return!!e&&e.byteLength>=4&&function(e){const t=42,n=2,r=e.getUint16(0)===xm.LITTLE_ENDIAN;return e.getUint16(n,r)===t}(e)},findTiffOffsets:function(){return{hasAppMarkers:!0,tiffHeaderOffset:0}}};var Tm={isJpegFile:function(e){return!!e&&e.byteLength>=Mm&&e.getUint16(0)===Om},findJpegOffsets:function(e){let t,n,r,i,a,o,s,u,c,l=Cm;for(;l+Nm+5<=e.byteLength;){if(sg(e,l))t=e.getUint16(l+Dm),n=l+Dm;else if(ug(e,l))t=e.getUint16(l+Dm),r=l+Dm;else if(dg(e,l))t=e.getUint16(l+Dm),i=l+Lm;else if(fg(e,l))t=e.getUint16(l+Dm),a=l+Im;else if(pg(e,l))s||(s=[]),t=e.getUint16(l+Dm),s.push(mg(l,t));else if(hg(e,l))s||(s=[]),t=e.getUint16(l+Dm),s.push(gg(l,t));else if(yg(e,l))t=e.getUint16(l+Dm),o=l+km;else if(cg(e,l)){t=e.getUint16(l+Dm);const n=l+Fm,r=t-(Fm-Dm),i=e.getUint8(l+jm),a=e.getUint8(l+Zm);u||(u=[]),u.push({offset:n,length:r,chunkNumber:i,chunksTotal:a})}else if(lg(e,l))t=e.getUint16(l+Dm),c=l+zm;else{if(!_g(e,l)){if(vg(e,l)){l++;continue}break}t=e.getUint16(l+Dm)}l+=Dm+t}return{hasAppMarkers:l>Cm,fileDataOffset:n||r,jfifDataOffset:i,tiffHeaderOffset:a,iptcDataOffset:o,xmpChunks:s,iccChunks:u,mpfDataOffset:c}}};const Mm=2,Om=65496,Cm=2,Nm=4,Dm=2,Lm=2,Im=10,km=18,$m=33,Rm=79,Fm=18,zm=8,Pm="ICC_PROFILE\0",jm=Nm+Pm.length,Zm=jm+1,Um="MPF\0",Bm=65472,Vm=65474,Hm=65476,Gm=65499,Ym=65501,Wm=65498,qm=65504,Km=65505,Jm=65506,Xm=65517,Qm=65519,eg=65534,tg=65535,ng="JFIF",rg="Exif",ig="http://ns.adobe.com/xap/1.0/\0",ag="http://ns.adobe.com/xmp/extension/\0",og="Photoshop 3.0";function sg(e,t){return e.getUint16(t)===Bm}function ug(e,t){return e.getUint16(t)===Vm}function cg(e,t){const n=Pm.length;return e.getUint16(t)===Jm&&om(e,t+Nm,n)===Pm}function lg(e,t){const n=Um.length;return e.getUint16(t)===Jm&&om(e,t+Nm,n)===Um}function dg(e,t){const n=ng.length;return e.getUint16(t)===qm&&om(e,t+Nm,n)===ng&&0===e.getUint8(t+Nm+n)}function fg(e,t){const n=rg.length;return e.getUint16(t)===Km&&om(e,t+Nm,n)===rg&&0===e.getUint8(t+Nm+n)}function pg(e,t){return e.getUint16(t)===Km&&function(e,t){const n=ig.length;return om(e,t+Nm,n)===ig}(e,t)}function hg(e,t){return e.getUint16(t)===Km&&function(e,t){const n=ag.length;return om(e,t+Nm,n)===ag}(e,t)}function mg(e,t){return{dataOffset:e+$m,length:t-($m-Dm)}}function gg(e,t){return{dataOffset:e+Rm,length:t-(Rm-Dm)}}function yg(e,t){const n=og.length;return e.getUint16(t)===Xm&&om(e,t+Nm,n)===og&&0===e.getUint8(t+Nm+n)}function _g(e,t){const n=e.getUint16(t);return n>=qm&&n<=Qm||n===eg||n===Bm||n===Vm||n===Hm||n===Gm||n===Ym||n===Wm}function vg(e,t){return e.getUint16(t)===tg}var bg={isPngFile:function(e){return!!e&&om(e,0,Eg.length)===Eg},findPngOffsets:function(e,t){const n={hasAppMarkers:!1};let r=Eg.length;for(;r+Sg+Ag<=e.byteLength;){if($g(e,r))n.hasAppMarkers=!0,n.pngHeaderOffset=r+Tg;else if(Rg(e,r)){const t=Zg(e,r);void 0!==t&&(n.hasAppMarkers=!0,n.xmpChunks=[{dataOffset:t,length:e.getUint32(r+xg)-(t-(r+Tg))}])}else if(Fg(e,r,t)){n.hasAppMarkers=!0;const t=om(e,r+wg,Ag);n.pngTextChunks||(n.pngTextChunks=[]),n.pngTextChunks.push({length:e.getUint32(r+xg),type:t,offset:r+Tg})}else if(zg(e,r))n.hasAppMarkers=!0,n.tiffHeaderOffset=r+Tg;else if(t&&Pg(e,r)){n.hasAppMarkers=!0;const t=e.getUint32(r+xg),i=r+Tg,{profileName:a,compressionMethod:o,compressedProfileOffset:s}=Ug(e,i);n.iccChunks||(n.iccChunks=[]),n.iccChunks.push({offset:s,length:t-(s-i),chunkNumber:1,chunksTotal:1,profileName:a,compressionMethod:o})}else jg(e,r)&&(n.hasAppMarkers=!0,n.pngChunkOffsets||(n.pngChunkOffsets=[]),n.pngChunkOffsets.push(r+xg));r+=e.getUint32(r+xg)+Sg+Ag+4}return n}};const Eg="PNG\r\n\n",Sg=4,Ag=4,xg=0,wg=Sg,Tg=Sg+Ag,Mg="XML:com.adobe.xmp\0",Og="tEXt",Cg="iTXt",Ng="zTXt",Dg="pHYs",Lg="tIME",Ig="eXIf",kg="iCCP";function $g(e,t){return"IHDR"===om(e,t+wg,Ag)}function Rg(e,t){return om(e,t+wg,Ag)===Cg&&om(e,t+Tg,Mg.length)===Mg}function Fg(e,t,n){const r=om(e,t+wg,Ag);return r===Og||r===Cg||r===Ng&&n}function zg(e,t){return om(e,t+wg,Ag)===Ig}function Pg(e,t){return om(e,t+wg,Ag)===kg}function jg(e,t){const n=[Dg,Lg],r=om(e,t+wg,Ag);return n.includes(r)}function Zg(e,t){t+=Tg+Mg.length+1+1;let n=0;for(;n<2&&t<e.byteLength;)0===e.getUint8(t)&&n++,t++;if(!(n<2))return t}function Ug(e,t){const n=sm(e,t);t+=n.length+1;return{profileName:n,compressionMethod:e.getUint8(t),compressedProfileOffset:t+=1}}function Bg(e,t,n,r){const{offsets:i,sizes:a}=function(e,t){const n={item:{dataReferenceIndex:2,extentCount:2,extent:{}}};e<2?(n.itemCount=2,n.item.itemId=2):2===e&&(n.itemCount=4,n.item.itemId=4);n.item.constructionMethod=1===e||2===e?2:0;const r={offsetSize:t,lengthSize:t,baseOffsetSize:t+1,indexSize:t+1};return r.itemCount=t+2,r.items=r.itemCount+n.itemCount,r.item={itemId:0},r.item.constructionMethod=r.item.itemId+n.item.itemId,r.item.dataReferenceIndex=r.item.constructionMethod+n.item.constructionMethod,{offsets:r,sizes:n}}(t,n+3),o=e.getUint8(i.offsetSize)>>4;a.item.extent.extentOffset=o;const s=15&e.getUint8(i.lengthSize);a.item.extent.extentLength=s;const u=e.getUint8(i.baseOffsetSize)>>4;a.item.baseOffset=u;const c=function(e,t,n){if(1===n||2===n)return 15&e.getUint8(t);return}(e,i.indexSize,t);a.item.extent.extentIndex=void 0!==c?c:0;const l=function(e,t,n){if(n<2)return e.getUint16(t);if(2===n)return e.getUint32(t);return}(e,i.itemCount,t);return{type:"iloc",items:Vg(e,t,i,a,o,s,c,l),length:r}}function Vg(e,t,n,r,i,a,o,s){if(void 0===s)return[];const u=[];let c=n.items;for(let n=0;n<s;n++){const n={extents:[]};n.itemId=Hg(e,c,t),c+=r.item.itemId,n.constructionMethod=1===t||2===t?15&e.getUint16(c):void 0,c+=r.item.constructionMethod,n.dataReferenceIndex=e.getUint16(c),c+=r.item.dataReferenceIndex,n.baseOffset=Yg(e,c,r.item.baseOffset),c+=r.item.baseOffset,n.extentCount=e.getUint16(c),c+=r.item.extentCount;for(let s=0;s<n.extentCount;s++){const s={};s.extentIndex=Gg(e,t,c,o),c+=r.item.extent.extentIndex,s.extentOffset=Yg(e,c,i),c+=r.item.extent.extentOffset,s.extentLength=Yg(e,c,a),c+=r.item.extent.extentLength,n.extents.push(s)}u.push(n)}return u}function Hg(e,t,n){return n<2?e.getUint16(t):2===n?e.getUint32(t):void 0}function Gg(e,t,n,r){if((1===t||2===t)&&r>0)return Yg(e,n,r)}function Yg(e,t,n){return 4===n?e.getUint32(t):8===n?(console.warn("This file uses an 8-bit offset which is currently not supported by ExifReader. Contact the maintainer to get it fixed."),function(e,t){return e.getUint32(t+4)}(e,t)):0}const Wg=1165519206,qg=1835625829,Kg=1970432288;function Jg(e,t){const{length:n,contentOffset:r}=function(e,t){const n=4,r=4,i=8,a=12,o=e.getUint32(t);if(function(e){return 0===e}(o))return{length:e.byteLength-t,contentOffset:t+n+r};if(function(e){return 1===e}(o)&&function(e,t){const n=8;return 0===e.getUint32(t+n)}(e,t))return{length:e.getUint32(t+a),contentOffset:t+n+r+i};return{length:o,contentOffset:t+n+r}}(e,t);if(n<8)return;const i=e.getUint32(t+4);if(1718909296===i)return function(e,t,n){const r=om(e,t,4);return{type:"ftyp",majorBrand:r,length:n}}(e,r,n);if(1768977008===i)return function(e,t,n,r){return{type:"iprp",subBoxes:ty(e,n,r-(n-t)),length:r}}(e,t,r,n);if(1768973167===i)return function(e,t,n,r){return{type:"ipco",properties:ty(e,n,r-(n-t)),length:r}}(e,t,r,n);if(1668246642===i)return function(e,t,n){return{type:"colr",icc:ey(e,t),length:n}}(e,r,n);const a=e.getUint8(r);return 1835365473===i?function(e,t,n,r){const i=3;return{type:"meta",subBoxes:ty(e,n+i,r-(n+i-t)),length:r}}(e,t,r+1,n):1768714083===i?Bg(e,a,r+1,n):1768517222===i?function(e,t,n,r,i){const{offsets:a}=function(e,t){const n={entryCount:t+3},r={};r.entryCount=0===e?2:4;return n.itemInfos=n.entryCount+r.entryCount,{offsets:n}}(n,r);return{type:"iinf",itemInfos:ty(e,a.itemInfos,i-(a.itemInfos-t)),length:i}}(e,t,a,r+1,n):1768842853===i?function(e,t,n,r,i){r+=3;const a={type:"infe",length:i};0!==n&&1!==n||(a.itemId=e.getUint16(r),r+=2,a.itemProtectionIndex=e.getUint16(r),r+=2,a.itemName=sm(e,r),r+=a.itemName.length+1);n>=2&&(2===n?(a.itemId=e.getUint16(r),r+=2):3===n&&(a.itemId=e.getUint32(r),r+=4),a.itemProtectionIndex=e.getUint16(r),r+=2,a.itemType=e.getUint32(r),r+=4,a.itemName=sm(e,r),r+=a.itemName.length+1,a.itemType===qg?(a.contentType=sm(e,r),t+i>(r+=a.contentType.length+1)&&(a.contentEncoding=sm(e,r),r+=a.contentEncoding.length+1)):a.itemType===Kg&&(a.itemUri=sm(e,r),r+=a.itemUri.length+1));return a}(e,t,a,r+1,n):{type:void 0,length:n}}function Xg(e){{const t={},n=function(e){const t=4,n=4;let r=0;for(;r+t+n<=e.byteLength;){const t=Jg(e,r);if(void 0===t)break;if("meta"===t.type)return t;r+=t.length}return}(e);return n?(t.tiffHeaderOffset=function(e,t){try{const n=function(e){return e.subBoxes.find((e=>"iinf"===e.type)).itemInfos.find((e=>e.itemType===Wg))}(t).itemId,r=Qg(t,n);return function(e,t){return t+4+e.getUint32(t)}(e,r.baseOffset+r.extents[0].extentOffset)}catch(e){return}}(e,n),t.xmpChunks=function(e){try{const t=function(e){return e.subBoxes.find((e=>"iinf"===e.type)).itemInfos.find((e=>e.itemType===qg&&"application/rdf+xml"===e.contentType))}(e).itemId,n=Qg(e,t),r=Qg(e,t).extents[0];return[{dataOffset:n.baseOffset+r.extentOffset,length:r.extentLength}]}catch(e){return}}(n),t.iccChunks=function(e){try{const t=e.subBoxes.find((e=>"iprp"===e.type)).subBoxes.find((e=>"ipco"===e.type)).properties.find((e=>"colr"===e.type)).icc;if(t)return[t]}catch(e){}return}(n),t.hasAppMarkers=void 0!==t.tiffHeaderOffset||void 0!==t.xmpChunks||void 0!==t.iccChunks,t):{hasAppMarkers:!1}}}function Qg(e,t){return e.subBoxes.find((e=>"iloc"===e.type)).items.find((e=>e.itemId===t))}function ey(e,t){const n=om(e,t,4);if("prof"===n||"rICC"===n)return{offset:t+4,length:e.getUint32(t+4),chunkNumber:1,chunksTotal:1}}function ty(e,t,n){const r=[Wg,qg],i=[];let a=t;for(;a<t+n;){const t=Jg(e,a);if(void 0===t)break;void 0===t.type||void 0!==t.itemType&&-1===r.indexOf(t.itemType)||i.push(t),a+=t.length}return i}var ny={isHeicFile:function(e){if(!e)return!1;const t=["heic","heix","hevc","hevx","heim","heis","hevm","hevs","mif1"];try{const n=Jg(e,0);return n&&-1!==t.indexOf(n.majorBrand)}catch(e){return!1}},findHeicOffsets:function(e){return Xg(e)}};var ry={isAvifFile:function(e){if(!e)return!1;try{const t=Jg(e,0);return t&&"avif"===t.majorBrand}catch(e){return!1}},findAvifOffsets:function(e){return Xg(e)}};var iy={isWebpFile:function(e){const t="RIFF",n="WEBP";return!!e&&om(e,0,4)===t&&om(e,8,4)===n},findOffsets:function(e){const t="Exif\0\0";let n,r,i,a,o=12,s=!1;for(;o+8<e.byteLength;){const u=om(e,o,4),c=e.getUint32(o+4,!0);"EXIF"===u?(s=!0,n=om(e,o+8,6)===t?o+8+6:o+8):"XMP "===u?(s=!0,r=[{dataOffset:o+8,length:c}]):"ICCP"===u?(s=!0,i=[{offset:o+8,length:c,chunkNumber:1,chunksTotal:1}]):"VP8X"===u&&(s=!0,a=o+8),o+=8+(c%2==0?c:c+1)}return{hasAppMarkers:s,tiffHeaderOffset:n,xmpChunks:r,iccChunks:i,vp8xChunkOffset:a}}};var ay={isGifFile:function(e){return!!e&&sy.includes(om(e,0,oy))},findOffsets:function(){return{gifHeaderOffset:0}}};const oy=6,sy=["GIF87a","GIF89a"];var uy={isXMLFile:function(e){return!!e&&om(e,cy,ly.length)===ly},findOffsets:function(e){const t=[];return t.push({dataOffset:cy,length:e.byteLength}),{xmpChunks:t}}};const cy=0,ly="<?xpacket begin";var dy={parseAppMarkers:function(e,t){if(wm.isTiffFile(e))return fy(wm.findTiffOffsets(),"tiff","TIFF");if(Tm.isJpegFile(e))return fy(Tm.findJpegOffsets(e),"jpeg","JPEG");if(bg.isPngFile(e))return fy(bg.findPngOffsets(e,t),"png","PNG");if(ny.isHeicFile(e))return fy(ny.findHeicOffsets(e),"heic","HEIC");if(ry.isAvifFile(e))return fy(ry.findAvifOffsets(e),"avif","AVIF");if(iy.isWebpFile(e))return fy(iy.findOffsets(e),"webp","WebP");if(ay.isGifFile(e))return fy(ay.findOffsets(e),"gif","GIF");if(uy.isXMLFile(e))return fy(uy.findOffsets(e),"xml","XML");throw new Error("Invalid image format")}};function fy(e,t,n){return dm({},e,{fileType:{value:t,description:n}})}var py={ApertureValue:e=>Math.pow(Math.sqrt(2),e[0]/e[1]).toFixed(2),ColorSpace:e=>1===e?"sRGB":65535===e?"Uncalibrated":"Unknown",ComponentsConfiguration:e=>e.map((e=>49===e?"Y":50===e?"Cb":51===e?"Cr":52===e?"R":53===e?"G":54===e?"B":void 0)).join(""),Contrast:e=>0===e?"Normal":1===e?"Soft":2===e?"Hard":"Unknown",CustomRendered:e=>0===e?"Normal process":1===e?"Custom process":"Unknown",ExposureMode:e=>0===e?"Auto exposure":1===e?"Manual exposure":2===e?"Auto bracket":"Unknown",ExposureProgram:e=>0===e?"Undefined":1===e?"Manual":2===e?"Normal program":3===e?"Aperture priority":4===e?"Shutter priority":5===e?"Creative program":6===e?"Action program":7===e?"Portrait mode":8===e?"Landscape mode":9===e?"Bulb":"Unknown",ExposureTime(e){if(e[0]/e[1]>.25){const t=e[0]/e[1];return Number.isInteger(t)?""+t:t.toFixed(1)}return 0!==e[0]?`1/${Math.round(e[1]/e[0])}`:`0/${e[1]}`},FNumber:e=>"f/"+e[0]/e[1],FocalLength:e=>e[0]/e[1]+" mm",FocalPlaneResolutionUnit:e=>2===e?"inches":3===e?"centimeters":"Unknown",LightSource:e=>1===e?"Daylight":2===e?"Fluorescent":3===e?"Tungsten (incandescent light)":4===e?"Flash":9===e?"Fine weather":10===e?"Cloudy weather":11===e?"Shade":12===e?"Daylight fluorescent (D 5700 – 7100K)":13===e?"Day white fluorescent (N 4600 – 5400K)":14===e?"Cool white fluorescent (W 3900 – 4500K)":15===e?"White fluorescent (WW 3200 – 3700K)":17===e?"Standard light A":18===e?"Standard light B":19===e?"Standard light C":20===e?"D55":21===e?"D65":22===e?"D75":23===e?"D50":24===e?"ISO studio tungsten":255===e?"Other light source":"Unknown",MeteringMode:e=>1===e?"Average":2===e?"CenterWeightedAverage":3===e?"Spot":4===e?"MultiSpot":5===e?"Pattern":6===e?"Partial":255===e?"Other":"Unknown",ResolutionUnit:e=>2===e?"inches":3===e?"centimeters":"Unknown",Saturation:e=>0===e?"Normal":1===e?"Low saturation":2===e?"High saturation":"Unknown",SceneCaptureType:e=>0===e?"Standard":1===e?"Landscape":2===e?"Portrait":3===e?"Night scene":"Unknown",Sharpness:e=>0===e?"Normal":1===e?"Soft":2===e?"Hard":"Unknown",ShutterSpeedValue(e){const t=Math.pow(2,e[0]/e[1]);return t<=1?`${Math.round(1/t)}`:`1/${Math.round(t)}`},WhiteBalance:e=>0===e?"Auto white balance":1===e?"Manual white balance":"Unknown",XResolution:e=>""+Math.round(e[0]/e[1]),YResolution:e=>""+Math.round(e[0]/e[1])},hy={11:"ProcessingSoftware",254:{name:"SubfileType",description:e=>({0:"Full-resolution image",1:"Reduced-resolution image",2:"Single page of multi-page image",3:"Single page of multi-page reduced-resolution image",4:"Transparency mask",5:"Transparency mask of reduced-resolution image",6:"Transparency mask of multi-page image",7:"Transparency mask of reduced-resolution multi-page image",65537:"Alternate reduced-resolution image",4294967295:"Invalid"}[e]||"Unknown")},255:{name:"OldSubfileType",description:e=>({0:"Full-resolution image",1:"Reduced-resolution image",2:"Single page of multi-page image"}[e]||"Unknown")},256:"ImageWidth",257:"ImageLength",258:"BitsPerSample",259:"Compression",262:"PhotometricInterpretation",263:{name:"Thresholding",description:e=>({1:"No dithering or halftoning",2:"Ordered dither or halfton",3:"Randomized dither"}[e]||"Unknown")},264:"CellWidth",265:"CellLength",266:{name:"FillOrder",description:e=>({1:"Normal",2:"Reversed"}[e]||"Unknown")},269:"DocumentName",270:"ImageDescription",271:"Make",272:"Model",273:"StripOffsets",274:{name:"Orientation",description:e=>1===e?"top-left":2===e?"top-right":3===e?"bottom-right":4===e?"bottom-left":5===e?"left-top":6===e?"right-top":7===e?"right-bottom":8===e?"left-bottom":"Undefined"},277:"SamplesPerPixel",278:"RowsPerStrip",279:"StripByteCounts",280:"MinSampleValue",281:"MaxSampleValue",282:{name:"XResolution",description:py.XResolution},283:{name:"YResolution",description:py.YResolution},284:"PlanarConfiguration",285:"PageName",286:{name:"XPosition",description:e=>""+Math.round(e[0]/e[1])},287:{name:"YPosition",description:e=>""+Math.round(e[0]/e[1])},290:{name:"GrayResponseUnit",description:e=>({1:"0.1",2:"0.001",3:"0.0001",4:"1e-05",5:"1e-06"}[e]||"Unknown")},296:{name:"ResolutionUnit",description:py.ResolutionUnit},297:"PageNumber",301:"TransferFunction",305:"Software",306:"DateTime",315:"Artist",316:"HostComputer",317:"Predictor",318:{name:"WhitePoint",description:e=>e.map((e=>`${e[0]}/${e[1]}`)).join(", ")},319:{name:"PrimaryChromaticities",description:e=>e.map((e=>`${e[0]}/${e[1]}`)).join(", ")},321:"HalftoneHints",322:"TileWidth",323:"TileLength",330:"A100DataOffset",332:{name:"InkSet",description:e=>({1:"CMYK",2:"Not CMYK"}[e]||"Unknown")},337:"TargetPrinter",338:{name:"ExtraSamples",description:e=>({0:"Unspecified",1:"Associated Alpha",2:"Unassociated Alpha"}[e]||"Unknown")},339:{name:"SampleFormat",description:e=>{const t={1:"Unsigned",2:"Signed",3:"Float",4:"Undefined",5:"Complex int",6:"Complex float"};return Array.isArray(e)?e.map((e=>t[e]||"Unknown")).join(", "):"Unknown"}},513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength",529:{name:"YCbCrCoefficients",description:e=>e.map((e=>""+e[0]/e[1])).join("/")},530:"YCbCrSubSampling",531:{name:"YCbCrPositioning",description:e=>1===e?"centered":2===e?"co-sited":"undefined "+e},532:{name:"ReferenceBlackWhite",description:e=>e.map((e=>""+e[0]/e[1])).join(", ")},700:"ApplicationNotes",18246:"Rating",18249:"RatingPercent",33432:{name:"Copyright",description:e=>e.join("; ")},33550:"PixelScale",33723:"IPTC-NAA",33920:"IntergraphMatrix",33922:"ModelTiePoint",34118:"SEMInfo",34264:"ModelTransform",34377:"PhotoshopSettings",34665:"Exif IFD Pointer",34675:"ICC_Profile",34735:"GeoTiffDirectory",34736:"GeoTiffDoubleParams",34737:"GeoTiffAsciiParams",34853:"GPS Info IFD Pointer",40091:{name:"XPTitle",description:my},40092:{name:"XPComment",description:my},40093:{name:"XPAuthor",description:my},40094:{name:"XPKeywords",description:my},40095:{name:"XPSubject",description:my},42112:"GDALMetadata",42113:"GDALNoData",50341:"PrintIM",50707:"DNGBackwardVersion",50708:"UniqueCameraModel",50709:"LocalizedCameraModel",50721:"ColorMatrix1",50722:"ColorMatrix2",50723:"CameraCalibration1",50724:"CameraCalibration2",50725:"ReductionMatrix1",50726:"ReductionMatrix2",50727:"AnalogBalance",50728:"AsShotNeutral",50729:"AsShotWhiteXY",50730:"BaselineExposure",50731:"BaselineNoise",50732:"BaselineSharpness",50734:"LinearResponseLimit",50735:"CameraSerialNumber",50736:"DNGLensInfo",50739:"ShadowScale",50741:{name:"MakerNoteSafety",description:e=>({0:"Unsafe",1:"Safe"}[e]||"Unknown")},50778:{name:"CalibrationIlluminant1",description:py.LightSource},50779:{name:"CalibrationIlluminant2",description:py.LightSource},50781:"RawDataUniqueID",50827:"OriginalRawFileName",50828:"OriginalRawFileData",50831:"AsShotICCProfile",50832:"AsShotPreProfileMatrix",50833:"CurrentICCProfile",50834:"CurrentPreProfileMatrix",50879:"ColorimetricReference",50885:"SRawType",50898:"PanasonicTitle",50899:"PanasonicTitle2",50931:"CameraCalibrationSig",50932:"ProfileCalibrationSig",50933:"ProfileIFD",50934:"AsShotProfileName",50936:"ProfileName",50937:"ProfileHueSatMapDims",50938:"ProfileHueSatMapData1",50939:"ProfileHueSatMapData2",50940:"ProfileToneCurve",50941:{name:"ProfileEmbedPolicy",description:e=>({0:"Allow Copying",1:"Embed if Used",2:"Never Embed",3:"No Restrictions"}[e]||"Unknown")},50942:"ProfileCopyright",50964:"ForwardMatrix1",50965:"ForwardMatrix2",50966:"PreviewApplicationName",50967:"PreviewApplicationVersion",50968:"PreviewSettingsName",50969:"PreviewSettingsDigest",50970:{name:"PreviewColorSpace",description:e=>({1:"Gray Gamma 2.2",2:"sRGB",3:"Adobe RGB",4:"ProPhoto RGB"}[e]||"Unknown")},50971:"PreviewDateTime",50972:"RawImageDigest",50973:"OriginalRawFileDigest",50981:"ProfileLookTableDims",50982:"ProfileLookTableData",51043:"TimeCodes",51044:"FrameRate",51058:"TStop",51081:"ReelName",51089:"OriginalDefaultFinalSize",51090:"OriginalBestQualitySize",51091:"OriginalDefaultCropSize",51105:"CameraLabel",51107:{name:"ProfileHueSatMapEncoding",description:e=>({0:"Linear",1:"sRGB"}[e]||"Unknown")},51108:{name:"ProfileLookTableEncoding",description:e=>({0:"Linear",1:"sRGB"}[e]||"Unknown")},51109:"BaselineExposureOffset",51110:{name:"DefaultBlackRender",description:e=>({0:"Auto",1:"None"}[e]||"Unknown")},51111:"NewRawImageDigest",51112:"RawToPreviewGain"};function my(e){return new TextDecoder("utf-16").decode(new Uint8Array(e)).replace(/\u0000+$/,"")}var gy={33434:{name:"ExposureTime",description:py.ExposureTime},33437:{name:"FNumber",description:py.FNumber},34850:{name:"ExposureProgram",description:py.ExposureProgram},34852:"SpectralSensitivity",34855:"ISOSpeedRatings",34856:{name:"OECF",description:()=>"[Raw OECF table data]"},34858:"TimeZoneOffset",34859:"SelfTimerMode",34864:{name:"SensitivityType",description:e=>({1:"Standard Output Sensitivity",2:"Recommended Exposure Index",3:"ISO Speed",4:"Standard Output Sensitivity and Recommended Exposure Index",5:"Standard Output Sensitivity and ISO Speed",6:"Recommended Exposure Index and ISO Speed",7:"Standard Output Sensitivity, Recommended Exposure Index and ISO Speed"}[e]||"Unknown")},34865:"StandardOutputSensitivity",34866:"RecommendedExposureIndex",34867:"ISOSpeed",34868:"ISOSpeedLatitudeyyy",34869:"ISOSpeedLatitudezzz",36864:{name:"ExifVersion",description:e=>vm(e)},36867:"DateTimeOriginal",36868:"DateTimeDigitized",36873:"GooglePlusUploadCode",36880:"OffsetTime",36881:"OffsetTimeOriginal",36882:"OffsetTimeDigitized",37121:{name:"ComponentsConfiguration",description:py.ComponentsConfiguration},37122:"CompressedBitsPerPixel",37377:{name:"ShutterSpeedValue",description:py.ShutterSpeedValue},37378:{name:"ApertureValue",description:py.ApertureValue},37379:"BrightnessValue",37380:"ExposureBiasValue",37381:{name:"MaxApertureValue",description:e=>Math.pow(Math.sqrt(2),e[0]/e[1]).toFixed(2)},37382:{name:"SubjectDistance",description:e=>e[0]/e[1]+" m"},37383:{name:"MeteringMode",description:py.MeteringMode},37384:{name:"LightSource",description:py.LightSource},37385:{name:"Flash",description:e=>0===e?"Flash did not fire":1===e?"Flash fired":5===e?"Strobe return light not detected":7===e?"Strobe return light detected":9===e?"Flash fired, compulsory flash mode":13===e?"Flash fired, compulsory flash mode, return light not detected":15===e?"Flash fired, compulsory flash mode, return light detected":16===e?"Flash did not fire, compulsory flash mode":24===e?"Flash did not fire, auto mode":25===e?"Flash fired, auto mode":29===e?"Flash fired, auto mode, return light not detected":31===e?"Flash fired, auto mode, return light detected":32===e?"No flash function":65===e?"Flash fired, red-eye reduction mode":69===e?"Flash fired, red-eye reduction mode, return light not detected":71===e?"Flash fired, red-eye reduction mode, return light detected":73===e?"Flash fired, compulsory flash mode, red-eye reduction mode":77===e?"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected":79===e?"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected":89===e?"Flash fired, auto mode, red-eye reduction mode":93===e?"Flash fired, auto mode, return light not detected, red-eye reduction mode":95===e?"Flash fired, auto mode, return light detected, red-eye reduction mode":"Unknown"},37386:{name:"FocalLength",description:py.FocalLength},37393:"ImageNumber",37394:{name:"SecurityClassification",description:e=>({C:"Confidential",R:"Restricted",S:"Secret",T:"Top Secret",U:"Unclassified"}[e]||"Unknown")},37395:"ImageHistory",37396:{name:"SubjectArea",description:e=>2===e.length?`Location; X: ${e[0]}, Y: ${e[1]}`:3===e.length?`Circle; X: ${e[0]}, Y: ${e[1]}, diameter: ${e[2]}`:4===e.length?`Rectangle; X: ${e[0]}, Y: ${e[1]}, width: ${e[2]}, height: ${e[3]}`:"Unknown"},37500:{name:"MakerNote",description:()=>"[Raw maker note data]"},37510:{name:"UserComment",description:bm},37520:"SubSecTime",37521:"SubSecTimeOriginal",37522:"SubSecTimeDigitized",37724:"ImageSourceData",37888:{name:"AmbientTemperature",description:e=>e[0]/e[1]+" °C"},37889:{name:"Humidity",description:e=>e[0]/e[1]+" %"},37890:{name:"Pressure",description:e=>e[0]/e[1]+" hPa"},37891:{name:"WaterDepth",description:e=>e[0]/e[1]+" m"},37892:{name:"Acceleration",description:e=>e[0]/e[1]+" mGal"},37893:{name:"CameraElevationAngle",description:e=>e[0]/e[1]+" °"},40960:{name:"FlashpixVersion",description:e=>e.map((e=>String.fromCharCode(e))).join("")},40961:{name:"ColorSpace",description:py.ColorSpace},40962:"PixelXDimension",40963:"PixelYDimension",40964:"RelatedSoundFile",40965:"Interoperability IFD Pointer",41483:"FlashEnergy",41484:{name:"SpatialFrequencyResponse",description:()=>"[Raw SFR table data]"},41486:"FocalPlaneXResolution",41487:"FocalPlaneYResolution",41488:{name:"FocalPlaneResolutionUnit",description:py.FocalPlaneResolutionUnit},41492:{name:"SubjectLocation",description:([e,t])=>`X: ${e}, Y: ${t}`},41493:"ExposureIndex",41495:{name:"SensingMethod",description:e=>1===e?"Undefined":2===e?"One-chip color area sensor":3===e?"Two-chip color area sensor":4===e?"Three-chip color area sensor":5===e?"Color sequential area sensor":7===e?"Trilinear sensor":8===e?"Color sequential linear sensor":"Unknown"},41728:{name:"FileSource",description:e=>3===e?"DSC":"Unknown"},41729:{name:"SceneType",description:e=>1===e?"A directly photographed image":"Unknown"},41730:{name:"CFAPattern",description:()=>"[Raw CFA pattern table data]"},41985:{name:"CustomRendered",description:py.CustomRendered},41986:{name:"ExposureMode",description:py.ExposureMode},41987:{name:"WhiteBalance",description:py.WhiteBalance},41988:{name:"DigitalZoomRatio",description:e=>0===e[0]?"Digital zoom was not used":""+e[0]/e[1]},41989:{name:"FocalLengthIn35mmFilm",description:e=>0===e?"Unknown":e},41990:{name:"SceneCaptureType",description:py.SceneCaptureType},41991:{name:"GainControl",description:e=>0===e?"None":1===e?"Low gain up":2===e?"High gain up":3===e?"Low gain down":4===e?"High gain down":"Unknown"},41992:{name:"Contrast",description:py.Contrast},41993:{name:"Saturation",description:py.Saturation},41994:{name:"Sharpness",description:py.Sharpness},41995:{name:"DeviceSettingDescription",description:()=>"[Raw device settings table data]"},41996:{name:"SubjectDistanceRange",description:e=>1===e?"Macro":2===e?"Close view":3===e?"Distant view":"Unknown"},42016:"ImageUniqueID",42032:"CameraOwnerName",42033:"BodySerialNumber",42034:{name:"LensSpecification",description:e=>{const t=`${parseFloat((e[0][0]/e[0][1]).toFixed(5))}-${parseFloat((e[1][0]/e[1][1]).toFixed(5))} mm`;if(0===e[3][1])return`${t} f/?`;const n=1/(e[2][1]/e[2][1]/(e[3][0]/e[3][1]));return`${t} f/${parseFloat(n.toFixed(5))}`}},42035:"LensMake",42036:"LensModel",42037:"LensSerialNumber",42080:{name:"CompositeImage",description:e=>({1:"Not a Composite Image",2:"General Composite Image",3:"Composite Image Captured While Shooting"}[e]||"Unknown")},42081:"SourceImageNumberOfCompositeImage",42082:"SourceExposureTimesOfCompositeImage",42240:"Gamma",59932:"Padding",59933:"OffsetSchema",65e3:"OwnerName",65001:"SerialNumber",65002:"Lens",65100:"RawFile",65101:"Converter",65102:"WhiteBalance",65105:"Exposure",65106:"Shadows",65107:"Brightness",65108:"Contrast",65109:"Saturation",65110:"Sharpness",65111:"Smoothness",65112:"MoireFilter"},yy={0:{name:"GPSVersionID",description:e=>2===e[0]&&2===e[1]&&0===e[2]&&0===e[3]?"Version 2.2":"Unknown"},1:{name:"GPSLatitudeRef",description:e=>{const t=e.join("");return"N"===t?"North latitude":"S"===t?"South latitude":"Unknown"}},2:{name:"GPSLatitude",description:Em},3:{name:"GPSLongitudeRef",description:e=>{const t=e.join("");return"E"===t?"East longitude":"W"===t?"West longitude":"Unknown"}},4:{name:"GPSLongitude",description:Em},5:{name:"GPSAltitudeRef",description:e=>0===e?"Sea level":1===e?"Sea level reference (negative value)":"Unknown"},6:{name:"GPSAltitude",description:e=>e[0]/e[1]+" m"},7:{name:"GPSTimeStamp",description:e=>e.map((([e,t])=>{const n=e/t;return/^\d(\.|$)/.test(`${n}`)?`0${n}`:n})).join(":")},8:"GPSSatellites",9:{name:"GPSStatus",description:e=>{const t=e.join("");return"A"===t?"Measurement in progress":"V"===t?"Measurement Interoperability":"Unknown"}},10:{name:"GPSMeasureMode",description:e=>{const t=e.join("");return"2"===t?"2-dimensional measurement":"3"===t?"3-dimensional measurement":"Unknown"}},11:"GPSDOP",12:{name:"GPSSpeedRef",description:e=>{const t=e.join("");return"K"===t?"Kilometers per hour":"M"===t?"Miles per hour":"N"===t?"Knots":"Unknown"}},13:"GPSSpeed",14:{name:"GPSTrackRef",description:e=>{const t=e.join("");return"T"===t?"True direction":"M"===t?"Magnetic direction":"Unknown"}},15:"GPSTrack",16:{name:"GPSImgDirectionRef",description:e=>{const t=e.join("");return"T"===t?"True direction":"M"===t?"Magnetic direction":"Unknown"}},17:"GPSImgDirection",18:"GPSMapDatum",19:{name:"GPSDestLatitudeRef",description:e=>{const t=e.join("");return"N"===t?"North latitude":"S"===t?"South latitude":"Unknown"}},20:{name:"GPSDestLatitude",description:e=>e[0][0]/e[0][1]+e[1][0]/e[1][1]/60+e[2][0]/e[2][1]/3600},21:{name:"GPSDestLongitudeRef",description:e=>{const t=e.join("");return"E"===t?"East longitude":"W"===t?"West longitude":"Unknown"}},22:{name:"GPSDestLongitude",description:e=>e[0][0]/e[0][1]+e[1][0]/e[1][1]/60+e[2][0]/e[2][1]/3600},23:{name:"GPSDestBearingRef",description:e=>{const t=e.join("");return"T"===t?"True direction":"M"===t?"Magnetic direction":"Unknown"}},24:"GPSDestBearing",25:{name:"GPSDestDistanceRef",description:e=>{const t=e.join("");return"K"===t?"Kilometers":"M"===t?"Miles":"N"===t?"Knots":"Unknown"}},26:"GPSDestDistance",27:{name:"GPSProcessingMethod",description:bm},28:{name:"GPSAreaInformation",description:bm},29:"GPSDateStamp",30:{name:"GPSDifferential",description:e=>0===e?"Measurement without differential correction":1===e?"Differential correction applied":"Unknown"},31:"GPSHPositioningError"},_y={1:"InteroperabilityIndex",2:{name:"InteroperabilityVersion",description:e=>vm(e)},4096:"RelatedImageFileFormat",4097:"RelatedImageWidth",4098:"RelatedImageHeight"},vy={45056:{name:"MPFVersion",description:e=>vm(e)},45057:"NumberOfImages",45058:"MPEntry",45059:"ImageUIDList",45060:"TotalFrames"};const by=dm({},hy,gy),Ey="0th",Sy="1st",Ay="exif",xy="gps",wy="interoperability",Ty="mpf",My="canon";var Oy={[Ey]:by,[Sy]:hy,[Ay]:by,[xy]:yy,[wy]:_y,[Ty]:vy,[My]:{4:{name:"ShotInfo",description:e=>e}}};const Cy={1:1,2:1,3:2,4:4,5:8,7:1,9:4,10:8,13:4},Ny={BYTE:1,ASCII:2,SHORT:3,LONG:4,RATIONAL:5,UNDEFINED:7,SLONG:9,SRATIONAL:10,IFD:13};var Dy={getAsciiValue:function(e){return e.map((e=>String.fromCharCode(e)))},getByteAt:Ly,getAsciiAt:function(e,t){return e.getUint8(t)},getShortAt:function(e,t,n){return e.getUint16(t,n===xm.LITTLE_ENDIAN)},getLongAt:Iy,getRationalAt:function(e,t,n){return[Iy(e,t,n),Iy(e,t+4,n)]},getUndefinedAt:function(e,t){return Ly(e,t)},getSlongAt:ky,getSrationalAt:function(e,t,n){return[ky(e,t,n),ky(e,t+4,n)]},getIfdPointerAt:function(e,t,n){return Iy(e,t,n)},typeSizes:Cy,tagTypes:Ny,getTypeSize:function(e){if(void 0===Ny[e])throw new Error("No such type found.");return Cy[Ny[e]]}};function Ly(e,t){return e.getUint8(t)}function Iy(e,t,n){return e.getUint32(t,n===xm.LITTLE_ENDIAN)}function ky(e,t,n){return e.getInt32(t,n===xm.LITTLE_ENDIAN)}const $y={1:Dy.getByteAt,2:Dy.getAsciiAt,3:Dy.getShortAt,4:Dy.getLongAt,5:Dy.getRationalAt,7:Dy.getUndefinedAt,9:Dy.getSlongAt,10:Dy.getSrationalAt,13:Dy.getIfdPointerAt};function Ry(e,t,n){return t+Dy.getLongAt(e,t+4,n)}function Fy(e,t,n,r,i,a){const o=Dy.getTypeSize("SHORT"),s={},u=function(e,t,n){if(t+Dy.getTypeSize("SHORT")<=e.byteLength)return Dy.getShortAt(e,t,n);return 0}(e,r,i);r+=o;for(let o=0;o<u&&!(r+12>e.byteLength);o++){const o=zy(e,t,n,r,i,a);void 0!==o&&(s[o.name]={id:o.id,value:o.value,description:o.description},"MakerNote"===o.name&&(s[o.name].__offset=o.__offset)),r+=12}if(r<e.byteLength-Dy.getTypeSize("LONG")){const o=Dy.getLongAt(e,r,i);0!==o&&t===Ey&&(s.Thumbnail=Fy(e,"1st",n,n+o,i,a))}return s}function zy(e,t,n,r,i,a){const o=Dy.getTypeSize("SHORT"),s=o+Dy.getTypeSize("SHORT"),u=s+Dy.getTypeSize("LONG"),c=Dy.getShortAt(e,r,i),l=Dy.getShortAt(e,r+o,i),d=Dy.getLongAt(e,r+s,i);let f,p;if(void 0===Dy.typeSizes[l]||!a&&void 0===Oy[t][c])return;if(function(e,t){return Dy.typeSizes[e]*t<=Dy.getTypeSize("LONG")}(l,d))p=r+u,f=Py(e,p,l,d,i);else if(p=Dy.getLongAt(e,r+u,i),function(e,t,n,r,i){return t+n+Dy.typeSizes[r]*i<=e.byteLength}(e,n,p,l,d)){f=Py(e,n+p,l,d,i,33723===c)}else f="<faulty value>";l===Dy.tagTypes.ASCII&&(f=function(e){const t=[];let n=0;for(let r=0;r<e.length;r++)"\0"!==e[r]?(void 0===t[n]&&(t[n]=""),t[n]+=e[r]):n++;return t}(f),f=function(e){try{return e.map((e=>decodeURIComponent(escape(e))))}catch(t){return e}}(f));let h=`undefined-${c}`,m=f;if(void 0!==Oy[t][c])if(void 0!==Oy[t][c].name&&void 0!==Oy[t][c].description){h=Oy[t][c].name;try{m=Oy[t][c].description(f)}catch(e){m=jy(f)}}else l===Dy.tagTypes.RATIONAL||l===Dy.tagTypes.SRATIONAL?(h=Oy[t][c],m=""+f[0]/f[1]):(h=Oy[t][c],m=jy(f));return{id:c,name:h,value:f,description:m,__offset:p}}function Py(e,t,n,r,i,a=!1){let o=[];a&&(r*=Dy.typeSizes[n],n=Dy.tagTypes.BYTE);for(let a=0;a<r;a++)o.push($y[n](e,t,i)),t+=Dy.typeSizes[n];return n===Dy.tagTypes.ASCII?o=Dy.getAsciiValue(o):1===o.length&&(o=o[0]),o}function jy(e){return e instanceof Array?e.join(", "):e}const Zy="Exif IFD Pointer",Uy="GPS Info IFD Pointer",By="Interoperability IFD Pointer";var Vy={read:function(e,t,n){const r=xm.getByteOrder(e,t);let i=function(e,t,n,r){return Fy(e,Ey,t,Ry(e,t,n),n,r)}(e,t,r,n);return i=Hy(i,e,t,r,n),i=Gy(i,e,t,r,n),i=Yy(i,e,t,r,n),{tags:i,byteOrder:r}}};function Hy(e,t,n,r,i){return void 0!==e[Zy]?dm(e,Fy(t,Ay,n,n+e[Zy].value,r,i)):e}function Gy(e,t,n,r,i){return void 0!==e[Uy]?dm(e,Fy(t,"gps",n,n+e[Uy].value,r,i)):e}function Yy(e,t,n,r,i){return void 0!==e[By]?dm(e,Fy(t,wy,n,n+e[By].value,r,i)):e}var Wy={read:function(e,t,n){const r=xm.getByteOrder(e,t),i=Fy(e,"mpf",t,Ry(e,t,r),r,n);return function(e,t,n,r){if(!n.MPEntry)return n;const i=[];for(let a=0;a<Math.ceil(n.MPEntry.value.length/qy);a++){i[a]={};const o=Ky(n.MPEntry.value,a*qy,Dy.getTypeSize("LONG"),r);i[a].ImageFlags=Jy(o),i[a].ImageFormat=Xy(o),i[a].ImageType=Qy(o);const s=Ky(n.MPEntry.value,a*qy+4,Dy.getTypeSize("LONG"),r);i[a].ImageSize={value:s,description:""+s};const u=e_(a,n.MPEntry,r,t);i[a].ImageOffset={value:u,description:""+u};const c=Ky(n.MPEntry.value,a*qy+12,Dy.getTypeSize("SHORT"),r);i[a].DependentImage1EntryNumber={value:c,description:""+c};const l=Ky(n.MPEntry.value,a*qy+14,Dy.getTypeSize("SHORT"),r);i[a].DependentImage2EntryNumber={value:l,description:""+l},i[a].image=e.buffer.slice(u,u+s),fm(i[a],"base64",(function(){return pm(this.image)}))}return n.Images=i,n}(e,t,i,r)}};const qy=16;function Ky(e,t,n,r){if(r===xm.LITTLE_ENDIAN){let r=0;for(let i=0;i<n;i++)r+=e[t+i]<<8*i;return r}let i=0;for(let r=0;r<n;r++)i+=e[t+r]<<8*(n-1-r);return i}function Jy(e){const t=[e>>31&1,e>>30&1,e>>29&1],n=[];return t[0]&&n.push("Dependent Parent Image"),t[1]&&n.push("Dependent Child Image"),t[2]&&n.push("Representative Image"),{value:t,description:n.join(", ")||"None"}}function Xy(e){const t=e>>24&7;return{value:t,description:0===t?"JPEG":"Unknown"}}function Qy(e){const t=16777215&e;return{value:t,description:{196608:"Baseline MP Primary Image",65537:"Large Thumbnail (VGA equivalent)",65538:"Large Thumbnail (Full HD equivalent)",131073:"Multi-Frame Image (Panorama)",131074:"Multi-Frame Image (Disparity)",131075:"Multi-Frame Image (Multi-Angle)",0:"Undefined"}[t]||"Unknown"}}function e_(e,t,n,r){return function(e){return 0===e}(e)?0:Ky(t.value,e*qy+8,Dy.getTypeSize("LONG"),n)+r}var t_={read:function(e,t){const n=function(e,t){return Dy.getShortAt(e,t)}(e,t),r=function(e,t,n){const r=7;if(r+1>n)return;const i=Dy.getByteAt(e,t+r);return{value:i,description:""+i}}(e,t,n);return{"Bits Per Sample":n_(e,t,n),"Image Height":r_(e,t,n),"Image Width":i_(e,t,n),"Color Components":r,Subsampling:r&&a_(e,t,r.value,n)}}};function n_(e,t,n){if(3>n)return;const r=Dy.getByteAt(e,t+2);return{value:r,description:""+r}}function r_(e,t,n){if(5>n)return;const r=Dy.getShortAt(e,t+3);return{value:r,description:`${r}px`}}function i_(e,t,n){if(7>n)return;const r=Dy.getShortAt(e,t+5);return{value:r,description:`${r}px`}}function a_(e,t,n,r){if(8+3*n>r)return;const i=[];for(let r=0;r<n;r++){const n=t+8+3*r;i.push([Dy.getByteAt(e,n),Dy.getByteAt(e,n+1),Dy.getByteAt(e,n+2)])}return{value:i,description:i.length>1?o_(i)+s_(i):""}}function o_(e){const t={1:"Y",2:"Cb",3:"Cr",4:"I",5:"Q"};return e.map((e=>t[e[0]])).join("")}function s_(e){const t={17:"4:4:4 (1 1)",18:"4:4:0 (1 2)",20:"4:4:1 (1 4)",33:"4:2:2 (2 1)",34:"4:2:0 (2 2)",36:"4:2:1 (2 4)",65:"4:1:1 (4 1)",66:"4:1:0 (4 2)"};return 0===e.length||void 0===e[0][1]||void 0===t[e[0][1]]?"":t[e[0][1]]}var u_={read:function(e,t){const n=function(e,t){return Dy.getShortAt(e,t)}(e,t),r=function(e,t,n){const r=14;if(r+1>n)return;const i=Dy.getByteAt(e,t+r);return{value:i,description:`${i}px`}}(e,t,n),i=function(e,t,n){const r=15;if(r+1>n)return;const i=Dy.getByteAt(e,t+r);return{value:i,description:`${i}px`}}(e,t,n),a={"JFIF Version":c_(e,t,n),"Resolution Unit":l_(e,t,n),XResolution:f_(e,t,n),YResolution:p_(e,t,n),"JFIF Thumbnail Width":r,"JFIF Thumbnail Height":i};if(void 0!==r&&void 0!==i){const o=function(e,t,n,r){const i=16;if(0===n||i+n>r)return;const a=e.buffer.slice(t+i,t+i+n);return{value:a,description:"<24-bit RGB pixel data>"}}(e,t,3*r.value*i.value,n);o&&(a["JFIF Thumbnail"]=o)}for(const e in a)void 0===a[e]&&delete a[e];return a}};function c_(e,t,n){if(9>n)return;const r=Dy.getByteAt(e,t+7),i=Dy.getByteAt(e,t+7+1);return{value:256*r+i,description:r+"."+i}}function l_(e,t,n){if(10>n)return;const r=Dy.getByteAt(e,t+9);return{value:r,description:d_(r)}}function d_(e){return 0===e?"None":1===e?"inches":2===e?"cm":"Unknown"}function f_(e,t,n){if(12>n)return;const r=Dy.getShortAt(e,t+10);return{value:r,description:""+r}}function p_(e,t,n){if(14>n)return;const r=Dy.getShortAt(e,t+12);return{value:r,description:""+r}}var h_={iptc:{256:{name:"Model Version",description:e=>((e[0]<<8)+e[1]).toString()},261:{name:"Destination",repeatable:!0},276:{name:"File Format",description:e=>((e[0]<<8)+e[1]).toString()},278:{name:"File Format Version",description:e=>((e[0]<<8)+e[1]).toString()},286:"Service Identifier",296:"Envelope Number",306:"Product ID",316:"Envelope Priority",326:{name:"Date Sent",description:m_},336:{name:"Time Sent",description:g_},346:{name:"Coded Character Set",description:y_,encoding_name:y_},356:"UNO",376:{name:"ARM Identifier",description:e=>((e[0]<<8)+e[1]).toString()},378:{name:"ARM Version",description:e=>((e[0]<<8)+e[1]).toString()},512:{name:"Record Version",description:e=>((e[0]<<8)+e[1]).toString()},515:"Object Type Reference",516:"Object Attribute Reference",517:"Object Name",519:"Edit Status",520:{name:"Editorial Update",description:e=>"01"===vm(e)?"Additional Language":"Unknown"},522:"Urgency",524:{name:"Subject Reference",repeatable:!0,description:e=>{const t=vm(e).split(":");return t[2]+(t[3]?"/"+t[3]:"")+(t[4]?"/"+t[4]:"")}},527:"Category",532:{name:"Supplemental Category",repeatable:!0},534:"Fixture Identifier",537:{name:"Keywords",repeatable:!0},538:{name:"Content Location Code",repeatable:!0},539:{name:"Content Location Name",repeatable:!0},542:"Release Date",547:"Release Time",549:"Expiration Date",550:"Expiration Time",552:"Special Instructions",554:{name:"Action Advised",description:e=>{const t=vm(e);return"01"===t?"Object Kill":"02"===t?"Object Replace":"03"===t?"Object Append":"04"===t?"Object Reference":"Unknown"}},557:{name:"Reference Service",repeatable:!0},559:{name:"Reference Date",repeatable:!0},562:{name:"Reference Number",repeatable:!0},567:{name:"Date Created",description:m_},572:{name:"Time Created",description:g_},574:{name:"Digital Creation Date",description:m_},575:{name:"Digital Creation Time",description:g_},577:"Originating Program",582:"Program Version",587:{name:"Object Cycle",description:e=>{const t=vm(e);return"a"===t?"morning":"p"===t?"evening":"b"===t?"both":"Unknown"}},592:{name:"By-line",repeatable:!0},597:{name:"By-line Title",repeatable:!0},602:"City",604:"Sub-location",607:"Province/State",612:"Country/Primary Location Code",613:"Country/Primary Location Name",615:"Original Transmission Reference",617:"Headline",622:"Credit",627:"Source",628:"Copyright Notice",630:{name:"Contact",repeatable:!0},632:"Caption/Abstract",634:{name:"Writer/Editor",repeatable:!0},637:{name:"Rasterized Caption",description:e=>e},642:"Image Type",643:{name:"Image Orientation",description:e=>{const t=vm(e);return"P"===t?"Portrait":"L"===t?"Landscape":"S"===t?"Square":"Unknown"}},647:"Language Identifier",662:{name:"Audio Type",description:e=>{const t=vm(e),n=t.charAt(0),r=t.charAt(1);let i="";return"1"===n?i+="Mono":"2"===n&&(i+="Stereo"),"A"===r?i+=", actuality":"C"===r?i+=", question and answer session":"M"===r?i+=", music, transmitted by itself":"Q"===r?i+=", response to a question":"R"===r?i+=", raw sound":"S"===r?i+=", scener":"V"===r?i+=", voicer":"W"===r&&(i+=", wrap"),""!==i?i:t}},663:{name:"Audio Sampling Rate",description:e=>parseInt(vm(e),10)+" Hz"},664:{name:"Audio Sampling Resolution",description:e=>{const t=parseInt(vm(e),10);return t+(1===t?" bit":" bits")}},665:{name:"Audio Duration",description:e=>{const t=vm(e);return t.length>=6?t.substr(0,2)+":"+t.substr(2,2)+":"+t.substr(4,2):t}},666:"Audio Outcue",698:"Short Document ID",699:"Unique Document ID",700:"Owner ID",712:{name:e=>2===e.length?"ObjectData Preview File Format":"Record 2 destination",description:e=>{if(2===e.length){const t=(e[0]<<8)+e[1];return 0===t?"No ObjectData":1===t?"IPTC-NAA Digital Newsphoto Parameter Record":2===t?"IPTC7901 Recommended Message Format":3===t?"Tagged Image File Format (Adobe/Aldus Image data)":4===t?"Illustrator (Adobe Graphics data)":5===t?"AppleSingle (Apple Computer Inc)":6===t?"NAA 89-3 (ANPA 1312)":7===t?"MacBinary II":8===t?"IPTC Unstructured Character Oriented File Format (UCOFF)":9===t?"United Press International ANPA 1312 variant":10===t?"United Press International Down-Load Message":11===t?"JPEG File Interchange (JFIF)":12===t?"Photo-CD Image-Pac (Eastman Kodak)":13===t?"Microsoft Bit Mapped Graphics File [*.BMP]":14===t?"Digital Audio File [*.WAV] (Microsoft & Creative Labs)":15===t?"Audio plus Moving Video [*.AVI] (Microsoft)":16===t?"PC DOS/Windows Executable Files [*.COM][*.EXE]":17===t?"Compressed Binary File [*.ZIP] (PKWare Inc)":18===t?"Audio Interchange File Format AIFF (Apple Computer Inc)":19===t?"RIFF Wave (Microsoft Corporation)":20===t?"Freehand (Macromedia/Aldus)":21===t?'Hypertext Markup Language "HTML" (The Internet Society)':22===t?"MPEG 2 Audio Layer 2 (Musicom), ISO/IEC":23===t?"MPEG 2 Audio Layer 3, ISO/IEC":24===t?"Portable Document File (*.PDF) Adobe":25===t?"News Industry Text Format (NITF)":26===t?"Tape Archive (*.TAR)":27===t?"Tidningarnas Telegrambyrå NITF version (TTNITF DTD)":28===t?"Ritzaus Bureau NITF version (RBNITF DTD)":29===t?"Corel Draw [*.CDR]":`Unknown format ${t}`}return vm(e)}},713:{name:"ObjectData Preview File Format Version",description:(e,t)=>{const n={"00":{"00":"1"},"01":{"01":"1","02":"2","03":"3","04":"4"},"02":{"04":"4"},"03":{"01":"5.0","02":"6.0"},"04":{"01":"1.40"},"05":{"01":"2"},"06":{"01":"1"},11:{"01":"1.02"},20:{"01":"3.1","02":"4.0","03":"5.0","04":"5.5"},21:{"02":"2.0"}},r=vm(e);if(t["ObjectData Preview File Format"]){const e=vm(t["ObjectData Preview File Format"].value);if(n[e]&&n[e][r])return n[e][r]}return r}},714:"ObjectData Preview Data",1802:{name:"Size Mode",description:e=>e[0].toString()},1812:{name:"Max Subfile Size",description:e=>{let t=0;for(let n=0;n<e.length;n++)t=(t<<8)+e[n];return t.toString()}},1882:{name:"ObjectData Size Announced",description:e=>{let t=0;for(let n=0;n<e.length;n++)t=(t<<8)+e[n];return t.toString()}},1887:{name:"Maximum ObjectData Size",description:e=>{let t=0;for(let n=0;n<e.length;n++)t=(t<<8)+e[n];return t.toString()}}}};function m_(e){const t=vm(e);return t.length>=8?t.substr(0,4)+"-"+t.substr(4,2)+"-"+t.substr(6,2):t}function g_(e){const t=vm(e);let n=t;return t.length>=6&&(n=t.substr(0,2)+":"+t.substr(2,2)+":"+t.substr(4,2),11===t.length&&(n+=t.substr(6,1)+t.substr(7,2)+":"+t.substr(9,2))),n}function y_(e){const t=vm(e);return"%G"===t?"UTF-8":"%5"===t?"Windows-1252":"%/G"===t?"UTF-8 Level 1":"%/H"===t?"UTF-8 Level 2":"%/I"===t?"UTF-8 Level 3":"/A"===t?"ISO-8859-1":"/B"===t?"ISO-8859-2":"/C"===t?"ISO-8859-3":"/D"===t?"ISO-8859-4":"/@"===t?"ISO-8859-5":"/G"===t?"ISO-8859-6":"/F"===t?"ISO-8859-7":"/H"===t?"ISO-8859-8":"Unknown"}var __={get:function(){if("undefined"!=typeof TextDecoder)return TextDecoder;return}};var v_={decode:function(e,t){const n=__.get();if(void 0!==n&&void 0!==e)try{return new n(e).decode(t instanceof DataView?t.buffer:Uint8Array.from(t))}catch(e){}return function(e){try{return decodeURIComponent(escape(e))}catch(t){return e}}(t.map((e=>String.fromCharCode(e))).join(""))},TAG_HEADER_SIZE:5};var b_={read:function(e,t,n){try{if(Array.isArray(e))return x_(new DataView(Uint8Array.from(e).buffer),{size:e.length},0,n);const{naaBlock:r,dataOffset:i}=function(e,t){for(;t+12<=e.byteLength;){const n=E_(e,t);if(S_(n))return{naaBlock:n,dataOffset:t+n.headerSize};t+=n.headerSize+n.size+A_(n)}throw new Error("No IPTC NAA resource block.")}(e,t);return x_(e,r,i,n)}catch(e){return{}}}};function E_(e,t){if(943868237!==e.getUint32(t,!1))throw new Error("Not an IPTC resource block.");const n=e.getUint8(t+4+2),r=(n%2==0?n+1:n)+1;return{headerSize:6+r+4,type:e.getUint16(t+4),size:e.getUint32(t+4+2+r)}}function S_(e){return 1028===e.type}function A_(e){return e.size%2!=0?1:0}function x_(e,t,n,r){const i={};let a;const o=n+t.size;for(;n<o&&n<e.byteLength;){const{tag:t,tagSize:o}=w_(e,n,i,a,r);if(null===t)break;t&&("encoding"in t&&(a=t.encoding),void 0===i[t.name]||void 0===t.repeatable?i[t.name]={id:t.id,value:t.value,description:t.description}:(i[t.name]instanceof Array||(i[t.name]=[{id:i[t.name].id,value:i[t.name].value,description:i[t.name].description}]),i[t.name].push({id:t.id,value:t.value,description:t.description}))),n+=5+o}return i}function w_(e,t,n,r,i){if(function(e,t){const n=28;return e.getUint8(t)!==n}(e,t))return{tag:null,tagSize:0};const a=e.getUint16(t+1),o=e.getUint16(t+3);if(!i&&!h_.iptc[a])return{tag:void 0,tagSize:o};const s=function(e,t,n){const r=[];for(let i=0;i<n;i++)r.push(e.getUint8(t+i));return r}(e,t+5,o),u={id:a,name:T_(h_.iptc[a],a,s),value:s,description:M_(h_.iptc[a],s,n,r)};return function(e){return h_.iptc[e]&&h_.iptc[e].repeatable}(a)&&(u.repeatable=!0),function(e){return h_.iptc[e]&&void 0!==h_.iptc[e].encoding_name}(a)&&(u.encoding=h_.iptc[a].encoding_name(s)),{tag:u,tagSize:o}}function T_(e,t,n){return e?function(e){return"string"==typeof e}(e)?e:function(e){return"function"==typeof e.name}(e)?e.name(n):e.name:`undefined-${t}`}function M_(e,t,n,r){if(function(e){return e&&void 0!==e.description}(e))try{return e.description(t,n)}catch(e){}return function(e,t){return e&&t instanceof Array}(e,t)?v_.decode(r,t):t}var O_={"tiff:Orientation":e=>"1"===e?"Horizontal (normal)":"2"===e?"Mirror horizontal":"3"===e?"Rotate 180":"4"===e?"Mirror vertical":"5"===e?"Mirror horizontal and rotate 270 CW":"6"===e?"Rotate 90 CW":"7"===e?"Mirror horizontal and rotate 90 CW":"8"===e?"Rotate 270 CW":e,"tiff:ResolutionUnit":e=>py.ResolutionUnit(parseInt(e,10)),"tiff:XResolution":e=>C_(py.XResolution,e),"tiff:YResolution":e=>C_(py.YResolution,e),"exif:ApertureValue":e=>C_(py.ApertureValue,e),"exif:GPSLatitude":D_,"exif:GPSLongitude":D_,"exif:FNumber":e=>C_(py.FNumber,e),"exif:FocalLength":e=>C_(py.FocalLength,e),"exif:FocalPlaneResolutionUnit":e=>py.FocalPlaneResolutionUnit(parseInt(e,10)),"exif:ColorSpace":e=>py.ColorSpace(function(e){if("0x"===e.substring(0,2))return parseInt(e.substring(2),16);return parseInt(e,10)}(e)),"exif:ComponentsConfiguration"(e,t){if(/^\d, \d, \d, \d$/.test(t)){const e=t.split(", ").map((e=>e.charCodeAt(0)));return py.ComponentsConfiguration(e)}return t},"exif:Contrast":e=>py.Contrast(parseInt(e,10)),"exif:CustomRendered":e=>py.CustomRendered(parseInt(e,10)),"exif:ExposureMode":e=>py.ExposureMode(parseInt(e,10)),"exif:ExposureProgram":e=>py.ExposureProgram(parseInt(e,10)),"exif:ExposureTime":e=>N_(e)?py.ExposureTime(e.split("/").map((e=>parseInt(e,10)))):e,"exif:MeteringMode":e=>py.MeteringMode(parseInt(e,10)),"exif:Saturation":e=>py.Saturation(parseInt(e,10)),"exif:SceneCaptureType":e=>py.SceneCaptureType(parseInt(e,10)),"exif:Sharpness":e=>py.Sharpness(parseInt(e,10)),"exif:ShutterSpeedValue":e=>C_(py.ShutterSpeedValue,e),"exif:WhiteBalance":e=>py.WhiteBalance(parseInt(e,10))};function C_(e,t){return N_(t)?e(t.split("/")):t}function N_(e){return/^-?\d+\/-?\d+$/.test(e)}function D_(e){const[t,n]=e.split(",");if(void 0!==t&&void 0!==n){const e=parseFloat(t),r=parseFloat(n),i=n.charAt(n.length-1);if(!Number.isNaN(e)&&!Number.isNaN(r))return""+(e+r/60)+i}return e}var L_={get:function(e){if(e)return e;if("undefined"!=typeof DOMParser)return new DOMParser;try{const{DOMParser:e,onErrorStopParsing:t}=__non_webpack_require__("@xmldom/xmldom");return new e({onError:t})}catch(e){return}}};function I_(e){const t=e.match(/<([A-Za-z_][A-Za-z0-9._-]*)([^>]*)>/);if(!t)return e;const n=t[1],r=function(e){const t=[],n=/xmlns:([\w-]+)=["'][^"']+["']/g;let r;for(;null!==(r=n.exec(e));)-1===t.indexOf(r[1])&&t.push(r[1]);return t}(e),i=function(e){const t=[],n=/\b([A-Za-z_][A-Za-z0-9._-]*):[A-Za-z_][A-Za-z0-9._-]*\b/g;let r;for(;null!==(r=n.exec(e));){const e=r[1];"xmlns"!==e&&"xml"!==e&&(-1===t.indexOf(e)&&t.push(e))}return t}(e),a=i.filter((e=>-1===r.indexOf(e)));if(0===a.length)return e;const o=function(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n],i=k_[r]||"http://fallback.namespace/"+r;t.push(" xmlns:"+r+'="'+i+'"')}return t.join("")}(a);return function(e,t,n){const r=new RegExp("<"+t+"([^>]*)>");return e.replace(r,"<"+t+"$1"+n+">")}(e,n,o)}const k_={xmp:"http://ns.adobe.com/xap/1.0/",tiff:"http://ns.adobe.com/tiff/1.0/",exif:"http://ns.adobe.com/exif/1.0/",dc:"http://purl.org/dc/elements/1.1/",xmpMM:"http://ns.adobe.com/xap/1.0/mm/",stEvt:"http://ns.adobe.com/xap/1.0/sType/ResourceEvent#",stRef:"http://ns.adobe.com/xap/1.0/sType/ResourceRef#",photoshop:"http://ns.adobe.com/photoshop/1.0/"};var $_={read:function(e,t,n){const r={};if("string"==typeof e)return z_(r,e,n),r;const[i,a]=function(e,t){if(0===t.length)return[];const n=[F_(e,t.slice(0,1))];t.length>1&&n.push(F_(e,t.slice(1)));return n}(e,t),o=z_(r,i,n);if(a){const i=z_(r,a,n);o||i||(delete r._raw,z_(r,F_(e,t),n))}return r}};class R_ extends Error{constructor(e){super(e),this.name="ParseError"}}function F_(e,t){const n=t.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(n);let i=0;for(let n=0;n<t.length;n++){const a=t[n],o=e.buffer.slice(a.dataOffset,a.dataOffset+a.length);r.set(new Uint8Array(o),i),i+=a.length}return new DataView(r.buffer)}function z_(e,t,n){try{const{doc:r,raw:i}=function(e,t){const n=L_.get(t);if(!n)throw console.warn("Warning: DOMParser is not available. It is needed to be able to parse XMP tags."),new Error;const r="string"==typeof e?e:om(e,0,e.byteLength),i=P_(n,(a=r,a.replace(/^.+(<\?xpacket begin)/,"$1").replace(/(<\?xpacket end=".*"\?>).+$/,"$1")));var a;return{doc:i,raw:r}}(t,n);e._raw=(e._raw||"")+i;return dm(e,B_(Z_(j_(r),!0))),!0}catch(e){return!1}}function P_(e,t,n=!1){try{const n=e.parseFromString(t,"application/xml"),r=n.getElementsByTagName("parsererror");if(r.length>0)throw new R_(r[0].textContent);return n}catch(r){if("ParseError"===r.name&&function(e){const t=["prefix is non-null and namespace is null","prefix not bound to a namespace","prefix inte bundet till en namnrymd",/Namespace prefix .+ is not defined/];for(let n=0;n<t.length;n++)if(new RegExp(t[n]).test(e.message))return!0;return!1}(r)&&!n)return P_(e,I_(t),!0);throw r}}function j_(e){for(let t=0;t<e.childNodes.length;t++){if("x:xmpmeta"===e.childNodes[t].tagName)return j_(e.childNodes[t]);if("rdf:RDF"===e.childNodes[t].tagName)return e.childNodes[t]}throw new Error}function Z_(e,t=!1){const n=function(e){const t=[];for(let n=0;n<e.childNodes.length;n++)t.push(e.childNodes[n]);return t}(e);return 1===(r=n).length&&"#text"===r[0].nodeName?t?{}:function(e){return e.nodeValue}(n[0]):function(e){const t={};return e.forEach((e=>{if(function(e){return e.nodeName&&"#text"!==e.nodeName}(e)){const n=function(e){return{attributes:U_(e),value:Z_(e)}}(e);void 0!==t[e.nodeName]?(Array.isArray(t[e.nodeName])||(t[e.nodeName]=[t[e.nodeName]]),t[e.nodeName].push(n)):t[e.nodeName]=n}})),t}(n);var r}function U_(e){const t={};for(let n=0;n<e.attributes.length;n++)t[e.attributes[n].nodeName]=decodeURIComponent(escape(e.attributes[n].value));return t}function B_(e){const t={};if("string"==typeof e)return e;for(const n in e){let r=e[n];Array.isArray(r)||(r=[r]),r.forEach((e=>{dm(t,V_(e.attributes)),"object"==typeof e.value&&dm(t,K_(e.value))}))}return t}function V_(e){const t={};for(const n in e)try{H_(n)&&(t[Y_(n)]={value:e[n],attributes:{},description:W_(e[n],n)})}catch(e){}return t}function H_(e){return"rdf:parseType"!==e&&!G_(e)}function G_(e){return"xmlns"===e.split(":")[0]}function Y_(e){return/^MicrosoftPhoto(_\d+_)?:Rating$/i.test(e)?"RatingPercent":e.split(":")[1]}function W_(e,t=void 0){if(Array.isArray(e)){const n=function(e){return e.map((e=>void 0!==e.value?W_(e.value):W_(e))).join(", ")}(e);return t&&"function"==typeof O_[t]?O_[t](e,n):n}if("object"==typeof e)return function(e){const t=[];for(const n in e)t.push(`${q_(n)}: ${W_(e[n].value)}`);return t.join("; ")}(e);try{return t&&"function"==typeof O_[t]?O_[t](e):decodeURIComponent(escape(e))}catch(t){return e}}function q_(e){return"CiAdrCity"===e?"CreatorCity":"CiAdrCtry"===e?"CreatorCountry":"CiAdrExtadr"===e?"CreatorAddress":"CiAdrPcode"===e?"CreatorPostalCode":"CiAdrRegion"===e?"CreatorRegion":"CiEmailWork"===e?"CreatorWorkEmail":"CiTelWork"===e?"CreatorWorkPhone":"CiUrlWork"===e?"CreatorWorkUrl":e}function K_(e){const t={};for(const n in e)try{G_(n)||(t[Y_(n)]=J_(e[n],n))}catch(e){}return t}function J_(e,t){return function(e){return Array.isArray(e)}(e)?function(e,t){return ov(e[e.length-1],t)}(e,t):function(e){return"Resource"===e.attributes["rdf:parseType"]&&"string"==typeof e.value&&""===e.value.trim()}(e)?{value:"",attributes:{},description:""}:X_(e)?Q_(e,t):tv(e)?nv(e,t):rv(e)?iv(e,t):function(e){return void 0!==av(e.value)}(e)?function(e,t){let n=av(e.value).value["rdf:li"];const r=ev(e),i=[];void 0===n?n=[]:Array.isArray(n)||(n=[n]);return n.forEach((e=>{i.push(function(e){if(X_(e))return Q_(e);if(tv(e))return nv(e).value;if(rv(e))return iv(e).value;return ov(e)}(e))})),{value:i,attributes:r,description:W_(i,t)}}(e,t):ov(e,t)}function X_(e){return"Resource"===e.attributes["rdf:parseType"]&&void 0!==e.value["rdf:value"]||void 0!==e.value["rdf:Description"]&&void 0!==e.value["rdf:Description"].value["rdf:value"]}function Q_(e,t){const n=ev(e);void 0!==e.value["rdf:Description"]&&(e=e.value["rdf:Description"]),dm(n,ev(e),function(e){const t={};for(const n in e.value)"rdf:value"===n||G_(n)||(t[Y_(n)]=e.value[n].value);return t}(e));const r=function(e){return sv(e.value["rdf:value"])||e.value["rdf:value"].value}(e);return{value:r,attributes:n,description:W_(r,t)}}function ev(e){const t={};for(const n in e.attributes)"rdf:parseType"===n||"rdf:resource"===n||G_(n)||(t[Y_(n)]=e.attributes[n]);return t}function tv(e){return"Resource"===e.attributes["rdf:parseType"]||void 0!==e.value["rdf:Description"]&&void 0===e.value["rdf:Description"].value["rdf:value"]}function nv(e,t){const n={value:{},attributes:{}};return void 0!==e.value["rdf:Description"]&&(dm(n.value,V_(e.value["rdf:Description"].attributes)),dm(n.attributes,ev(e)),e=e.value["rdf:Description"]),dm(n.value,K_(e.value)),n.description=W_(n.value,t),n}function rv(e){return 0===Object.keys(e.value).length&&void 0===e.attributes["xml:lang"]&&void 0===e.attributes["rdf:resource"]}function iv(e,t){const n=V_(e.attributes);return{value:n,attributes:{},description:W_(n,t)}}function av(e){return e["rdf:Bag"]||e["rdf:Seq"]||e["rdf:Alt"]}function ov(e,t){const n=sv(e)||B_(e.value);return{value:n,attributes:ev(e),description:W_(n,t)}}function sv(e){return e.attributes&&e.attributes["rdf:resource"]}const uv=0,cv=1,lv=2,dv=3,fv=4,pv=5,hv=6,mv=7,gv=8;var yv={2e3:{name:"PathInformation",description:function(e){const t={},n=[];for(let r=0;r<e.byteLength;r+=26){const i=Dy.getShortAt(e,r);_v[i]&&(t[i]||(t[i]=_v[i].description),n.push({type:i,path:_v[i].path(e,r+2)}))}return JSON.stringify({types:t,paths:n})}},2999:{name:"ClippingPathName",description(e){const[,t]=cm(e,0);return t}}};const _v={[uv]:{description:"Closed subpath length",path:(e,t)=>[Dy.getShortAt(e,t)]},[cv]:{description:"Closed subpath Bezier knot, linked",path:vv},[lv]:{description:"Closed subpath Bezier knot, unlinked",path:vv},[dv]:{description:"Open subpath length",path:(e,t)=>[Dy.getShortAt(e,t)]},[fv]:{description:"Open subpath Bezier knot, linked",path:vv},[pv]:{description:"Open subpath Bezier knot, unlinked",path:vv},[hv]:{description:"Path fill rule",path:()=>[]},[gv]:{description:"Initial fill rule",path:(e,t)=>[Dy.getShortAt(e,t)]},[mv]:{description:"Clipboard",path:function(e,t){return[[Ev(e,t,8),Ev(e,t+4,8),Ev(e,t+8,8),Ev(e,t+12,8)],Ev(e,t+16,8)]}}};function vv(e,t){const n=[];for(let r=0;r<24;r+=8)n.push(bv(e,t+r));return n}function bv(e,t){const n=Ev(e,t,8);return[Ev(e,t+4,8),n]}function Ev(e,t,n){const r=Dy.getLongAt(e,t),i=r>>>31==0?1:-1,a=(2130706432&r)>>>32-n,o=r&parseInt(hm("1",32-n),2);return i*function(e,t){return parseInt(e.replace(".",""),t)/Math.pow(t,(e.split(".")[1]||"").length)}(a.toString(2)+"."+function(e,t,n){return hm(n,t-e.length)+e}(o.toString(2),32-n,"0"),2)}var Sv={read:function(e,t){const n=am(new Uint8Array(e).buffer),r={};let i=0;for(;i<e.length;){const e=om(n,i,Tv);i+=Tv;const a=Dy.getShortAt(n,i);i+=xv;const{tagName:o,tagNameSize:s}=Mv(n,i);i+=s;const u=Dy.getLongAt(n,i);if(i+=wv,e===Av){const e=am(n.buffer,i,u),s={id:a,value:om(e,0,u)};if(yv[a]){try{s.description=yv[a].description(e)}catch(e){s.description="<no description formatter>"}r[o||yv[a].name]=s}else t&&(r[`undefined-${a}`]=s)}i+=u+u%2}return r}};const Av="8BIM",xv=2,wv=4,Tv=Av.length;function Mv(e,t){const[n,r]=cm(e,t);return{tagName:r,tagNameSize:1+n+(n%2==0?1:0)}}const Ov={desc:{name:"ICC Description"},cprt:{name:"ICC Copyright"},dmdd:{name:"ICC Device Model Description"},vued:{name:"ICC Viewing Conditions Description"},dmnd:{name:"ICC Device Manufacturer for Display"},tech:{name:"Technology"}},Cv={4:{name:"Preferred CMM type",value:(e,t)=>om(e,t,4),description:e=>null!==e?Nv(e):""},8:{name:"Profile Version",value:(e,t)=>e.getUint8(t).toString(10)+"."+(e.getUint8(t+1)>>4).toString(10)+"."+(e.getUint8(t+1)%16).toString(10)},12:{name:"Profile/Device class",value:(e,t)=>om(e,t,4),description:e=>{switch(e.toLowerCase()){case"scnr":return"Input Device profile";case"mntr":return"Display Device profile";case"prtr":return"Output Device profile";case"link":return"DeviceLink profile";case"abst":return"Abstract profile";case"spac":return"ColorSpace profile";case"nmcl":return"NamedColor profile";case"cenc":return"ColorEncodingSpace profile";case"mid ":return"MultiplexIdentification profile";case"mlnk":return"MultiplexLink profile";case"mvis":return"MultiplexVisualization profile";default:return e}}},16:{name:"Color Space",value:(e,t)=>om(e,t,4)},20:{name:"Connection Space",value:(e,t)=>om(e,t,4)},24:{name:"ICC Profile Date",value:(e,t)=>function(e,t){const n=e.getUint16(t),r=e.getUint16(t+2)-1,i=e.getUint16(t+4),a=e.getUint16(t+6),o=e.getUint16(t+8),s=e.getUint16(t+10);return new Date(Date.UTC(n,r,i,a,o,s))}(e,t).toISOString()},36:{name:"ICC Signature",value:(e,t)=>{return n=e.buffer.slice(t,t+4),String.fromCharCode.apply(null,new Uint8Array(n));var n}},40:{name:"Primary Platform",value:(e,t)=>om(e,t,4),description:e=>Nv(e)},48:{name:"Device Manufacturer",value:(e,t)=>om(e,t,4),description:e=>Nv(e)},52:{name:"Device Model Number",value:(e,t)=>om(e,t,4)},64:{name:"Rendering Intent",value:(e,t)=>e.getUint32(t),description:e=>{switch(e){case 0:return"Perceptual";case 1:return"Relative Colorimetric";case 2:return"Saturation";case 3:return"Absolute Colorimetric";default:return e}}},80:{name:"Profile Creator",value:(e,t)=>om(e,t,4)}};function Nv(e){switch(e.toLowerCase()){case"appl":return"Apple";case"adbe":return"Adobe";case"msft":return"Microsoft";case"sunw":return"Sun Microsystems";case"sgi":return"Silicon Graphics";case"tgnt":return"Taligent";default:return e}}var Dv={read:function(e,t,n){if(n&&t[0].compressionMethod!==mm)return function(e,t){if(n=t[0].compressionMethod,0!==n)return{};var n;const r=new DataView(e.buffer.slice(t[0].offset,t[0].offset+t[0].length));return gm(r,t[0].compressionMethod,"utf-8","dataview").then(Zv).catch((()=>({})))}(e,t);return function(e,t){try{const n=t.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(n);let i=0;const a=function(e){if(Array.isArray(e))return new DataView(Uint8Array.from(e).buffer).buffer;return e.buffer}(e);for(let e=1;e<=t.length;e++){const n=t.find((t=>t.chunkNumber===e));if(!n)throw new Error(`ICC chunk ${e} not found`);const o=a.slice(n.offset,n.offset+n.length),s=new Uint8Array(o);r.set(s,i),i+=s.length}return Zv(new DataView(r.buffer))}catch(e){return{}}}(e,t)}};const Lv=84,Iv=128,kv="acsp",$v="desc",Rv="mluc",Fv="text",zv="sig ",Pv=12;function jv(e,t){return e.length<t+Pv}function Zv(e){const t=e.buffer,n=e.getUint32();if(e.byteLength!==n)throw new Error("ICC profile length not matching");if(e.length<Lv)throw new Error("ICC profile too short");const r={},i=Object.keys(Cv);for(let t=0;t<i.length;t++){const n=i[t],a=Cv[n],o=a.value(e,parseInt(n,10));let s=o;a.description&&(s=a.description(o)),r[a.name]={value:o,description:s}}if(Uv(t.slice(36,40))!==kv)throw new Error("ICC profile: missing signature");if(function(e){return e.length<Iv+4}(t))return r;const a=e.getUint32(128);let o=132;for(let n=0;n<a;n++){if(jv(t,o))return r;const n=om(e,o,4),i=e.getUint32(o+4),a=e.getUint32(o+8);if(i>t.length)return r;const s=om(e,i,4);if(s===$v){const o=e.getUint32(i+8);if(o>a)return r;Bv(r,n,Uv(t.slice(i+12,i+o+11)))}else if(s===Rv){const t=e.getUint32(i+8),a=e.getUint32(i+12);let o=i+16;const s=[];for(let n=0;n<t;n++){const t=om(e,o+0,2),n=om(e,o+2,2),r=e.getUint32(o+4),u=e.getUint32(o+8),c=um(e,i+u,r);s.push({languageCode:t,countryCode:n,text:c}),o+=a}if(1===t)Bv(r,n,s[0].text);else{const e={};for(let t=0;t<s.length;t++)e[`${s[t].languageCode}-${s[t].countryCode}`]=s[t].text;Bv(r,n,e)}}else if(s===Fv){Bv(r,n,Uv(t.slice(i+8,i+a-7)))}else if(s===zv){Bv(r,n,Uv(t.slice(i+8,i+12)))}o+=12}return r}function Uv(e){return String.fromCharCode.apply(null,new Uint8Array(e))}function Bv(e,t,n){Ov[t]?e[Ov[t].name]={value:n,description:n}:e[t]={value:n,description:n}}const Vv=27;var Hv={read:function(e,t,n,r,i){let a=Fy(e,My,t,t+n,r,i);a.ShotInfo&&(a=dm({},a,function(e){const t={};void 0!==e[27]&&(t.AutoRotate={value:e[27],description:Gv(e[27])});return t}(a.ShotInfo.value)),delete a.ShotInfo);return a},SHOT_INFO_AUTO_ROTATE:Vv};function Gv(e){return 0===e?"None":1===e?"Rotate 90 CW":2===e?"Rotate 180":3===e?"Rotate 270 CW":"Unknown"}var Yv={read:function(e,t){return{"Image Width":Wv(e,t),"Image Height":qv(e,t),"Bit Depth":Kv(e,t),"Color Type":Jv(e,t),Compression:Xv(e,t),Filter:Qv(e,t),Interlace:eb(e,t)}}};function Wv(e,t){if(t+0+4>e.byteLength)return;const n=Dy.getLongAt(e,t);return{value:n,description:`${n}px`}}function qv(e,t){if(t+4+4>e.byteLength)return;const n=Dy.getLongAt(e,t+4);return{value:n,description:`${n}px`}}function Kv(e,t){if(t+8+1>e.byteLength)return;const n=Dy.getByteAt(e,t+8);return{value:n,description:`${n}`}}function Jv(e,t){if(t+9+1>e.byteLength)return;const n=Dy.getByteAt(e,t+9);return{value:n,description:{0:"Grayscale",2:"RGB",3:"Palette",4:"Grayscale with Alpha",6:"RGB with Alpha"}[n]||"Unknown"}}function Xv(e,t){if(t+10+1>e.byteLength)return;const n=Dy.getByteAt(e,t+10);return{value:n,description:0===n?"Deflate/Inflate":"Unknown"}}function Qv(e,t){if(t+11+1>e.byteLength)return;const n=Dy.getByteAt(e,t+11);return{value:n,description:0===n?"Adaptive":"Unknown"}}function eb(e,t){if(t+12+1>e.byteLength)return;const n=Dy.getByteAt(e,t+12);return{value:n,description:{0:"Noninterlaced",1:"Adam7 Interlace"}[n]||"Unknown"}}var tb={read:function(e,t,n,r){const i={},a=[];for(let o=0;o<t.length;o++){const{offset:s,length:u,type:c}=t[o],l=lb(e,s,u,c,n);if(l instanceof Promise)a.push(l.then((({name:e,value:t,description:n})=>{try{if(ym&&gb(e,t))return{__exif:Vy.read(_b(t),cb,r).tags};if(_m&&yb(e,t))return{__iptc:b_.read(_b(t),0,r)};if(e&&!gb(e,t)&&!yb(e,t))return{[e]:{value:t,description:n}}}catch(e){}return{}})));else{const{name:e,value:t,description:n}=l;e&&(i[e]={value:t,description:n})}}return{readTags:i,readTagsPromise:a.length>0?Promise.all(a):void 0}}};const nb="STATE_KEYWORD",rb="STATE_COMPRESSION",ib="STATE_LANG",ab="STATE_TRANSLATED_KEYWORD",ob="STATE_TEXT",sb=1,ub=1,cb=6;function lb(e,t,n,r,i){const a=[],o=[];let s,u=nb,c=mm;for(let i=0;i<n&&t+i<e.byteLength;i++){if(u===rb){c=db({type:r,dataView:e,offset:t+i}),r===Cg&&(i+=sb),u=fb(r,u);continue}if(u===ob){s=new DataView(e.buffer.slice(t+i,t+n));break}const l=e.getUint8(t+i);0===l?u=fb(r,u):u===nb?a.push(l):u===ib&&o.push(l)}if(c!==mm&&!i)return{};const l=gm(s,c,function(e){if(e===Og||e===Ng)return"latin1";return"utf-8"}(r));return l instanceof Promise?l.then((e=>pb(e,r,o,a))).catch((()=>pb("<text using unknown compression>".split(""),r,o,a))):pb(l,r,o,a)}function db({type:e,dataView:t,offset:n}){if(e===Cg){if(t.getUint8(n)===ub)return t.getUint8(n+1)}else if(e===Ng)return t.getUint8(n);return mm}function fb(e,t){return t===nb&&[Cg,Ng].includes(e)?rb:t===rb?e===Cg?ib:ob:t===ib?ab:ob}function pb(e,t,n,r){const i=function(e){if(e instanceof DataView)return om(e,0,e.byteLength);return e}(e);return{name:hb(t,n,r),value:i,description:t===Cg?mb(e):i}}function hb(e,t,n){const r=lm(n);if(e===Og||0===t.length)return r;return`${r} (${lm(t)})`}function mb(e){return v_.decode("UTF-8",e)}function gb(e,t){return"raw profile type exif"===e.toLowerCase()&&"exif"===t.substring(1,5)}function yb(e,t){return"raw profile type iptc"===e.toLowerCase()&&"iptc"===t.substring(1,5)}function _b(e){return function(e){const t=new DataView(new ArrayBuffer(e.length/2));for(let n=0;n<e.length;n+=2)t.setUint8(n/2,parseInt(e.substring(n,n+2),16));return t}(e.match(/\n(exif|iptc)\n\s*\d+\n([\s\S]*)$/)[2].replace(/\n/g,""))}var vb={read:function(e,t){const n={};for(let r=0;r<t.length;r++){const i=Dy.getLongAt(e,t[r]+xg),a=om(e,t[r]+wg,Ag);a===Dg?(n["Pixels Per Unit X"]=bb(e,t[r],i),n["Pixels Per Unit Y"]=Eb(e,t[r],i),n["Pixel Units"]=Sb(e,t[r],i)):a===Lg&&(n["Modify Date"]=Ab(e,t[r],i))}return n}};function bb(e,t,n){if(!xb(e,t,n,0,4))return;const r=Dy.getLongAt(e,t+Tg+0);return{value:r,description:""+r}}function Eb(e,t,n){if(!xb(e,t,n,4,4))return;const r=Dy.getLongAt(e,t+Tg+4);return{value:r,description:""+r}}function Sb(e,t,n){if(!xb(e,t,n,8,1))return;const r=Dy.getByteAt(e,t+Tg+8);return{value:r,description:1===r?"meters":"Unknown"}}function Ab(e,t,n){if(!xb(e,t,n,0,7))return;const r=Dy.getShortAt(e,t+Tg),i=Dy.getByteAt(e,t+Tg+2),a=Dy.getByteAt(e,t+Tg+3),o=Dy.getByteAt(e,t+Tg+4),s=Dy.getByteAt(e,t+Tg+5),u=Dy.getByteAt(e,t+Tg+6);return{value:[r,i,a,o,s,u],description:`${wb(r,4)}-${wb(i,2)}-${wb(a,2)} ${wb(o,2)}:${wb(s,2)}:${wb(u,2)}`}}function xb(e,t,n,r,i){return r+i<=n&&t+Tg+r+i<=e.byteLength}function wb(e,t){return`${"0".repeat(t-(""+e).length)}${e}`}var Tb={read:function(e,t){const n={},r=Dy.getByteAt(e,t);return n.Alpha=Cb(r),n.Animation=Nb(r),n.ImageWidth=Db(e,t+Mb),n.ImageHeight=Db(e,t+Ob),n}};const Mb=4,Ob=7;function Cb(e){const t=16&e;return{value:t?1:0,description:t?"Yes":"No"}}function Nb(e){const t=2&e;return{value:t?1:0,description:t?"Yes":"No"}}function Db(e,t){const n=Dy.getByteAt(e,t)+256*Dy.getByteAt(e,t+1)+65536*Dy.getByteAt(e,t+2)+1;return{value:n,description:n+"px"}}var Lb={read:function(e){return{"GIF Version":Ib(e),"Image Width":kb(e),"Image Height":$b(e),"Global Color Map":Rb(e),"Bits Per Pixel":zb(e),"Color Resolution Depth":Fb(e)}}};function Ib(e){if(6>e.byteLength)return;const t=om(e,3,3);return{value:t,description:t}}function kb(e){if(8>e.byteLength)return;const t=e.getUint16(6,!0);return{value:t,description:`${t}px`}}function $b(e){if(10>e.byteLength)return;const t=e.getUint16(8,!0);return{value:t,description:`${t}px`}}function Rb(e){if(11>e.byteLength)return;const t=(128&e.getUint8(10))>>>7;return{value:t,description:1===t?"Yes":"No"}}function Fb(e){if(11>e.byteLength)return;const t=1+((112&e.getUint8(10))>>>4);return{value:t,description:`${t} ${1===t?"bit":"bits"}`}}function zb(e){if(11>e.byteLength)return;const t=1+(7&e.getUint8(10));return{value:t,description:`${t} ${1===t?"bit":"bits"}`}}const Pb=[6,7,99];var jb={get:function(e,t,n){if(r=t,r&&(void 0===r.Compression||Pb.includes(r.Compression.value))&&r.JPEGInterchangeFormat&&r.JPEGInterchangeFormat.value&&r.JPEGInterchangeFormatLength&&r.JPEGInterchangeFormatLength.value){t.type="image/jpeg";const r=n+t.JPEGInterchangeFormat.value;t.image=e.buffer.slice(r,r+t.JPEGInterchangeFormatLength.value),fm(t,"base64",(function(){return pm(this.image)}))}var r;return t}};function Zb(e){this.name="MetadataMissingError",this.message=e||"No Exif data",this.stack=(new Error).stack}Zb.prototype=new Error;var Ub,Bb,Vb={MetadataMissingError:Zb},Hb={load:function(e,t={}){if(function(e){return"string"==typeof e}(e))return t.async=!0,function(e,t){if(/^\w+:\/\//.test(e))return"undefined"!=typeof fetch?function(e,{length:t}={}){const n={method:"GET"};Number.isInteger(t)&&t>=0&&(n.headers={range:"bytes=0-"+(t-1)});return fetch(e,n).then((e=>e.arrayBuffer()))}(e,t):function(e,{length:t}={}){return new Promise(((n,r)=>{const i={};Number.isInteger(t)&&t>=0&&(i.headers={range:"bytes=0-"+(t-1)});const a=function(e){if(/^https:\/\//.test(e))return __non_webpack_require__("https").get;return __non_webpack_require__("http").get}(e);a(e,i,(e=>{if(e.statusCode>=200&&e.statusCode<=299){const t=[];e.on("data",(e=>t.push(Buffer.from(e)))),e.on("error",(e=>r(e))),e.on("end",(()=>n(Buffer.concat(t))))}else r(`Could not fetch file: ${e.statusCode} ${e.statusMessage}`),e.resume()})).on("error",(e=>r(e)))}))}(e,t);if(function(e){return/^data:[^;,]*(;base64)?,/.test(e)}(e))return Promise.resolve(function(e){const t=e.substring(e.indexOf(",")+1);if(-1!==e.indexOf(";base64")){if("undefined"!=typeof atob)return Uint8Array.from(atob(t),(e=>e.charCodeAt(0))).buffer;if("undefined"==typeof Buffer)return;return void 0!==Buffer.from?Buffer.from(t,"base64"):new Buffer(t,"base64")}const n=decodeURIComponent(t);return"undefined"!=typeof Buffer?void 0!==Buffer.from?Buffer.from(n):new Buffer(n):Uint8Array.from(n,(e=>e.charCodeAt(0))).buffer}(e));return function(e,{length:t}={}){return new Promise(((n,r)=>{const i=function(){try{return __non_webpack_require__("fs")}catch(e){return}}();i.open(e,((a,o)=>{a?r(a):i.stat(e,((a,s)=>{if(a)r(a);else{const a=Math.min(s.size,void 0!==t?t:s.size),u=Buffer.alloc(a),c={buffer:u,length:a};i.read(o,c,(t=>{t?r(t):i.close(o,(t=>{t&&console.warn(`Could not close file ${e}:`,t),n(u)}))}))}}))}))}))}(e,t)}(e,t).then((e=>Gb(e,t)));if(function(e){return"undefined"!=typeof File&&e instanceof File}(e))return t.async=!0,(n=e,new Promise(((e,t)=>{const r=new FileReader;r.onload=t=>e(t.target.result),r.onerror=()=>t(r.error),r.readAsArrayBuffer(n)}))).then((e=>Gb(e,t)));var n;return Gb(e,t)},loadView:Yb,errors:Vb};function Gb(e,t){return function(e){try{return Buffer.isBuffer(e)}catch(e){return!1}}(e)&&(e=new Uint8Array(e).buffer),Yb(function(e){try{return new DataView(e)}catch(t){return new im(e)}}(e),t)}function Yb(e,{expanded:t=!1,async:n=!1,includeUnknown:r=!1,domParser:i}={expanded:!1,async:!1,includeUnknown:!1,domParser:void 0}){let a=!1,o={};const s=[],{fileType:u,fileDataOffset:c,jfifDataOffset:l,tiffHeaderOffset:d,iptcDataOffset:f,xmpChunks:p,iccChunks:h,mpfDataOffset:m,pngHeaderOffset:g,pngTextChunks:y,pngChunkOffsets:_,vp8xChunkOffset:v,gifHeaderOffset:b}=dy.parseAppMarkers(e,n);if(function(e){return void 0!==e}(c)){a=!0;const n=t_.read(e,c);t?o.file=n:o=dm({},o,n)}if(function(e){return void 0!==e}(l)){a=!0;const n=u_.read(e,l);t?o.jfif=n:o=dm({},o,n)}if(function(e){return void 0!==e}(d)){a=!0;const{tags:n,byteOrder:s}=Vy.read(e,d,r);if(n.Thumbnail&&(o.Thumbnail=n.Thumbnail,delete n.Thumbnail),t?(o.exif=n,function(e){if(e.exif){if(e.exif.GPSLatitude&&e.exif.GPSLatitudeRef)try{e.gps=e.gps||{},e.gps.Latitude=Em(e.exif.GPSLatitude.value),"S"===e.exif.GPSLatitudeRef.value.join("")&&(e.gps.Latitude=-e.gps.Latitude)}catch(e){}if(e.exif.GPSLongitude&&e.exif.GPSLongitudeRef)try{e.gps=e.gps||{},e.gps.Longitude=Em(e.exif.GPSLongitude.value),"W"===e.exif.GPSLongitudeRef.value.join("")&&(e.gps.Longitude=-e.gps.Longitude)}catch(e){}if(e.exif.GPSAltitude&&e.exif.GPSAltitudeRef)try{e.gps=e.gps||{},e.gps.Altitude=e.exif.GPSAltitude.value[0]/e.exif.GPSAltitude.value[1],1===e.exif.GPSAltitudeRef.value&&(e.gps.Altitude=-e.gps.Altitude)}catch(e){}}}(o)):o=dm({},o,n),n["IPTC-NAA"]&&!Wb(f)){const e=b_.read(n["IPTC-NAA"].value,0,r);t?o.iptc=e:o=dm({},o,e)}if(n.ApplicationNotes&&!qb(p)){const e=$_.read(lm(n.ApplicationNotes.value),void 0,i);t?o.xmp=e:(delete e._raw,o=dm({},o,e))}if(n.ImageSourceData){const e=Sv.read(n.PhotoshopSettings.value,r);t?o.photoshop=e:o=dm({},o,e)}if(n.ICC_Profile&&!Kb(h)){const e=Dv.read(n.ICC_Profile.value,[{offset:0,length:n.ICC_Profile.value.length,chunkNumber:1,chunksTotal:1}]);t?o.icc=e:o=dm({},o,e)}if(function(e){return e.Make&&e.Make.value&&Array.isArray(e.Make.value)&&"Canon"===e.Make.value[0]&&e.MakerNote&&e.MakerNote.__offset}(n)){const i=Hv.read(e,d,n.MakerNote.__offset,s,r);t?o.makerNotes=i:o=dm({},o,i)}n.MakerNote&&delete n.MakerNote.__offset}if(Wb(f)){a=!0;const n=b_.read(e,f,r);t?o.iptc=n:o=dm({},o,n)}if(qb(p)){a=!0;const n=$_.read(e,p,i);t?o.xmp=n:(delete n._raw,o=dm({},o,n))}if(Kb(h)){a=!0;const t=Dv.read(e,h,n);t instanceof Promise?s.push(t.then(S)):S(t)}if(function(e){return void 0!==e}(m)){a=!0;const n=Wy.read(e,m,r);t?o.mpf=n:o=dm({},o,n)}if(void 0!==g){a=!0;const n=Yv.read(e,g);t?(o.png=o.png?dm({},o.png,n):n,o.pngFile=n):o=dm({},o,n)}if(function(e){return void 0!==e}(y)){a=!0;const{readTags:t,readTagsPromise:i}=tb.read(e,y,n,r);A(t),i&&s.push(i.then((e=>e.forEach(A))))}if(function(e){return void 0!==e}(_)){a=!0;const n=vb.read(e,_);t?o.png=o.png?dm({},o.png,n):n:o=dm({},o,n)}if(function(e){return void 0!==e}(v)){a=!0;const n=Tb.read(e,v);t?o.riff=o.riff?dm({},o.riff,n):n:o=dm({},o,n)}if(function(e){return void 0!==e}(b)){a=!0;const n=Lb.read(e,b);t?o.gif=o.gif?dm({},o.gif,n):n:o=dm({},o,n)}const E=jb.get(e,o.Thumbnail,d);if(E?(a=!0,o.Thumbnail=E):delete o.Thumbnail,u&&(t?(o.file||(o.file={}),o.file.FileType=u):o.FileType=u,a=!0),!a)throw new Vb.MetadataMissingError;return n?Promise.all(s).then((()=>o)):o;function S(e){t?o.icc=e:o=dm({},o,e)}function A(e){if(t){for(const t of["exif","iptc"]){const n=`__${t}`;e[n]&&(o[t]=o[t]?dm({},o.exif,e[n]):e[n],delete e[n])}o.png=o.png?dm({},o.png,e):e,o.pngText=o.pngText?dm({},o.png,e):e}else o=dm({},o,e.__exif?e.__exif:{},e.__iptc?e.__iptc:{},e),delete o.__exif,delete o.__iptc}}function Wb(e){return void 0!==e}function qb(e){return Array.isArray(e)&&e.length>0}function Kb(e){return Array.isArray(e)&&e.length>0}exports.ImageHelper=void 0,(Ub=exports.ImageHelper||(exports.ImageHelper={})).convertBlob=async(e,t="image/jpeg")=>{const n=(await exports.FileHelper.getType(e)).mime;if("image/heic"===n||"image/heif"===n){const{heicTo:n}=await Promise.resolve().then((function(){return require("./heic-to.cfb16ea4.js")}));e=await n({blob:e,type:t})}const r=await Ub.blobToImage(e),i=document.createElement("canvas");return i.width=r.width,i.height=r.height,i.getContext("2d").drawImage(r,0,0),i.toDataURL(t)},Ub.dataUrlToImage=async e=>new Promise(((t,n)=>{const r=new Image;r.onload=()=>t(r),r.onerror=()=>n(new Error("dataURLtoImage(): dataURL is illegal")),r.src=e})),Ub.blobToImage=async e=>{const t=URL.createObjectURL(e);return new Promise(((e,n)=>{const r=new Image;r.onload=()=>{URL.revokeObjectURL(t),e(r)},r.onerror=()=>n(new Error("blobToImage(): blob is illegal")),r.src=t}))},Ub.resampleImage=async(e,t)=>{const{crop:n,scale:r,width:i,height:a,quality:o=1,type:s="image/jpeg"}=t,u=document.createElement("canvas"),c=u.getContext("2d");if(r)u.width=e.width*r,u.height=e.height*r,c.drawImage(e,0,0,u.width,u.height);else if(i&&a){u.width=i,u.height=a;let t=e.height/a*i,r=e.height,o=(e.width-t)/2,s=0;(n&&e.height>e.width||!n&&e.height<e.width)&&(t=e.width,r=e.width/i*a,o=0,s=(e.height-r)/2),c.drawImage(e,o,s,t,r,0,0,i,a)}return new Promise((e=>u.toBlob((t=>e(t)),s,o)))},Ub.compressImage=async(e,t)=>{const{quality:n=1,fileSize:r,attempts:i=0,maxAttempts:a}=t,o=await Ub.blobToImage(e);if(e.size<=1024*r||n<0)return e;const s=await Ub.resampleImage(o,{scale:1,quality:n});return s.size>1024*r&&(i<a||!a)?Ub.compressImage(e,{...t,quality:n-.1,attempts:i+1}):s},Ub.getMetadata=async e=>{try{const t=await Hb.load(e),n=t.DateTimeOriginal?.description,r=Number(t.GPSLongitude?.description),i=Number(t.GPSLatitude?.description),a=isNaN(r)?void 0:Number(r);return{dateTimeOriginal:n,lat:isNaN(i)?void 0:Number(i),lng:a}}catch{}},function(e){e.degreesToRadians=e=>Math.PI*e/180,e.radiansToDegrees=e=>180*e/Math.PI,e.nauticalMilesToMetres=e=>1852*e}(Bb||(Bb={}));var Jb=xi,Xb=qa,Qb=Vr,eE=Hr,tE=Mi,nE=Gr.exports,rE=_i,iE=ui,aE=Object.prototype.hasOwnProperty;var oE=function(e){if(null==e)return!0;if(tE(e)&&(eE(e)||"string"==typeof e||"function"==typeof e.splice||nE(e)||iE(e)||Qb(e)))return!e.length;var t=Xb(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(rE(e))return!Jb(e).length;for(var n in e)if(aE.call(e,n))return!1;return!0};var sE,uE,cE=function(e){return null==e};!function(e){e.upsert=(e,t,n)=>{const r={...e};return r[t]=t in r?{...r[t],...n}:n,r},e.getNestedValueByKey=(t,n,r={})=>{const{skipRoot:i,searchIn:a}=r;if(!i&&n in t)return{[n]:t[n]};for(const[i,o]of Object.entries(t))if(o&&"object"==typeof o&&!Array.isArray(o)&&(!a||a.includes(i))){const t=e.getNestedValueByKey(o,n,{...r,skipRoot:!1});if(!oE(t))return t}},e.removeNil=t=>{if(null!==t){if(Array.isArray(t)){const n=t.map((t=>e.removeNil(t))).filter((e=>e));return n.length?n:void 0}if("object"==typeof t){const n={...t};return Object.entries(n).forEach((([t,r])=>{const i=e.removeNil(r);cE(i)?delete n[t]:n[t]=i})),oE(n)?void 0:n}return t}}}(sE||(sE={})),exports.TestHelper=void 0,(uE=exports.TestHelper||(exports.TestHelper={})).generateId=(e,t,n)=>{let r=e;return t&&(r+=`__${t}`),n&&(r+=`--${n}`),r},uE.getError=e=>{try{return e()}catch(e){return e}};const lE=t.createContext({formValidationConfig:null,setFormValidationConfig:()=>null,warnings:null,setWarnings:()=>null,yupId:null}),dE=({children:n})=>{const[r,i]=t.useState(),[a,o]=t.useState(),[s]=t.useState(rm()),u=t.useMemo((()=>({formValidationConfig:r,setFormValidationConfig:i,warnings:a,setWarnings:o,yupId:s})),[r,a,s]);return e.jsx(lE.Provider,{value:u,children:n})};var fE=dr,pE=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},hE=function(e){return this.__data__.has(e)};function mE(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new fE;++t<n;)this.add(e[t])}mE.prototype.add=mE.prototype.push=pE,mE.prototype.has=hE;var gE=mE;var yE=function(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1};var _E=function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1},vE=yE,bE=function(e){return e!=e},EE=_E;var SE=function(e,t,n){return t==t?EE(e,t,n):vE(e,bE,n)},AE=SE;var xE=function(e,t){return!!(null==e?0:e.length)&&AE(e,t,0)>-1};var wE=function(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1};var TE=function(e,t){return e.has(t)},ME=gE,OE=xE,CE=wE,NE=Vp,DE=ni,LE=TE,IE=Math.min;var kE=function(e,t,n){for(var r=n?CE:OE,i=e[0].length,a=e.length,o=a,s=Array(a),u=1/0,c=[];o--;){var l=e[o];o&&t&&(l=NE(l,DE(t))),u=IE(l.length,u),s[o]=!n&&(t||i>=120&&l.length>=120)?new ME(o&&l):void 0}l=e[0];var d=-1,f=s[0];e:for(;++d<i&&c.length<u;){var p=l[d],h=t?t(p):p;if(p=n||0!==p?p:0,!(f?LE(f,h):r(c,h,n))){for(o=a;--o;){var m=s[o];if(!(m?LE(m,h):r(e[o],h,n)))continue e}f&&f.push(h),c.push(p)}}return c};var $E=function(e){return e};var RE=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)},FE=Math.max;var zE=function(e,t,n){return t=FE(void 0===t?e.length-1:t,0),function(){for(var r=arguments,i=-1,a=FE(r.length-t,0),o=Array(a);++i<a;)o[i]=r[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=r[i];return s[t]=n(o),RE(e,this,s)}};var PE=function(e){return function(){return e}},jE=wr,ZE=jE?function(e,t){return jE(e,"toString",{configurable:!0,enumerable:!1,value:PE(t),writable:!0})}:$E,UE=ZE,BE=Date.now;var VE=function(e){var t=0,n=0;return function(){var r=BE(),i=16-(r-n);if(n=r,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(UE),HE=$E,GE=zE,YE=VE;var WE=function(e,t){return YE(GE(e,t,HE),e+"")},qE=Mi,KE=Rr;var JE=function(e){return KE(e)&&qE(e)},XE=JE;var QE,eS,tS=Vp,nS=kE,rS=function(e){return XE(e)?e:[]},iS=WE((function(e){var t=tS(e,rS);return t.length&&t[0]===e[0]?nS(t):[]}));try{QE=Map}catch(kf){}try{eS=Set}catch(kf){}function aS(e,t,n){if(!e||"object"!=typeof e||"function"==typeof e)return e;if(e.nodeType&&"cloneNode"in e)return e.cloneNode(!0);if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e);if(Array.isArray(e))return e.map(oS);if(QE&&e instanceof QE)return new Map(Array.from(e.entries()));if(eS&&e instanceof eS)return new Set(Array.from(e.values()));if(e instanceof Object){t.push(e);var r=Object.create(e);for(var i in n.push(r),e){var a=t.findIndex((function(t){return t===e[i]}));r[i]=a>-1?n[a]:aS(e[i],t,n)}return r}return e}function oS(e){return aS(e,[],[])}const sS=Object.prototype.toString,uS=Error.prototype.toString,cS=RegExp.prototype.toString,lS="undefined"!=typeof Symbol?Symbol.prototype.toString:()=>"",dS=/^Symbol\((.*)\)(.*)$/;function fS(e,t=!1){if(null==e||!0===e||!1===e)return""+e;const n=typeof e;if("number"===n)return function(e){return e!=+e?"NaN":0===e&&1/e<0?"-0":""+e}(e);if("string"===n)return t?`"${e}"`:e;if("function"===n)return"[Function "+(e.name||"anonymous")+"]";if("symbol"===n)return lS.call(e).replace(dS,"Symbol($1)");const r=sS.call(e).slice(8,-1);return"Date"===r?isNaN(e.getTime())?""+e:e.toISOString(e):"Error"===r||e instanceof Error?"["+uS.call(e)+"]":"RegExp"===r?cS.call(e):null}function pS(e,t){let n=fS(e,t);return null!==n?n:JSON.stringify(e,(function(e,n){let r=fS(this[e],t);return null!==r?r:n}),2)}let hS={default:"${path} is invalid",required:"${path} is a required field",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:n,originalValue:r})=>{let i=null!=r&&r!==n,a=`${e} must be a \`${t}\` type, but the final value was: \`${pS(n,!0)}\``+(i?` (cast from the value \`${pS(r,!0)}\`).`:".");return null===n&&(a+='\n If "null" is intended as an empty value be sure to mark the schema as `.nullable()`'),a},defined:"${path} must be defined"},mS={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},gS={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},yS={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},_S={isValue:"${path} field must be ${value}"},vS={noUnknown:"${path} field has unspecified keys: ${unknown}"},bS={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"};var ES=Object.assign(Object.create(null),{mixed:hS,string:mS,number:gS,date:yS,object:vS,array:bS,boolean:_S}),SS=Object.prototype.hasOwnProperty;var AS=function(e,t){return null!=e&&SS.call(e,t)},xS=Hr,wS=Yp,TS=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,MS=/^\w*$/;var OS=function(e,t){if(xS(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!wS(e))||(MS.test(e)||!TS.test(e)||null!=t&&e in Object(t))},CS=dr;function NS(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(NS.Cache||CS),n}NS.Cache=CS;var DS=NS;var LS=function(e){var t=DS(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t},IS=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,kS=/\\(\\)?/g,$S=LS((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(IS,(function(e,n,r,i){t.push(r?i.replace(kS,"$1"):n||e)})),t})),RS=Hr,FS=OS,zS=$S,PS=th;var jS=function(e,t){return RS(e)?e:FS(e,t)?[e]:zS(PS(e))},ZS=Yp;var US=function(e){if("string"==typeof e||ZS(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},BS=jS,VS=Vr,HS=Hr,GS=qr,YS=Kr,WS=US;var qS=function(e,t,n){for(var r=-1,i=(t=BS(t,e)).length,a=!1;++r<i;){var o=WS(t[r]);if(!(a=null!=e&&n(e,o)))break;e=e[o]}return a||++r!=i?a:!!(i=null==e?0:e.length)&&YS(i)&&GS(o,i)&&(HS(e)||VS(e))},KS=AS,JS=qS;var XS=function(e,t){return null!=e&&JS(e,t,KS)};const QS=e=>e&&e.__isYupSchema__;class eA{constructor(e,t){if(this.fn=void 0,this.refs=e,this.refs=e,"function"==typeof t)return void(this.fn=t);if(!XS(t,"is"))throw new TypeError("`is:` is required for `when()` conditions");if(!t.then&&!t.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:n,then:r,otherwise:i}=t,a="function"==typeof n?n:(...e)=>e.every((e=>e===n));this.fn=function(...e){let t=e.pop(),n=e.pop(),o=a(...e)?r:i;if(o)return"function"==typeof o?o(n):n.concat(o.resolve(t))}}resolve(e,t){let n=this.refs.map((e=>e.getValue(null==t?void 0:t.value,null==t?void 0:t.parent,null==t?void 0:t.context))),r=this.fn.apply(e,n.concat(e,t));if(void 0===r||r===e)return e;if(!QS(r))throw new TypeError("conditions must return a schema object");return r.resolve(t)}}function tA(e){return null==e?[]:[].concat(e)}function nA(){return nA=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},nA.apply(this,arguments)}let rA=/\$\{\s*(\w+)\s*\}/g;class iA extends Error{static formatError(e,t){const n=t.label||t.path||"this";return n!==t.path&&(t=nA({},t,{path:n})),"string"==typeof e?e.replace(rA,((e,n)=>pS(t[n]))):"function"==typeof e?e(t):e}static isError(e){return e&&"ValidationError"===e.name}constructor(e,t,n,r){super(),this.value=void 0,this.path=void 0,this.type=void 0,this.errors=void 0,this.params=void 0,this.inner=void 0,this.name="ValidationError",this.value=t,this.path=n,this.type=r,this.errors=[],this.inner=[],tA(e).forEach((e=>{iA.isError(e)?(this.errors.push(...e.errors),this.inner=this.inner.concat(e.inner.length?e.inner:e)):this.errors.push(e)})),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0],Error.captureStackTrace&&Error.captureStackTrace(this,iA)}}function aA(e,t){let{endEarly:n,tests:r,args:i,value:a,errors:o,sort:s,path:u}=e,c=(e=>{let t=!1;return(...n)=>{t||(t=!0,e(...n))}})(t),l=r.length;const d=[];if(o=o||[],!l)return o.length?c(new iA(o,a,u)):c(null,a);for(let e=0;e<r.length;e++){(0,r[e])(i,(function(e){if(e){if(!iA.isError(e))return c(e,a);if(n)return e.value=a,c(e,a);d.push(e)}if(--l<=0){if(d.length&&(s&&d.sort(s),o.length&&d.push(...o),o=d),o.length)return void c(new iA(o,a,u),a);c(null,a)}}))}}var oA=function(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var u=o[e?s:++i];if(!1===n(a[u],u,a))break}return t}},sA=oA(),uA=sA,cA=Di;var lA=function(e,t){return e&&uA(e,t,cA)};var dA=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1},fA=gE,pA=dA,hA=TE;var mA=function(e,t,n,r,i,a){var o=1&n,s=e.length,u=t.length;if(s!=u&&!(o&&u>s))return!1;var c=a.get(e),l=a.get(t);if(c&&l)return c==t&&l==e;var d=-1,f=!0,p=2&n?new fA:void 0;for(a.set(e,t),a.set(t,e);++d<s;){var h=e[d],m=t[d];if(r)var g=o?r(m,h,d,t,e,a):r(h,m,d,e,t,a);if(void 0!==g){if(g)continue;f=!1;break}if(p){if(!pA(t,(function(e,t){if(!hA(p,t)&&(h===e||i(h,e,n,r,a)))return p.push(t)}))){f=!1;break}}else if(h!==m&&!i(h,m,n,r,a)){f=!1;break}}return a.delete(e),a.delete(t),f};var gA=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n};var yA=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n},_A=Xa,vA=wt,bA=mA,EA=gA,SA=yA,AA=qt?qt.prototype:void 0,xA=AA?AA.valueOf:void 0;var wA=function(e,t,n,r,i,a,o){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!a(new _A(e),new _A(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return vA(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var s=EA;case"[object Set]":var u=1&r;if(s||(s=SA),e.size!=t.size&&!u)return!1;var c=o.get(e);if(c)return c==t;r|=2,o.set(e,t);var l=bA(s(e),s(t),r,i,a,o);return o.delete(e),l;case"[object Symbol]":if(xA)return xA.call(e)==xA.call(t)}return!1},TA=Aa,MA=Object.prototype.hasOwnProperty;var OA=function(e,t,n,r,i,a){var o=1&n,s=TA(e),u=s.length;if(u!=TA(t).length&&!o)return!1;for(var c=u;c--;){var l=s[c];if(!(o?l in t:MA.call(t,l)))return!1}var d=a.get(e),f=a.get(t);if(d&&f)return d==t&&f==e;var p=!0;a.set(e,t),a.set(t,e);for(var h=o;++c<u;){var m=e[l=s[c]],g=t[l];if(r)var y=o?r(g,m,l,t,e,a):r(m,g,l,e,t,a);if(!(void 0===y?m===g||i(m,g,n,r,a):y)){p=!1;break}h||(h="constructor"==l)}if(p&&!h){var _=e.constructor,v=t.constructor;_==v||!("constructor"in e)||!("constructor"in t)||"function"==typeof _&&_ instanceof _&&"function"==typeof v&&v instanceof v||(p=!1)}return a.delete(e),a.delete(t),p},CA=Sr,NA=mA,DA=wA,LA=OA,IA=qa,kA=Hr,$A=Gr.exports,RA=ui,FA="[object Arguments]",zA="[object Array]",PA="[object Object]",jA=Object.prototype.hasOwnProperty;var ZA=function(e,t,n,r,i,a){var o=kA(e),s=kA(t),u=o?zA:IA(e),c=s?zA:IA(t),l=(u=u==FA?PA:u)==PA,d=(c=c==FA?PA:c)==PA,f=u==c;if(f&&$A(e)){if(!$A(t))return!1;o=!0,l=!1}if(f&&!l)return a||(a=new CA),o||RA(e)?NA(e,t,n,r,i,a):DA(e,t,u,n,r,i,a);if(!(1&n)){var p=l&&jA.call(e,"__wrapped__"),h=d&&jA.call(t,"__wrapped__");if(p||h){var m=p?e.value():e,g=h?t.value():t;return a||(a=new CA),i(m,g,n,r,a)}}return!!f&&(a||(a=new CA),LA(e,t,n,r,i,a))},UA=ZA,BA=Rr;var VA=function e(t,n,r,i,a){return t===n||(null==t||null==n||!BA(t)&&!BA(n)?t!=t&&n!=n:UA(t,n,r,i,e,a))},HA=Sr,GA=VA;var YA=function(e,t,n,r){var i=n.length,a=i,o=!r;if(null==e)return!a;for(e=Object(e);i--;){var s=n[i];if(o&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<a;){var u=(s=n[i])[0],c=e[u],l=s[1];if(o&&s[2]){if(void 0===c&&!(u in e))return!1}else{var d=new HA;if(r)var f=r(c,l,u,e,t,d);if(!(void 0===f?GA(l,c,3,r,d):f))return!1}}return!0},WA=un;var qA=function(e){return e==e&&!WA(e)},KA=qA,JA=Di;var XA=function(e){for(var t=JA(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,KA(i)]}return t};var QA=function(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}},ex=YA,tx=XA,nx=QA;var rx=function(e){var t=tx(e);return 1==t.length&&t[0][2]?nx(t[0][0],t[0][1]):function(n){return n===e||ex(n,e,t)}},ix=jS,ax=US;var ox=function(e,t){for(var n=0,r=(t=ix(t,e)).length;null!=e&&n<r;)e=e[ax(t[n++])];return n&&n==r?e:void 0},sx=ox;var ux=function(e,t,n){var r=null==e?void 0:sx(e,t);return void 0===r?n:r};var cx=function(e,t){return null!=e&&t in Object(e)},lx=cx,dx=qS;var fx=function(e,t){return null!=e&&dx(e,t,lx)},px=VA,hx=ux,mx=fx,gx=OS,yx=qA,_x=QA,vx=US;var bx=function(e,t){return gx(e)&&yx(t)?_x(vx(e),t):function(n){var r=hx(n,e);return void 0===r&&r===t?mx(n,e):px(t,r,3)}};var Ex=function(e){return function(t){return null==t?void 0:t[e]}},Sx=ox;var Ax=function(e){return function(t){return Sx(t,e)}},xx=Ex,wx=Ax,Tx=OS,Mx=US;var Ox=rx,Cx=bx,Nx=$E,Dx=Hr,Lx=function(e){return Tx(e)?xx(Mx(e)):wx(e)};var Ix=function(e){return"function"==typeof e?e:null==e?Nx:"object"==typeof e?Dx(e)?Cx(e[0],e[1]):Ox(e):Lx(e)},kx=Mr,$x=lA,Rx=Ix;var Fx=function(e,t){var n={};return t=Rx(t),$x(e,(function(e,r,i){kx(n,r,t(e,r,i))})),n};function zx(e){this._maxSize=e,this.clear()}zx.prototype.clear=function(){this._size=0,this._values=Object.create(null)},zx.prototype.get=function(e){return this._values[e]},zx.prototype.set=function(e,t){return this._size>=this._maxSize&&this.clear(),e in this._values||this._size++,this._values[e]=t};var Px=/[^.^\]^[]+|(?=\[\]|\.\.)/g,jx=/^\d+$/,Zx=/^\d/,Ux=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,Bx=/^\s*(['"]?)(.*?)(\1)\s*$/,Vx=new zx(512),Hx=new zx(512),Gx=new zx(512),Yx={Cache:zx,split:qx,normalizePath:Wx,setter:function(e){var t=Wx(e);return Hx.get(e)||Hx.set(e,(function(e,n){for(var r=0,i=t.length,a=e;r<i-1;){var o=t[r];if("__proto__"===o||"constructor"===o||"prototype"===o)return e;a=a[t[r++]]}a[t[r]]=n}))},getter:function(e,t){var n=Wx(e);return Gx.get(e)||Gx.set(e,(function(e){for(var r=0,i=n.length;r<i;){if(null==e&&t)return;e=e[n[r++]]}return e}))},join:function(e){return e.reduce((function(e,t){return e+(Kx(t)||jx.test(t)?"["+t+"]":(e?".":"")+t)}),"")},forEach:function(e,t,n){!function(e,t,n){var r,i,a,o,s=e.length;for(i=0;i<s;i++)(r=e[i])&&(Jx(r)&&(r='"'+r+'"'),a=!(o=Kx(r))&&/^\d+$/.test(r),t.call(n,r,o,a,i,e))}(Array.isArray(e)?e:qx(e),t,n)}};function Wx(e){return Vx.get(e)||Vx.set(e,qx(e).map((function(e){return e.replace(Bx,"$2")})))}function qx(e){return e.match(Px)||[""]}function Kx(e){return"string"==typeof e&&e&&-1!==["'",'"'].indexOf(e.charAt(0))}function Jx(e){return!Kx(e)&&(function(e){return e.match(Zx)&&!e.match(jx)}(e)||function(e){return Ux.test(e)}(e))}const Xx="$",Qx=".";class ew{constructor(e,t={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,"string"!=typeof e)throw new TypeError("ref must be a string, got: "+e);if(this.key=e.trim(),""===e)throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===Xx,this.isValue=this.key[0]===Qx,this.isSibling=!this.isContext&&!this.isValue;let n=this.isContext?Xx:this.isValue?Qx:"";this.path=this.key.slice(n.length),this.getter=this.path&&Yx.getter(this.path,!0),this.map=t.map}getValue(e,t,n){let r=this.isContext?n:this.isValue?e:t;return this.getter&&(r=this.getter(r||{})),this.map&&(r=this.map(r)),r}cast(e,t){return this.getValue(e,null==t?void 0:t.parent,null==t?void 0:t.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(e){return e&&e.__isYupRef}}function tw(){return tw=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tw.apply(this,arguments)}function nw(e){function t(t,n){let{value:r,path:i="",label:a,options:o,originalValue:s,sync:u}=t,c=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(t,["value","path","label","options","originalValue","sync"]);const{name:l,test:d,params:f,message:p}=e;let{parent:h,context:m}=o;function g(e){return ew.isRef(e)?e.getValue(r,h,m):e}function y(e={}){const t=Fx(tw({value:r,originalValue:s,label:a,path:e.path||i},f,e.params),g),n=new iA(iA.formatError(e.message||p,t),r,t.path,e.type||l);return n.params=t,n}let _,v=tw({path:i,parent:h,type:l,createError:y,resolve:g,options:o,originalValue:s},c);if(u){try{var b;if(_=d.call(v,r,v),"function"==typeof(null==(b=_)?void 0:b.then))throw new Error(`Validation test of type: "${v.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`)}catch(e){return void n(e)}iA.isError(_)?n(_):_?n(null,_):n(y())}else try{Promise.resolve(d.call(v,r,v)).then((e=>{iA.isError(e)?n(e):e?n(null,e):n(y())})).catch(n)}catch(e){n(e)}}return t.OPTIONS=e,t}ew.prototype.__isYupRef=!0;function rw(e,t,n,r=n){let i,a,o;return t?(Yx.forEach(t,((s,u,c)=>{let l=u?(e=>e.substr(0,e.length-1).substr(1))(s):s;if((e=e.resolve({context:r,parent:i,value:n})).innerType){let r=c?parseInt(l,10):0;if(n&&r>=n.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${s}, in the path: ${t}. because there is no value at that index. `);i=n,n=n&&n[r],e=e.innerType}if(!c){if(!e.fields||!e.fields[l])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${o} which is a type: "${e._type}")`);i=n,n=n&&n[l],e=e.fields[l]}a=l,o=u?"["+s+"]":"."+s})),{schema:e,parent:i,parentPath:a}):{parent:i,parentPath:t,schema:e}}class iw{constructor(){this.list=void 0,this.refs=void 0,this.list=new Set,this.refs=new Map}get size(){return this.list.size+this.refs.size}describe(){const e=[];for(const t of this.list)e.push(t);for(const[,t]of this.refs)e.push(t.describe());return e}toArray(){return Array.from(this.list).concat(Array.from(this.refs.values()))}resolveAll(e){return this.toArray().reduce(((t,n)=>t.concat(ew.isRef(n)?e(n):n)),[])}add(e){ew.isRef(e)?this.refs.set(e.key,e):this.list.add(e)}delete(e){ew.isRef(e)?this.refs.delete(e.key):this.list.delete(e)}clone(){const e=new iw;return e.list=new Set(this.list),e.refs=new Map(this.refs),e}merge(e,t){const n=this.clone();return e.list.forEach((e=>n.add(e))),e.refs.forEach((e=>n.add(e))),t.list.forEach((e=>n.delete(e))),t.refs.forEach((e=>n.delete(e))),n}}function aw(){return aw=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},aw.apply(this,arguments)}class ow{constructor(e){this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this._typeError=void 0,this._whitelist=new iw,this._blacklist=new iw,this.exclusiveTests=Object.create(null),this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation((()=>{this.typeError(hS.notType)})),this.type=(null==e?void 0:e.type)||"mixed",this.spec=aw({strip:!1,strict:!1,abortEarly:!0,recursive:!0,nullable:!1,presence:"optional"},null==e?void 0:e.spec)}get _type(){return this.type}_typeCheck(e){return!0}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),this;const t=Object.create(Object.getPrototypeOf(this));return t.type=this.type,t._typeError=this._typeError,t._whitelistError=this._whitelistError,t._blacklistError=this._blacklistError,t._whitelist=this._whitelist.clone(),t._blacklist=this._blacklist.clone(),t.exclusiveTests=aw({},this.exclusiveTests),t.deps=[...this.deps],t.conditions=[...this.conditions],t.tests=[...this.tests],t.transforms=[...this.transforms],t.spec=oS(aw({},this.spec,e)),t}label(e){let t=this.clone();return t.spec.label=e,t}meta(...e){if(0===e.length)return this.spec.meta;let t=this.clone();return t.spec.meta=Object.assign(t.spec.meta||{},e[0]),t}withMutation(e){let t=this._mutate;this._mutate=!0;let n=e(this);return this._mutate=t,n}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&"mixed"!==this.type)throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let t=this,n=e.clone();const r=aw({},t.spec,n.spec);return n.spec=r,n._typeError||(n._typeError=t._typeError),n._whitelistError||(n._whitelistError=t._whitelistError),n._blacklistError||(n._blacklistError=t._blacklistError),n._whitelist=t._whitelist.merge(e._whitelist,e._blacklist),n._blacklist=t._blacklist.merge(e._blacklist,e._whitelist),n.tests=t.tests,n.exclusiveTests=t.exclusiveTests,n.withMutation((t=>{e.tests.forEach((e=>{t.test(e.OPTIONS)}))})),n.transforms=[...t.transforms,...n.transforms],n}isType(e){return!(!this.spec.nullable||null!==e)||this._typeCheck(e)}resolve(e){let t=this;if(t.conditions.length){let n=t.conditions;t=t.clone(),t.conditions=[],t=n.reduce(((t,n)=>n.resolve(t,e)),t),t=t.resolve(e)}return t}cast(e,t={}){let n=this.resolve(aw({value:e},t)),r=n._cast(e,t);if(void 0!==e&&!1!==t.assert&&!0!==n.isType(r)){let i=pS(e),a=pS(r);throw new TypeError(`The value of ${t.path||"field"} could not be cast to a value that satisfies the schema type: "${n._type}". \n\nattempted value: ${i} \n`+(a!==i?`result of cast: ${a}`:""))}return r}_cast(e,t){let n=void 0===e?e:this.transforms.reduce(((t,n)=>n.call(this,t,e,this)),e);return void 0===n&&(n=this.getDefault()),n}_validate(e,t={},n){let{sync:r,path:i,from:a=[],originalValue:o=e,strict:s=this.spec.strict,abortEarly:u=this.spec.abortEarly}=t,c=e;s||(c=this._cast(c,aw({assert:!1},t)));let l={value:c,path:i,options:t,originalValue:o,schema:this,label:this.spec.label,sync:r,from:a},d=[];this._typeError&&d.push(this._typeError);let f=[];this._whitelistError&&f.push(this._whitelistError),this._blacklistError&&f.push(this._blacklistError),aA({args:l,value:c,path:i,sync:r,tests:d,endEarly:u},(e=>{e?n(e,c):aA({tests:this.tests.concat(f),args:l,path:i,sync:r,value:c,endEarly:u},n)}))}validate(e,t,n){let r=this.resolve(aw({},t,{value:e}));return"function"==typeof n?r._validate(e,t,n):new Promise(((n,i)=>r._validate(e,t,((e,t)=>{e?i(e):n(t)}))))}validateSync(e,t){let n;return this.resolve(aw({},t,{value:e}))._validate(e,aw({},t,{sync:!0}),((e,t)=>{if(e)throw e;n=t})),n}isValid(e,t){return this.validate(e,t).then((()=>!0),(e=>{if(iA.isError(e))return!1;throw e}))}isValidSync(e,t){try{return this.validateSync(e,t),!0}catch(e){if(iA.isError(e))return!1;throw e}}_getDefault(){let e=this.spec.default;return null==e?e:"function"==typeof e?e.call(this):oS(e)}getDefault(e){return this.resolve(e||{})._getDefault()}default(e){if(0===arguments.length)return this._getDefault();return this.clone({default:e})}strict(e=!0){let t=this.clone();return t.spec.strict=e,t}_isPresent(e){return null!=e}defined(e=hS.defined){return this.test({message:e,name:"defined",exclusive:!0,test:e=>void 0!==e})}required(e=hS.required){return this.clone({presence:"required"}).withMutation((t=>t.test({message:e,name:"required",exclusive:!0,test(e){return this.schema._isPresent(e)}})))}notRequired(){let e=this.clone({presence:"optional"});return e.tests=e.tests.filter((e=>"required"!==e.OPTIONS.name)),e}nullable(e=!0){return this.clone({nullable:!1!==e})}transform(e){let t=this.clone();return t.transforms.push(e),t}test(...e){let t;if(t=1===e.length?"function"==typeof e[0]?{test:e[0]}:e[0]:2===e.length?{name:e[0],test:e[1]}:{name:e[0],message:e[1],test:e[2]},void 0===t.message&&(t.message=hS.default),"function"!=typeof t.test)throw new TypeError("`test` is a required parameters");let n=this.clone(),r=nw(t),i=t.exclusive||t.name&&!0===n.exclusiveTests[t.name];if(t.exclusive&&!t.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return t.name&&(n.exclusiveTests[t.name]=!!t.exclusive),n.tests=n.tests.filter((e=>{if(e.OPTIONS.name===t.name){if(i)return!1;if(e.OPTIONS.test===r.OPTIONS.test)return!1}return!0})),n.tests.push(r),n}when(e,t){Array.isArray(e)||"string"==typeof e||(t=e,e=".");let n=this.clone(),r=tA(e).map((e=>new ew(e)));return r.forEach((e=>{e.isSibling&&n.deps.push(e.key)})),n.conditions.push(new eA(r,t)),n}typeError(e){let t=this.clone();return t._typeError=nw({message:e,name:"typeError",test(e){return!(void 0!==e&&!this.schema.isType(e))||this.createError({params:{type:this.schema._type}})}}),t}oneOf(e,t=hS.oneOf){let n=this.clone();return e.forEach((e=>{n._whitelist.add(e),n._blacklist.delete(e)})),n._whitelistError=nw({message:t,name:"oneOf",test(e){if(void 0===e)return!0;let t=this.schema._whitelist,n=t.resolveAll(this.resolve);return!!n.includes(e)||this.createError({params:{values:t.toArray().join(", "),resolved:n}})}}),n}notOneOf(e,t=hS.notOneOf){let n=this.clone();return e.forEach((e=>{n._blacklist.add(e),n._whitelist.delete(e)})),n._blacklistError=nw({message:t,name:"notOneOf",test(e){let t=this.schema._blacklist,n=t.resolveAll(this.resolve);return!n.includes(e)||this.createError({params:{values:t.toArray().join(", "),resolved:n}})}}),n}strip(e=!0){let t=this.clone();return t.spec.strip=e,t}describe(){const e=this.clone(),{label:t,meta:n}=e.spec,r={meta:n,label:t,type:e.type,oneOf:e._whitelist.describe(),notOneOf:e._blacklist.describe(),tests:e.tests.map((e=>({name:e.OPTIONS.name,params:e.OPTIONS.params}))).filter(((e,t,n)=>n.findIndex((t=>t.name===e.name))===t))};return r}}ow.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])ow.prototype[`${e}At`]=function(t,n,r={}){const{parent:i,parentPath:a,schema:o}=rw(this,t,n,r.context);return o[e](i&&i[a],aw({},r,{parent:i,path:t}))};for(const e of["equals","is"])ow.prototype[e]=ow.prototype.oneOf;for(const e of["not","nope"])ow.prototype[e]=ow.prototype.notOneOf;ow.prototype.optional=ow.prototype.notRequired;const sw=ow;function uw(){return new sw}uw.prototype=sw.prototype;const cw=e=>null==e;function lw(){return new dw}class dw extends ow{constructor(){super({type:"boolean"}),this.withMutation((()=>{this.transform((function(e){if(!this.isType(e)){if(/^(true|1)$/i.test(String(e)))return!0;if(/^(false|0)$/i.test(String(e)))return!1}return e}))}))}_typeCheck(e){return e instanceof Boolean&&(e=e.valueOf()),"boolean"==typeof e}isTrue(e=_S.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"true"},test:e=>cw(e)||!0===e})}isFalse(e=_S.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"false"},test:e=>cw(e)||!1===e})}}lw.prototype=dw.prototype;let fw=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i,pw=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,hw=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,mw=e=>cw(e)||e===e.trim(),gw={}.toString();function yw(){return new _w}class _w extends ow{constructor(){super({type:"string"}),this.withMutation((()=>{this.transform((function(e){if(this.isType(e))return e;if(Array.isArray(e))return e;const t=null!=e&&e.toString?e.toString():e;return t===gw?e:t}))}))}_typeCheck(e){return e instanceof String&&(e=e.valueOf()),"string"==typeof e}_isPresent(e){return super._isPresent(e)&&!!e.length}length(e,t=mS.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},test(t){return cw(t)||t.length===this.resolve(e)}})}min(e,t=mS.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},test(t){return cw(t)||t.length>=this.resolve(e)}})}max(e,t=mS.max){return this.test({name:"max",exclusive:!0,message:t,params:{max:e},test(t){return cw(t)||t.length<=this.resolve(e)}})}matches(e,t){let n,r,i=!1;return t&&("object"==typeof t?({excludeEmptyString:i=!1,message:n,name:r}=t):n=t),this.test({name:r||"matches",message:n||mS.matches,params:{regex:e},test:t=>cw(t)||""===t&&i||-1!==t.search(e)})}email(e=mS.email){return this.matches(fw,{name:"email",message:e,excludeEmptyString:!0})}url(e=mS.url){return this.matches(pw,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=mS.uuid){return this.matches(hw,{name:"uuid",message:e,excludeEmptyString:!1})}ensure(){return this.default("").transform((e=>null===e?"":e))}trim(e=mS.trim){return this.transform((e=>null!=e?e.trim():e)).test({message:e,name:"trim",test:mw})}lowercase(e=mS.lowercase){return this.transform((e=>cw(e)?e:e.toLowerCase())).test({message:e,name:"string_case",exclusive:!0,test:e=>cw(e)||e===e.toLowerCase()})}uppercase(e=mS.uppercase){return this.transform((e=>cw(e)?e:e.toUpperCase())).test({message:e,name:"string_case",exclusive:!0,test:e=>cw(e)||e===e.toUpperCase()})}}yw.prototype=_w.prototype;function vw(){return new bw}class bw extends ow{constructor(){super({type:"number"}),this.withMutation((()=>{this.transform((function(e){let t=e;if("string"==typeof t){if(t=t.replace(/\s/g,""),""===t)return NaN;t=+t}return this.isType(t)?t:parseFloat(t)}))}))}_typeCheck(e){return e instanceof Number&&(e=e.valueOf()),"number"==typeof e&&!(e=>e!=+e)(e)}min(e,t=gS.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},test(t){return cw(t)||t>=this.resolve(e)}})}max(e,t=gS.max){return this.test({message:t,name:"max",exclusive:!0,params:{max:e},test(t){return cw(t)||t<=this.resolve(e)}})}lessThan(e,t=gS.lessThan){return this.test({message:t,name:"max",exclusive:!0,params:{less:e},test(t){return cw(t)||t<this.resolve(e)}})}moreThan(e,t=gS.moreThan){return this.test({message:t,name:"min",exclusive:!0,params:{more:e},test(t){return cw(t)||t>this.resolve(e)}})}positive(e=gS.positive){return this.moreThan(0,e)}negative(e=gS.negative){return this.lessThan(0,e)}integer(e=gS.integer){return this.test({name:"integer",message:e,test:e=>cw(e)||Number.isInteger(e)})}truncate(){return this.transform((e=>cw(e)?e:0|e))}round(e){var t;let n=["ceil","floor","round","trunc"];if("trunc"===(e=(null==(t=e)?void 0:t.toLowerCase())||"round"))return this.truncate();if(-1===n.indexOf(e.toLowerCase()))throw new TypeError("Only valid options for round() are: "+n.join(", "));return this.transform((t=>cw(t)?t:Math[e](t)))}}vw.prototype=bw.prototype;var Ew=/^(\d{4}|[+\-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,\.](\d{1,}))?)?(?:(Z)|([+\-])(\d{2})(?::?(\d{2}))?)?)?$/;let Sw=new Date("");function Aw(){return new xw}class xw extends ow{constructor(){super({type:"date"}),this.withMutation((()=>{this.transform((function(e){return this.isType(e)?e:(e=function(e){var t,n,r=[1,4,5,6,7,10,11],i=0;if(n=Ew.exec(e)){for(var a,o=0;a=r[o];++o)n[a]=+n[a]||0;n[2]=(+n[2]||1)-1,n[3]=+n[3]||1,n[7]=n[7]?String(n[7]).substr(0,3):0,void 0!==n[8]&&""!==n[8]||void 0!==n[9]&&""!==n[9]?("Z"!==n[8]&&void 0!==n[9]&&(i=60*n[10]+n[11],"+"===n[9]&&(i=0-i)),t=Date.UTC(n[1],n[2],n[3],n[4],n[5]+i,n[6],n[7])):t=+new Date(n[1],n[2],n[3],n[4],n[5],n[6],n[7])}else t=Date.parse?Date.parse(e):NaN;return t}(e),isNaN(e)?Sw:new Date(e))}))}))}_typeCheck(e){return t=e,"[object Date]"===Object.prototype.toString.call(t)&&!isNaN(e.getTime());var t}prepareParam(e,t){let n;if(ew.isRef(e))n=e;else{let r=this.cast(e);if(!this._typeCheck(r))throw new TypeError(`\`${t}\` must be a Date or a value that can be \`cast()\` to a Date`);n=r}return n}min(e,t=yS.min){let n=this.prepareParam(e,"min");return this.test({message:t,name:"min",exclusive:!0,params:{min:e},test(e){return cw(e)||e>=this.resolve(n)}})}max(e,t=yS.max){let n=this.prepareParam(e,"max");return this.test({message:t,name:"max",exclusive:!0,params:{max:e},test(e){return cw(e)||e<=this.resolve(n)}})}}xw.INVALID_DATE=Sw,Aw.prototype=xw.prototype,Aw.INVALID_DATE=Sw;var ww=function(e,t,n,r){var i=-1,a=null==e?0:e.length;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n};var Tw=function(e){return function(t){return null==e?void 0:e[t]}},Mw=Tw({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Ow=th,Cw=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Nw=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");var Dw=function(e){return(e=Ow(e))&&e.replace(Cw,Mw).replace(Nw,"")},Lw=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var Iw=function(e){return e.match(Lw)||[]},kw=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var $w=function(e){return kw.test(e)},Rw="\\ud800-\\udfff",Fw="\\u2700-\\u27bf",zw="a-z\\xdf-\\xf6\\xf8-\\xff",Pw="A-Z\\xc0-\\xd6\\xd8-\\xde",jw="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Zw="["+jw+"]",Uw="\\d+",Bw="["+Fw+"]",Vw="["+zw+"]",Hw="[^"+Rw+jw+Uw+Fw+zw+Pw+"]",Gw="(?:\\ud83c[\\udde6-\\uddff]){2}",Yw="[\\ud800-\\udbff][\\udc00-\\udfff]",Ww="["+Pw+"]",qw="(?:"+Vw+"|"+Hw+")",Kw="(?:"+Ww+"|"+Hw+")",Jw="(?:['’](?:d|ll|m|re|s|t|ve))?",Xw="(?:['’](?:D|LL|M|RE|S|T|VE))?",Qw="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",eT="[\\ufe0e\\ufe0f]?",tT=eT+Qw+("(?:\\u200d(?:"+["[^"+Rw+"]",Gw,Yw].join("|")+")"+eT+Qw+")*"),nT="(?:"+[Bw,Gw,Yw].join("|")+")"+tT,rT=RegExp([Ww+"?"+Vw+"+"+Jw+"(?="+[Zw,Ww,"$"].join("|")+")",Kw+"+"+Xw+"(?="+[Zw,Ww+qw,"$"].join("|")+")",Ww+"?"+qw+"+"+Jw,Ww+"+"+Xw,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Uw,nT].join("|"),"g");var iT=function(e){return e.match(rT)||[]},aT=Iw,oT=$w,sT=th,uT=iT;var cT=function(e,t,n){return e=sT(e),void 0===(t=n?void 0:t)?oT(e)?uT(e):aT(e):e.match(t)||[]},lT=ww,dT=Dw,fT=cT,pT=RegExp("['’]","g");var hT=function(e){return function(t){return lT(fT(dT(t).replace(pT,"")),e,"")}},mT=hT((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()})),gT=mT,yT=Ih,_T=hT((function(e,t,n){return t=t.toLowerCase(),e+(n?yT(t):t)})),vT=_T,bT=Mr,ET=lA,ST=Ix;var AT=function(e,t){var n={};return t=ST(t),ET(e,(function(e,r,i){bT(n,t(e,r,i),e)})),n},xT={exports:{}};function wT(e,t){var n=e.length,r=new Array(n),i={},a=n,o=function(e){for(var t=new Map,n=0,r=e.length;n<r;n++){var i=e[n];t.has(i[0])||t.set(i[0],new Set),t.has(i[1])||t.set(i[1],new Set),t.get(i[0]).add(i[1])}return t}(t),s=function(e){for(var t=new Map,n=0,r=e.length;n<r;n++)t.set(e[n],n);return t}(e);for(t.forEach((function(e){if(!s.has(e[0])||!s.has(e[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")}));a--;)i[a]||u(e[a],a,new Set);return r;function u(e,t,a){if(a.has(e)){var c;try{c=", node was:"+JSON.stringify(e)}catch(e){c=""}throw new Error("Cyclic dependency"+c)}if(!s.has(e))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(e));if(!i[t]){i[t]=!0;var l=o.get(e)||new Set;if(t=(l=Array.from(l)).length){a.add(e);do{var d=l[--t];u(d,s.get(d),a)}while(t);a.delete(e)}r[--n]=e}}}function TT(e,t){let n=1/0;return e.some(((e,r)=>{var i;if(-1!==(null==(i=t.path)?void 0:i.indexOf(e)))return n=r,!0})),n}function MT(e){return(t,n)=>TT(e,t)-TT(e,n)}function OT(){return OT=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},OT.apply(this,arguments)}xT.exports=function(e){return wT(function(e){for(var t=new Set,n=0,r=e.length;n<r;n++){var i=e[n];t.add(i[0]),t.add(i[1])}return Array.from(t)}(e),e)},xT.exports.array=wT;let CT=e=>"[object Object]"===Object.prototype.toString.call(e);const NT=MT([]);class DT extends ow{constructor(e){super({type:"object"}),this.fields=Object.create(null),this._sortErrors=NT,this._nodes=[],this._excludedEdges=[],this.withMutation((()=>{this.transform((function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(t){e=null}return this.isType(e)?e:null})),e&&this.shape(e)}))}_typeCheck(e){return CT(e)||"function"==typeof e}_cast(e,t={}){var n;let r=super._cast(e,t);if(void 0===r)return this.getDefault();if(!this._typeCheck(r))return r;let i=this.fields,a=null!=(n=t.stripUnknown)?n:this.spec.noUnknown,o=this._nodes.concat(Object.keys(r).filter((e=>-1===this._nodes.indexOf(e)))),s={},u=OT({},t,{parent:s,__validating:t.__validating||!1}),c=!1;for(const e of o){let n=i[e],o=XS(r,e);if(n){let i,a=r[e];u.path=(t.path?`${t.path}.`:"")+e,n=n.resolve({value:a,context:t.context,parent:s});let o="spec"in n?n.spec:void 0,l=null==o?void 0:o.strict;if(null==o?void 0:o.strip){c=c||e in r;continue}i=t.__validating&&l?r[e]:n.cast(r[e],u),void 0!==i&&(s[e]=i)}else o&&!a&&(s[e]=r[e]);s[e]!==r[e]&&(c=!0)}return c?s:r}_validate(e,t={},n){let r=[],{sync:i,from:a=[],originalValue:o=e,abortEarly:s=this.spec.abortEarly,recursive:u=this.spec.recursive}=t;a=[{schema:this,value:o},...a],t.__validating=!0,t.originalValue=o,t.from=a,super._validate(e,t,((e,c)=>{if(e){if(!iA.isError(e)||s)return void n(e,c);r.push(e)}if(!u||!CT(c))return void n(r[0]||null,c);o=o||c;let l=this._nodes.map((e=>(n,r)=>{let i=-1===e.indexOf(".")?(t.path?`${t.path}.`:"")+e:`${t.path||""}["${e}"]`,s=this.fields[e];s&&"validate"in s?s.validate(c[e],OT({},t,{path:i,from:a,strict:!0,parent:c,originalValue:o[e]}),r):r(null)}));aA({sync:i,tests:l,value:c,errors:r,endEarly:s,sort:this._sortErrors,path:t.path},n)}))}clone(e){const t=super.clone(e);return t.fields=OT({},this.fields),t._nodes=this._nodes,t._excludedEdges=this._excludedEdges,t._sortErrors=this._sortErrors,t}concat(e){let t=super.concat(e),n=t.fields;for(let[e,t]of Object.entries(this.fields)){const r=n[e];void 0===r?n[e]=t:r instanceof ow&&t instanceof ow&&(n[e]=t.concat(r))}return t.withMutation((()=>t.shape(n,this._excludedEdges)))}getDefaultFromShape(){let e={};return this._nodes.forEach((t=>{const n=this.fields[t];e[t]="default"in n?n.getDefault():void 0})),e}_getDefault(){return"default"in this.spec?super._getDefault():this._nodes.length?this.getDefaultFromShape():void 0}shape(e,t=[]){let n=this.clone(),r=Object.assign(n.fields,e);return n.fields=r,n._sortErrors=MT(Object.keys(r)),t.length&&(Array.isArray(t[0])||(t=[t]),n._excludedEdges=[...n._excludedEdges,...t]),n._nodes=function(e,t=[]){let n=[],r=new Set,i=new Set(t.map((([e,t])=>`${e}-${t}`)));function a(e,t){let a=Yx.split(e)[0];r.add(a),i.has(`${t}-${a}`)||n.push([t,a])}for(const t in e)if(XS(e,t)){let n=e[t];r.add(t),ew.isRef(n)&&n.isSibling?a(n.path,t):QS(n)&&"deps"in n&&n.deps.forEach((e=>a(e,t)))}return xT.exports.array(Array.from(r),n).reverse()}(r,n._excludedEdges),n}pick(e){const t={};for(const n of e)this.fields[n]&&(t[n]=this.fields[n]);return this.clone().withMutation((e=>(e.fields={},e.shape(t))))}omit(e){const t=this.clone(),n=t.fields;t.fields={};for(const t of e)delete n[t];return t.withMutation((()=>t.shape(n)))}from(e,t,n){let r=Yx.getter(e,!0);return this.transform((i=>{if(null==i)return i;let a=i;return XS(i,e)&&(a=OT({},i),n||delete a[e],a[t]=r(i)),a}))}noUnknown(e=!0,t=vS.noUnknown){"string"==typeof e&&(t=e,e=!0);let n=this.test({name:"noUnknown",exclusive:!0,message:t,test(t){if(null==t)return!0;const n=function(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter((e=>-1===n.indexOf(e)))}(this.schema,t);return!e||0===n.length||this.createError({params:{unknown:n.join(", ")}})}});return n.spec.noUnknown=e,n}unknown(e=!0,t=vS.noUnknown){return this.noUnknown(!e,t)}transformKeys(e){return this.transform((t=>t&&AT(t,((t,n)=>e(n)))))}camelCase(){return this.transformKeys(vT)}snakeCase(){return this.transformKeys(gT)}constantCase(){return this.transformKeys((e=>gT(e).toUpperCase()))}describe(){let e=super.describe();return e.fields=Fx(this.fields,(e=>e.describe())),e}}function LT(e){return new DT(e)}function IT(){return IT=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},IT.apply(this,arguments)}function kT(e){return new $T(e)}LT.prototype=DT.prototype;class $T extends ow{constructor(e){super({type:"array"}),this.innerType=void 0,this.innerType=e,this.withMutation((()=>{this.transform((function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(t){e=null}return this.isType(e)?e:null}))}))}_typeCheck(e){return Array.isArray(e)}get _subType(){return this.innerType}_cast(e,t){const n=super._cast(e,t);if(!this._typeCheck(n)||!this.innerType)return n;let r=!1;const i=n.map(((e,n)=>{const i=this.innerType.cast(e,IT({},t,{path:`${t.path||""}[${n}]`}));return i!==e&&(r=!0),i}));return r?i:n}_validate(e,t={},n){var r,i;let a=[],o=t.sync,s=t.path,u=this.innerType,c=null!=(r=t.abortEarly)?r:this.spec.abortEarly,l=null!=(i=t.recursive)?i:this.spec.recursive,d=null!=t.originalValue?t.originalValue:e;super._validate(e,t,((e,r)=>{if(e){if(!iA.isError(e)||c)return void n(e,r);a.push(e)}if(!l||!u||!this._typeCheck(r))return void n(a[0]||null,r);d=d||r;let i=new Array(r.length);for(let e=0;e<r.length;e++){let n=r[e],a=`${t.path||""}[${e}]`,o=IT({},t,{path:a,strict:!0,parent:r,index:e,originalValue:d[e]});i[e]=(e,t)=>u.validate(n,o,t)}aA({sync:o,path:s,value:r,errors:a,endEarly:c,tests:i},n)}))}clone(e){const t=super.clone(e);return t.innerType=this.innerType,t}concat(e){let t=super.concat(e);return t.innerType=this.innerType,e.innerType&&(t.innerType=t.innerType?t.innerType.concat(e.innerType):e.innerType),t}of(e){let t=this.clone();if(!QS(e))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+pS(e));return t.innerType=e,t}length(e,t=bS.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},test(t){return cw(t)||t.length===this.resolve(e)}})}min(e,t){return t=t||bS.min,this.test({message:t,name:"min",exclusive:!0,params:{min:e},test(t){return cw(t)||t.length>=this.resolve(e)}})}max(e,t){return t=t||bS.max,this.test({message:t,name:"max",exclusive:!0,params:{max:e},test(t){return cw(t)||t.length<=this.resolve(e)}})}ensure(){return this.default((()=>[])).transform(((e,t)=>this._typeCheck(e)?e:null==t?[]:[].concat(t)))}compact(e){let t=e?(t,n,r)=>!e(t,n,r):e=>!!e;return this.transform((e=>null!=e?e.filter(t):e))}describe(){let e=super.describe();return this.innerType&&(e.innerType=this.innerType.describe()),e}nullable(e=!0){return super.nullable(e)}defined(){return super.defined()}required(e){return super.required(e)}}kT.prototype=$T.prototype;class RT{constructor(e){this.type="lazy",this.__isYupSchema__=!0,this.__inputType=void 0,this.__outputType=void 0,this._resolve=(e,t={})=>{let n=this.builder(e,t);if(!QS(n))throw new TypeError("lazy() functions must return a valid schema");return n.resolve(t)},this.builder=e}resolve(e){return this._resolve(e.value,e)}cast(e,t){return this._resolve(e,t).cast(e,t)}validate(e,t,n){return this._resolve(e,t).validate(e,t,n)}validateSync(e,t){return this._resolve(e,t).validateSync(e,t)}validateAt(e,t,n){return this._resolve(t,n).validateAt(e,t,n)}validateSyncAt(e,t,n){return this._resolve(t,n).validateSyncAt(e,t,n)}describe(){return null}isValid(e,t){return this._resolve(e,t).isValid(e,t)}isValidSync(e,t){return this._resolve(e,t).isValidSync(e,t)}}function FT(e,t,n){if(!e||!QS(e.prototype))throw new TypeError("You must provide a yup schema constructor function");if("string"!=typeof t)throw new TypeError("A Method name must be provided");if("function"!=typeof n)throw new TypeError("Method function must be provided");e.prototype[t]=n}var zT=Object.freeze({__proto__:null,mixed:uw,bool:lw,boolean:lw,string:yw,number:vw,date:Aw,object:LT,array:kT,ref:function(e,t){return new ew(e,t)},lazy:function(e){return new RT(e)},reach:(e,t,n,r)=>rw(e,t,n,r).schema,isSchema:QS,addMethod:FT,setLocale:function(e){Object.keys(e).forEach((t=>{Object.keys(e[t]).forEach((n=>{ES[t][n]=e[t][n]}))}))},ValidationError:iA,BaseSchema:ow,MixedSchema:sw,BooleanSchema:dw,StringSchema:_w,NumberSchema:bw,DateSchema:xw,ObjectSchema:DT,ArraySchema:$T});const PT=V.default.button`
|
|
179
|
+
Rf((function(e){Object.getOwnPropertyNames(Pp.prototype).forEach((function(t){"constructor"!==t&&(e.DateTimeFormatterBuilder.prototype[t]=Pp.prototype[t])})),Object.getOwnPropertyNames(Up.prototype).forEach((function(t){"constructor"!==t&&(e.DateTimeFormatter.prototype[t]=Up.prototype[t])})),e.DateTimeFormatter.RFC_1123_DATE_TIME=Up.RFC_1123_DATE_TIME}));var Vp=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i},Hp=sn,Gp=Rr;var Yp=function(e){return"symbol"==typeof e||Gp(e)&&"[object Symbol]"==Hp(e)},Wp=Vp,qp=Hr,Kp=Yp,Jp=qt?qt.prototype:void 0,Xp=Jp?Jp.toString:void 0;var Qp=function e(t){if("string"==typeof t)return t;if(qp(t))return Wp(t,e)+"";if(Kp(t))return Xp?Xp.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n},eh=Qp;var th=function(e){return null==e?"":eh(e)};var nh=function(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r<i;)a[r]=e[r+t];return a},rh=nh;var ih=function(e,t,n){var r=e.length;return n=void 0===n?r:n,!t&&n>=r?e:rh(e,t,n)},ah=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");var oh=function(e){return ah.test(e)};var sh=function(e){return e.split("")},uh="\\ud800-\\udfff",ch="["+uh+"]",lh="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",dh="\\ud83c[\\udffb-\\udfff]",fh="[^"+uh+"]",ph="(?:\\ud83c[\\udde6-\\uddff]){2}",hh="[\\ud800-\\udbff][\\udc00-\\udfff]",mh="(?:"+lh+"|"+dh+")"+"?",gh="[\\ufe0e\\ufe0f]?",yh=gh+mh+("(?:\\u200d(?:"+[fh,ph,hh].join("|")+")"+gh+mh+")*"),_h="(?:"+[fh+lh+"?",lh,ph,hh,ch].join("|")+")",vh=RegExp(dh+"(?="+dh+")|"+_h+yh,"g");var bh=function(e){return e.match(vh)||[]},Eh=sh,Sh=oh,Ah=bh;var xh=function(e){return Sh(e)?Ah(e):Eh(e)},wh=ih,Th=oh,Mh=xh,Oh=th;var Ch=function(e){return function(t){t=Oh(t);var n=Th(t)?Mh(t):void 0,r=n?n[0]:t.charAt(0),i=n?wh(n,1).join(""):t.slice(1);return r[e]()+i}},Nh=Ch("toUpperCase"),Dh=th,Lh=Nh;var Ih=function(e){return Lh(Dh(e).toLowerCase())};function kh(e){return new DataView(e.buffer,e.byteOffset)}const $h={len:1,get:(e,t)=>kh(e).getUint8(t),put:(e,t,n)=>(kh(e).setUint8(t,n),t+1)},Rh={len:2,get:(e,t)=>kh(e).getUint16(t,!0),put:(e,t,n)=>(kh(e).setUint16(t,n,!0),t+2)},Fh={len:2,get:(e,t)=>kh(e).getUint16(t),put:(e,t,n)=>(kh(e).setUint16(t,n),t+2)},zh={len:4,get:(e,t)=>kh(e).getUint32(t,!0),put:(e,t,n)=>(kh(e).setUint32(t,n,!0),t+4)},Ph={len:4,get:(e,t)=>kh(e).getUint32(t),put:(e,t,n)=>(kh(e).setUint32(t,n),t+4)},jh={len:4,get:(e,t)=>kh(e).getInt32(t),put:(e,t,n)=>(kh(e).setInt32(t,n),t+4)},Zh={len:8,get:(e,t)=>kh(e).getBigUint64(t,!0),put:(e,t,n)=>(kh(e).setBigUint64(t,n,!0),t+8)};class Uh{constructor(e,t){this.len=e,this.encoding=t,this.textDecoder=new TextDecoder(t)}get(e,t){return this.textDecoder.decode(e.subarray(t,t+this.len))}}class Bh extends Error{constructor(){super("End-Of-Stream")}}class Vh{constructor(){this.maxStreamReadSize=1048576,this.endOfStream=!1,this.peekQueue=[]}async peek(e,t,n){const r=await this.read(e,t,n);return this.peekQueue.push(e.subarray(t,t+r)),r}async read(e,t,n){if(0===n)return 0;let r=this.readFromPeekBuffer(e,t,n);if(r+=await this.readRemainderFromStream(e,t+r,n-r),0===r)throw new Bh;return r}readFromPeekBuffer(e,t,n){let r=n,i=0;for(;this.peekQueue.length>0&&r>0;){const n=this.peekQueue.pop();if(!n)throw new Error("peekData should be defined");const a=Math.min(n.length,r);e.set(n.subarray(0,a),t+i),i+=a,r-=a,a<n.length&&this.peekQueue.push(n.subarray(a))}return i}async readRemainderFromStream(e,t,n){let r=n,i=0;for(;r>0&&!this.endOfStream;){const n=Math.min(r,this.maxStreamReadSize),a=await this.readFromStream(e,t+i,n);if(0===a)break;i+=a,r-=a}return i}}class Hh extends Vh{constructor(e){super(),this.reader=e.getReader({mode:"byob"})}async readFromStream(e,t,n){if(this.endOfStream)throw new Bh;const r=await this.reader.read(new Uint8Array(n));return r.done&&(this.endOfStream=r.done),r.value?(e.set(r.value,t),r.value.byteLength):0}abort(){return this.reader.cancel()}async close(){await this.abort(),this.reader.releaseLock()}}class Gh{constructor(e){this.numBuffer=new Uint8Array(8),this.position=0,this.onClose=e?.onClose,e?.abortSignal&&e.abortSignal.addEventListener("abort",(()=>{this.abort()}))}async readToken(e,t=this.position){const n=new Uint8Array(e.len);if(await this.readBuffer(n,{position:t})<e.len)throw new Bh;return e.get(n,0)}async peekToken(e,t=this.position){const n=new Uint8Array(e.len);if(await this.peekBuffer(n,{position:t})<e.len)throw new Bh;return e.get(n,0)}async readNumber(e){if(await this.readBuffer(this.numBuffer,{length:e.len})<e.len)throw new Bh;return e.get(this.numBuffer,0)}async peekNumber(e){if(await this.peekBuffer(this.numBuffer,{length:e.len})<e.len)throw new Bh;return e.get(this.numBuffer,0)}async ignore(e){if(void 0!==this.fileInfo.size){const t=this.fileInfo.size-this.position;if(e>t)return this.position+=t,t}return this.position+=e,e}async close(){await this.abort(),await(this.onClose?.())}normalizeOptions(e,t){if(t&&void 0!==t.position&&t.position<this.position)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");return t?{mayBeLess:!0===t.mayBeLess,offset:t.offset?t.offset:0,length:t.length?t.length:e.length-(t.offset?t.offset:0),position:t.position?t.position:this.position}:{mayBeLess:!1,offset:0,length:e.length,position:this.position}}abort(){return Promise.resolve()}}class Yh extends Gh{constructor(e,t){super(t),this.streamReader=e,this.fileInfo=t?.fileInfo??{}}async readBuffer(e,t){const n=this.normalizeOptions(e,t),r=n.position-this.position;if(r>0)return await this.ignore(r),this.readBuffer(e,t);if(r<0)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");if(0===n.length)return 0;const i=await this.streamReader.read(e,n.offset,n.length);if(this.position+=i,(!t||!t.mayBeLess)&&i<n.length)throw new Bh;return i}async peekBuffer(e,t){const n=this.normalizeOptions(e,t);let r=0;if(n.position){const t=n.position-this.position;if(t>0){const i=new Uint8Array(n.length+t);return r=await this.peekBuffer(i,{mayBeLess:n.mayBeLess}),e.set(i.subarray(t),n.offset),r-t}if(t<0)throw new Error("Cannot peek from a negative offset in a stream")}if(n.length>0){try{r=await this.streamReader.peek(e,n.offset,n.length)}catch(e){if(t?.mayBeLess&&e instanceof Bh)return 0;throw e}if(!n.mayBeLess&&r<n.length)throw new Bh}return r}async ignore(e){const t=Math.min(256e3,e),n=new Uint8Array(t);let r=0;for(;r<e;){const i=e-r,a=await this.readBuffer(n,{length:Math.min(t,i)});if(a<0)return a;r+=a}return r}abort(){return this.streamReader.abort()}supportsRandomAccess(){return!1}}class Wh extends Gh{constructor(e,t){super(t),this.uint8Array=e,this.fileInfo={...t?.fileInfo??{},size:e.length}}async readBuffer(e,t){if(t?.position){if(t.position<this.position)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");this.position=t.position}const n=await this.peekBuffer(e,t);return this.position+=n,n}async peekBuffer(e,t){const n=this.normalizeOptions(e,t),r=Math.min(this.uint8Array.length-n.position,n.length);if(!n.mayBeLess&&r<n.length)throw new Bh;return e.set(this.uint8Array.subarray(n.position,n.position+r),n.offset),r}close(){return super.close()}supportsRandomAccess(){return!0}setPosition(e){this.position=e}}function qh(e){const{byteLength:t}=e;return 6===t?e.getUint16(0)*2**32+e.getUint32(2):5===t?e.getUint8(0)*2**32+e.getUint32(1):4===t?e.getUint32(0):3===t?65536*e.getUint8(0)+e.getUint16(1):2===t?e.getUint16(0):1===t?e.getUint8(0):void 0}function Kh(e,t){const n=e.length,r=t.length;if(0===r)return-1;if(r>n)return-1;const i=n-r;for(let n=0;n<=i;n++){let i=!0;for(let a=0;a<r;a++)if(e[n+a]!==t[a]){i=!1;break}if(i)return n}return-1}new globalThis.TextDecoder("utf8"),new globalThis.TextEncoder,Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));const Jh={get:(e,t)=>127&e[t+3]|e[t+2]<<7|e[t+1]<<14|e[t]<<21,len:4},Xh=4100;function Qh(e,t,n){n={offset:0,...n};for(const[r,i]of t.entries())if(n.mask){if(i!==(n.mask[r]&e[r+n.offset]))return!1}else if(i!==e[r+n.offset])return!1;return!0}class em{constructor(e){this.detectors=e?.customDetectors,this.tokenizerOptions={abortSignal:e?.signal},this.fromTokenizer=this.fromTokenizer.bind(this),this.fromBuffer=this.fromBuffer.bind(this),this.parse=this.parse.bind(this)}async fromTokenizer(e){const t=e.position;for(const n of this.detectors||[]){const r=await n(e);if(r)return r;if(t!==e.position)return}return this.parse(e)}async fromBuffer(e){if(!(e instanceof Uint8Array||e instanceof ArrayBuffer))throw new TypeError(`Expected the \`input\` argument to be of type \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof e}\``);const t=e instanceof Uint8Array?e:new Uint8Array(e);var n,r;if(t?.length>1)return this.fromTokenizer((n=t,r=this.tokenizerOptions,new Wh(n,r)))}async fromBlob(e){return this.fromStream(e.stream())}async fromStream(e){const t=await(n=e,r=this.tokenizerOptions,new Yh(new Hh(n),r));var n,r;try{return await this.fromTokenizer(t)}finally{await t.close()}}async toDetectionStream(e,t){const{sampleSize:n=Xh}=t;let r,i;const a=e.getReader({mode:"byob"});try{const{value:e,done:t}=await a.read(new Uint8Array(n));if(i=e,!t&&e)try{r=await this.fromBuffer(e.slice(0,n))}catch(e){if(!(e instanceof Bh))throw e;r=void 0}i=e}finally{a.releaseLock()}const o=new TransformStream({async start(e){e.enqueue(i)},transform(e,t){t.enqueue(e)}}),s=e.pipeThrough(o);return s.fileType=r,s}check(e,t){return Qh(this.buffer,e,t)}checkString(e,t){return this.check(function(e){return[...e].map((e=>e.charCodeAt(0)))}(e),t)}async parse(e){if(this.buffer=new Uint8Array(Xh),void 0===e.fileInfo.size&&(e.fileInfo.size=Number.MAX_SAFE_INTEGER),this.tokenizer=e,await e.peekBuffer(this.buffer,{length:12,mayBeLess:!0}),this.check([66,77]))return{ext:"bmp",mime:"image/bmp"};if(this.check([11,119]))return{ext:"ac3",mime:"audio/vnd.dolby.dd-raw"};if(this.check([120,1]))return{ext:"dmg",mime:"application/x-apple-diskimage"};if(this.check([77,90]))return{ext:"exe",mime:"application/x-msdownload"};if(this.check([37,33]))return await e.peekBuffer(this.buffer,{length:24,mayBeLess:!0}),this.checkString("PS-Adobe-",{offset:2})&&this.checkString(" EPSF-",{offset:14})?{ext:"eps",mime:"application/eps"}:{ext:"ps",mime:"application/postscript"};if(this.check([31,160])||this.check([31,157]))return{ext:"Z",mime:"application/x-compress"};if(this.check([199,113]))return{ext:"cpio",mime:"application/x-cpio"};if(this.check([96,234]))return{ext:"arj",mime:"application/x-arj"};if(this.check([239,187,191]))return this.tokenizer.ignore(3),this.parse(e);if(this.check([71,73,70]))return{ext:"gif",mime:"image/gif"};if(this.check([73,73,188]))return{ext:"jxr",mime:"image/vnd.ms-photo"};if(this.check([31,139,8]))return{ext:"gz",mime:"application/gzip"};if(this.check([66,90,104]))return{ext:"bz2",mime:"application/x-bzip2"};if(this.checkString("ID3")){await e.ignore(6);const t=await e.readToken(Jh);return e.position+t>e.fileInfo.size?{ext:"mp3",mime:"audio/mpeg"}:(await e.ignore(t),this.fromTokenizer(e))}if(this.checkString("MP+"))return{ext:"mpc",mime:"audio/x-musepack"};if((67===this.buffer[0]||70===this.buffer[0])&&this.check([87,83],{offset:1}))return{ext:"swf",mime:"application/x-shockwave-flash"};if(this.check([255,216,255]))return this.check([247],{offset:3})?{ext:"jls",mime:"image/jls"}:{ext:"jpg",mime:"image/jpeg"};if(this.check([79,98,106,1]))return{ext:"avro",mime:"application/avro"};if(this.checkString("FLIF"))return{ext:"flif",mime:"image/flif"};if(this.checkString("8BPS"))return{ext:"psd",mime:"image/vnd.adobe.photoshop"};if(this.checkString("WEBP",{offset:8}))return{ext:"webp",mime:"image/webp"};if(this.checkString("MPCK"))return{ext:"mpc",mime:"audio/x-musepack"};if(this.checkString("FORM"))return{ext:"aif",mime:"audio/aiff"};if(this.checkString("icns",{offset:0}))return{ext:"icns",mime:"image/icns"};if(this.check([80,75,3,4])){try{for(;e.position+30<e.fileInfo.size;){await e.readBuffer(this.buffer,{length:30});const n=new DataView(this.buffer.buffer),r={compressedSize:n.getUint32(18,!0),uncompressedSize:n.getUint32(22,!0),filenameLength:n.getUint16(26,!0),extraFieldLength:n.getUint16(28,!0)};if(r.filename=await e.readToken(new Uh(r.filenameLength,"utf-8")),await e.ignore(r.extraFieldLength),/classes\d*\.dex/.test(r.filename))return{ext:"apk",mime:"application/vnd.android.package-archive"};if("META-INF/mozilla.rsa"===r.filename)return{ext:"xpi",mime:"application/x-xpinstall"};if(r.filename.endsWith(".rels")||r.filename.endsWith(".xml")){switch(r.filename.split("/")[0]){case"_rels":default:break;case"word":return{ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"};case"ppt":return{ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"};case"xl":return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};case"visio":return{ext:"vsdx",mime:"application/vnd.visio"}}}if(r.filename.startsWith("xl/"))return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};if(r.filename.startsWith("3D/")&&r.filename.endsWith(".model"))return{ext:"3mf",mime:"model/3mf"};if("mimetype"===r.filename&&r.compressedSize===r.uncompressedSize){let i=await e.readToken(new Uh(r.compressedSize,"utf-8"));switch(i=i.trim(),i){case"application/epub+zip":return{ext:"epub",mime:"application/epub+zip"};case"application/vnd.oasis.opendocument.text":return{ext:"odt",mime:"application/vnd.oasis.opendocument.text"};case"application/vnd.oasis.opendocument.spreadsheet":return{ext:"ods",mime:"application/vnd.oasis.opendocument.spreadsheet"};case"application/vnd.oasis.opendocument.presentation":return{ext:"odp",mime:"application/vnd.oasis.opendocument.presentation"}}}if(0===r.compressedSize){let a=-1;for(;a<0&&e.position<e.fileInfo.size;)await e.peekBuffer(this.buffer,{mayBeLess:!0}),a=Kh(this.buffer,new Uint8Array([80,75,3,4])),await e.ignore(a>=0?a:this.buffer.length)}else await e.ignore(r.compressedSize)}}catch(o){if(!(o instanceof Bh))throw o}return{ext:"zip",mime:"application/zip"}}if(this.checkString("OggS")){await e.ignore(28);const s=new Uint8Array(8);return await e.readBuffer(s),Qh(s,[79,112,117,115,72,101,97,100])?{ext:"opus",mime:"audio/ogg; codecs=opus"}:Qh(s,[128,116,104,101,111,114,97])?{ext:"ogv",mime:"video/ogg"}:Qh(s,[1,118,105,100,101,111,0])?{ext:"ogm",mime:"video/ogg"}:Qh(s,[127,70,76,65,67])?{ext:"oga",mime:"audio/ogg"}:Qh(s,[83,112,101,101,120,32,32])?{ext:"spx",mime:"audio/ogg"}:Qh(s,[1,118,111,114,98,105,115])?{ext:"ogg",mime:"audio/ogg"}:{ext:"ogx",mime:"application/ogg"}}if(this.check([80,75])&&(3===this.buffer[2]||5===this.buffer[2]||7===this.buffer[2])&&(4===this.buffer[3]||6===this.buffer[3]||8===this.buffer[3]))return{ext:"zip",mime:"application/zip"};if(this.checkString("ftyp",{offset:4})&&96&this.buffer[8]){const u=new Uh(4,"latin1").get(this.buffer,8).replace("\0"," ").trim();switch(u){case"avif":case"avis":return{ext:"avif",mime:"image/avif"};case"mif1":return{ext:"heic",mime:"image/heif"};case"msf1":return{ext:"heic",mime:"image/heif-sequence"};case"heic":case"heix":return{ext:"heic",mime:"image/heic"};case"hevc":case"hevx":return{ext:"heic",mime:"image/heic-sequence"};case"qt":return{ext:"mov",mime:"video/quicktime"};case"M4V":case"M4VH":case"M4VP":return{ext:"m4v",mime:"video/x-m4v"};case"M4P":return{ext:"m4p",mime:"video/mp4"};case"M4B":return{ext:"m4b",mime:"audio/mp4"};case"M4A":return{ext:"m4a",mime:"audio/x-m4a"};case"F4V":return{ext:"f4v",mime:"video/mp4"};case"F4P":return{ext:"f4p",mime:"video/mp4"};case"F4A":return{ext:"f4a",mime:"audio/mp4"};case"F4B":return{ext:"f4b",mime:"audio/mp4"};case"crx":return{ext:"cr3",mime:"image/x-canon-cr3"};default:return u.startsWith("3g")?u.startsWith("3g2")?{ext:"3g2",mime:"video/3gpp2"}:{ext:"3gp",mime:"video/3gpp"}:{ext:"mp4",mime:"video/mp4"}}}if(this.checkString("MThd"))return{ext:"mid",mime:"audio/midi"};if(this.checkString("wOFF")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return{ext:"woff",mime:"font/woff"};if(this.checkString("wOF2")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return{ext:"woff2",mime:"font/woff2"};if(this.check([212,195,178,161])||this.check([161,178,195,212]))return{ext:"pcap",mime:"application/vnd.tcpdump.pcap"};if(this.checkString("DSD "))return{ext:"dsf",mime:"audio/x-dsf"};if(this.checkString("LZIP"))return{ext:"lz",mime:"application/x-lzip"};if(this.checkString("fLaC"))return{ext:"flac",mime:"audio/x-flac"};if(this.check([66,80,71,251]))return{ext:"bpg",mime:"image/bpg"};if(this.checkString("wvpk"))return{ext:"wv",mime:"audio/wavpack"};if(this.checkString("%PDF")){try{await e.ignore(1350);const c=10485760,l=new Uint8Array(Math.min(c,e.fileInfo.size));if(await e.readBuffer(l,{mayBeLess:!0}),function(e,t){return-1!==Kh(e,t)}(l,(new TextEncoder).encode("AIPrivateData")))return{ext:"ai",mime:"application/postscript"}}catch(d){if(!(d instanceof Bh))throw d}return{ext:"pdf",mime:"application/pdf"}}if(this.check([0,97,115,109]))return{ext:"wasm",mime:"application/wasm"};if(this.check([73,73])){const f=await this.readTiffHeader(!1);if(f)return f}if(this.check([77,77])){const p=await this.readTiffHeader(!0);if(p)return p}if(this.checkString("MAC "))return{ext:"ape",mime:"audio/ape"};if(this.check([26,69,223,163])){async function h(){const t=await e.peekNumber($h);let n=128,r=0;for(;!(t&n)&&0!==n;)++r,n>>=1;const i=new Uint8Array(r+1);return await e.readBuffer(i),i}async function m(){const e=await h(),t=await h();t[0]^=128>>t.length-1;const n=Math.min(6,t.length),r=new DataView(e.buffer),i=new DataView(t.buffer,t.length-n,n);return{id:qh(r),len:qh(i)}}async function g(t){for(;t>0;){const n=await m();if(17026===n.id){return(await e.readToken(new Uh(n.len))).replaceAll(/\00.*$/g,"")}await e.ignore(n.len),--t}}const y=await m();switch(await g(y.len)){case"webm":return{ext:"webm",mime:"video/webm"};case"matroska":return{ext:"mkv",mime:"video/x-matroska"};default:return}}if(this.check([82,73,70,70])){if(this.check([65,86,73],{offset:8}))return{ext:"avi",mime:"video/vnd.avi"};if(this.check([87,65,86,69],{offset:8}))return{ext:"wav",mime:"audio/wav"};if(this.check([81,76,67,77],{offset:8}))return{ext:"qcp",mime:"audio/qcelp"}}if(this.checkString("SQLi"))return{ext:"sqlite",mime:"application/x-sqlite3"};if(this.check([78,69,83,26]))return{ext:"nes",mime:"application/x-nintendo-nes-rom"};if(this.checkString("Cr24"))return{ext:"crx",mime:"application/x-google-chrome-extension"};if(this.checkString("MSCF")||this.checkString("ISc("))return{ext:"cab",mime:"application/vnd.ms-cab-compressed"};if(this.check([237,171,238,219]))return{ext:"rpm",mime:"application/x-rpm"};if(this.check([197,208,211,198]))return{ext:"eps",mime:"application/eps"};if(this.check([40,181,47,253]))return{ext:"zst",mime:"application/zstd"};if(this.check([127,69,76,70]))return{ext:"elf",mime:"application/x-elf"};if(this.check([33,66,68,78]))return{ext:"pst",mime:"application/vnd.ms-outlook"};if(this.checkString("PAR1"))return{ext:"parquet",mime:"application/x-parquet"};if(this.check([207,250,237,254]))return{ext:"macho",mime:"application/x-mach-binary"};if(this.check([79,84,84,79,0]))return{ext:"otf",mime:"font/otf"};if(this.checkString("#!AMR"))return{ext:"amr",mime:"audio/amr"};if(this.checkString("{\\rtf"))return{ext:"rtf",mime:"application/rtf"};if(this.check([70,76,86,1]))return{ext:"flv",mime:"video/x-flv"};if(this.checkString("IMPM"))return{ext:"it",mime:"audio/x-it"};if(this.checkString("-lh0-",{offset:2})||this.checkString("-lh1-",{offset:2})||this.checkString("-lh2-",{offset:2})||this.checkString("-lh3-",{offset:2})||this.checkString("-lh4-",{offset:2})||this.checkString("-lh5-",{offset:2})||this.checkString("-lh6-",{offset:2})||this.checkString("-lh7-",{offset:2})||this.checkString("-lzs-",{offset:2})||this.checkString("-lz4-",{offset:2})||this.checkString("-lz5-",{offset:2})||this.checkString("-lhd-",{offset:2}))return{ext:"lzh",mime:"application/x-lzh-compressed"};if(this.check([0,0,1,186])){if(this.check([33],{offset:4,mask:[241]}))return{ext:"mpg",mime:"video/MP1S"};if(this.check([68],{offset:4,mask:[196]}))return{ext:"mpg",mime:"video/MP2P"}}if(this.checkString("ITSF"))return{ext:"chm",mime:"application/vnd.ms-htmlhelp"};if(this.check([202,254,186,190]))return{ext:"class",mime:"application/java-vm"};if(this.check([253,55,122,88,90,0]))return{ext:"xz",mime:"application/x-xz"};if(this.checkString("<?xml "))return{ext:"xml",mime:"application/xml"};if(this.check([55,122,188,175,39,28]))return{ext:"7z",mime:"application/x-7z-compressed"};if(this.check([82,97,114,33,26,7])&&(0===this.buffer[6]||1===this.buffer[6]))return{ext:"rar",mime:"application/x-rar-compressed"};if(this.checkString("solid "))return{ext:"stl",mime:"model/stl"};if(this.checkString("AC")){const _=new Uh(4,"latin1").get(this.buffer,2);if(_.match("^d*")&&_>=1e3&&_<=1050)return{ext:"dwg",mime:"image/vnd.dwg"}}if(this.checkString("070707"))return{ext:"cpio",mime:"application/x-cpio"};if(this.checkString("BLENDER"))return{ext:"blend",mime:"application/x-blender"};if(this.checkString("!<arch>")){await e.ignore(8);return"debian-binary"===await e.readToken(new Uh(13,"ascii"))?{ext:"deb",mime:"application/x-deb"}:{ext:"ar",mime:"application/x-unix-archive"}}if(this.checkString("WEBVTT")&&["\n","\r","\t"," ","\0"].some((e=>this.checkString(e,{offset:6}))))return{ext:"vtt",mime:"text/vtt"};if(this.check([137,80,78,71,13,10,26,10])){async function v(){return{length:await e.readToken(jh),type:await e.readToken(new Uh(4,"latin1"))}}await e.ignore(8);do{const b=await v();if(b.length<0)return;switch(b.type){case"IDAT":return{ext:"png",mime:"image/png"};case"acTL":return{ext:"apng",mime:"image/apng"};default:await e.ignore(b.length+4)}}while(e.position+8<e.fileInfo.size);return{ext:"png",mime:"image/png"}}if(this.check([65,82,82,79,87,49,0,0]))return{ext:"arrow",mime:"application/x-apache-arrow"};if(this.check([103,108,84,70,2,0,0,0]))return{ext:"glb",mime:"model/gltf-binary"};if(this.check([102,114,101,101],{offset:4})||this.check([109,100,97,116],{offset:4})||this.check([109,111,111,118],{offset:4})||this.check([119,105,100,101],{offset:4}))return{ext:"mov",mime:"video/quicktime"};if(this.check([73,73,82,79,8,0,0,0,24]))return{ext:"orf",mime:"image/x-olympus-orf"};if(this.checkString("gimp xcf "))return{ext:"xcf",mime:"image/x-xcf"};if(this.check([73,73,85,0,24,0,0,0,136,231,116,216]))return{ext:"rw2",mime:"image/x-panasonic-rw2"};if(this.check([48,38,178,117,142,102,207,17,166,217])){async function E(){const t=new Uint8Array(16);return await e.readBuffer(t),{id:t,size:Number(await e.readToken(Zh))}}for(await e.ignore(30);e.position+24<e.fileInfo.size;){const S=await E();let A=S.size-24;if(Qh(S.id,[145,7,220,183,183,169,207,17,142,230,0,192,12,32,83,101])){const x=new Uint8Array(16);if(A-=await e.readBuffer(x),Qh(x,[64,158,105,248,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"audio/x-ms-asf"};if(Qh(x,[192,239,25,188,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"video/x-ms-asf"};break}await e.ignore(A)}return{ext:"asf",mime:"application/vnd.ms-asf"}}if(this.check([171,75,84,88,32,49,49,187,13,10,26,10]))return{ext:"ktx",mime:"image/ktx"};if((this.check([126,16,4])||this.check([126,24,4]))&&this.check([48,77,73,69],{offset:4}))return{ext:"mie",mime:"application/x-mie"};if(this.check([39,10,0,0,0,0,0,0,0,0,0,0],{offset:2}))return{ext:"shp",mime:"application/x-esri-shape"};if(this.check([255,79,255,81]))return{ext:"j2c",mime:"image/j2c"};if(this.check([0,0,0,12,106,80,32,32,13,10,135,10])){await e.ignore(20);switch(await e.readToken(new Uh(4,"ascii"))){case"jp2 ":return{ext:"jp2",mime:"image/jp2"};case"jpx ":return{ext:"jpx",mime:"image/jpx"};case"jpm ":return{ext:"jpm",mime:"image/jpm"};case"mjp2":return{ext:"mj2",mime:"image/mj2"};default:return}}if(this.check([255,10])||this.check([0,0,0,12,74,88,76,32,13,10,135,10]))return{ext:"jxl",mime:"image/jxl"};if(this.check([254,255]))return this.check([0,60,0,63,0,120,0,109,0,108],{offset:2})?{ext:"xml",mime:"application/xml"}:void 0;if(this.check([0,0,1,186])||this.check([0,0,1,179]))return{ext:"mpg",mime:"video/mpeg"};if(this.check([0,1,0,0,0]))return{ext:"ttf",mime:"font/ttf"};if(this.check([0,0,1,0]))return{ext:"ico",mime:"image/x-icon"};if(this.check([0,0,2,0]))return{ext:"cur",mime:"image/x-icon"};if(this.check([208,207,17,224,161,177,26,225]))return{ext:"cfb",mime:"application/x-cfb"};if(await e.peekBuffer(this.buffer,{length:Math.min(256,e.fileInfo.size),mayBeLess:!0}),this.check([97,99,115,112],{offset:36}))return{ext:"icc",mime:"application/vnd.iccprofile"};if(this.checkString("**ACE",{offset:7})&&this.checkString("**",{offset:12}))return{ext:"ace",mime:"application/x-ace-compressed"};if(this.checkString("BEGIN:")){if(this.checkString("VCARD",{offset:6}))return{ext:"vcf",mime:"text/vcard"};if(this.checkString("VCALENDAR",{offset:6}))return{ext:"ics",mime:"text/calendar"}}if(this.checkString("FUJIFILMCCD-RAW"))return{ext:"raf",mime:"image/x-fujifilm-raf"};if(this.checkString("Extended Module:"))return{ext:"xm",mime:"audio/x-xm"};if(this.checkString("Creative Voice File"))return{ext:"voc",mime:"audio/x-voc"};if(this.check([4,0,0,0])&&this.buffer.length>=16){const w=new DataView(this.buffer.buffer).getUint32(12,!0);if(w>12&&this.buffer.length>=w+16)try{const T=(new TextDecoder).decode(this.buffer.slice(16,w+16));if(JSON.parse(T).files)return{ext:"asar",mime:"application/x-asar"}}catch{}}if(this.check([6,14,43,52,2,5,1,1,13,1,2,1,1,2]))return{ext:"mxf",mime:"application/mxf"};if(this.checkString("SCRM",{offset:44}))return{ext:"s3m",mime:"audio/x-s3m"};if(this.check([71])&&this.check([71],{offset:188}))return{ext:"mts",mime:"video/mp2t"};if(this.check([71],{offset:4})&&this.check([71],{offset:196}))return{ext:"mts",mime:"video/mp2t"};if(this.check([66,79,79,75,77,79,66,73],{offset:60}))return{ext:"mobi",mime:"application/x-mobipocket-ebook"};if(this.check([68,73,67,77],{offset:128}))return{ext:"dcm",mime:"application/dicom"};if(this.check([76,0,0,0,1,20,2,0,0,0,0,0,192,0,0,0,0,0,0,70]))return{ext:"lnk",mime:"application/x.ms.shortcut"};if(this.check([98,111,111,107,0,0,0,0,109,97,114,107,0,0,0,0]))return{ext:"alias",mime:"application/x.apple.alias"};if(this.checkString("Kaydara FBX Binary \0"))return{ext:"fbx",mime:"application/x.autodesk.fbx"};if(this.check([76,80],{offset:34})&&(this.check([0,0,1],{offset:8})||this.check([1,0,2],{offset:8})||this.check([2,0,2],{offset:8})))return{ext:"eot",mime:"application/vnd.ms-fontobject"};if(this.check([6,6,237,245,216,29,70,229,189,49,239,231,254,116,183,29]))return{ext:"indd",mime:"application/x-indesign"};if(await e.peekBuffer(this.buffer,{length:Math.min(512,e.fileInfo.size),mayBeLess:!0}),function(e,t=0){const n=Number.parseInt(new Uh(6).get(e,148).replace(/\0.*$/,"").trim(),8);if(Number.isNaN(n))return!1;let r=256;for(let n=t;n<t+148;n++)r+=e[n];for(let n=t+156;n<t+512;n++)r+=e[n];return n===r}(this.buffer))return{ext:"tar",mime:"application/x-tar"};if(this.check([255,254]))return this.check([60,0,63,0,120,0,109,0,108,0],{offset:2})?{ext:"xml",mime:"application/xml"}:this.check([255,14,83,0,107,0,101,0,116,0,99,0,104,0,85,0,112,0,32,0,77,0,111,0,100,0,101,0,108,0],{offset:2})?{ext:"skp",mime:"application/vnd.sketchup.skp"}:void 0;if(this.checkString("-----BEGIN PGP MESSAGE-----"))return{ext:"pgp",mime:"application/pgp-encrypted"};if(this.buffer.length>=2&&this.check([255,224],{offset:0,mask:[255,224]})){if(this.check([16],{offset:1,mask:[22]}))return this.check([8],{offset:1,mask:[8]}),{ext:"aac",mime:"audio/aac"};if(this.check([2],{offset:1,mask:[6]}))return{ext:"mp3",mime:"audio/mpeg"};if(this.check([4],{offset:1,mask:[6]}))return{ext:"mp2",mime:"audio/mpeg"};if(this.check([6],{offset:1,mask:[6]}))return{ext:"mp1",mime:"audio/mpeg"}}}async readTiffTag(e){const t=await this.tokenizer.readToken(e?Fh:Rh);switch(this.tokenizer.ignore(10),t){case 50341:return{ext:"arw",mime:"image/x-sony-arw"};case 50706:return{ext:"dng",mime:"image/x-adobe-dng"}}}async readTiffIFD(e){const t=await this.tokenizer.readToken(e?Fh:Rh);for(let n=0;n<t;++n){const t=await this.readTiffTag(e);if(t)return t}}async readTiffHeader(e){const t=(e?Fh:Rh).get(this.buffer,2),n=(e?Ph:zh).get(this.buffer,4);if(42===t){if(n>=6){if(this.checkString("CR",{offset:8}))return{ext:"cr2",mime:"image/x-canon-cr2"};if(n>=8&&(this.check([28,0,254,0],{offset:8})||this.check([31,0,11,0],{offset:8})))return{ext:"nef",mime:"image/x-nikon-nef"}}await this.tokenizer.ignore(n);return await this.readTiffIFD(e)??{ext:"tif",mime:"image/tiff"}}if(43===t)return{ext:"tif",mime:"image/tiff"}}}new Set(["jpg","png","apng","gif","webp","flif","xcf","cr2","cr3","orf","arw","dng","nef","rw2","raf","tif","bmp","icns","jxr","psd","indd","zip","tar","rar","gz","bz2","7z","dmg","mp4","mid","mkv","webm","mov","avi","mpg","mp2","mp3","m4a","oga","ogg","ogv","opus","flac","wav","spx","amr","pdf","epub","elf","macho","exe","swf","rtf","wasm","woff","woff2","eot","ttf","otf","ico","flv","ps","xz","sqlite","nes","crx","xpi","cab","deb","ar","rpm","Z","lz","cfb","mxf","mts","blend","bpg","docx","pptx","xlsx","3gp","3g2","j2c","jp2","jpm","jpx","mj2","aif","qcp","odt","ods","odp","xml","mobi","heic","cur","ktx","ape","wv","dcm","ics","glb","pcap","dsf","lnk","alias","voc","ac3","m4v","m4p","m4b","f4v","f4p","f4b","f4a","mie","asf","ogm","ogx","mpc","arrow","shp","aac","mp1","it","s3m","xm","ai","skp","avif","eps","lzh","pgp","asar","stl","chm","3mf","zst","jxl","vcf","jls","pst","dwg","parquet","class","arj","cpio","ace","avro","icc","fbx","vsdx","vtt","apk"]),new Set(["image/jpeg","image/png","image/gif","image/webp","image/flif","image/x-xcf","image/x-canon-cr2","image/x-canon-cr3","image/tiff","image/bmp","image/vnd.ms-photo","image/vnd.adobe.photoshop","application/x-indesign","application/epub+zip","application/x-xpinstall","application/vnd.oasis.opendocument.text","application/vnd.oasis.opendocument.spreadsheet","application/vnd.oasis.opendocument.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/zip","application/x-tar","application/x-rar-compressed","application/gzip","application/x-bzip2","application/x-7z-compressed","application/x-apple-diskimage","application/x-apache-arrow","video/mp4","audio/midi","video/x-matroska","video/webm","video/quicktime","video/vnd.avi","audio/wav","audio/qcelp","audio/x-ms-asf","video/x-ms-asf","application/vnd.ms-asf","video/mpeg","video/3gpp","audio/mpeg","audio/mp4","video/ogg","audio/ogg","audio/ogg; codecs=opus","application/ogg","audio/x-flac","audio/ape","audio/wavpack","audio/amr","application/pdf","application/x-elf","application/x-mach-binary","application/x-msdownload","application/x-shockwave-flash","application/rtf","application/wasm","font/woff","font/woff2","application/vnd.ms-fontobject","font/ttf","font/otf","image/x-icon","video/x-flv","application/postscript","application/eps","application/x-xz","application/x-sqlite3","application/x-nintendo-nes-rom","application/x-google-chrome-extension","application/vnd.ms-cab-compressed","application/x-deb","application/x-unix-archive","application/x-rpm","application/x-compress","application/x-lzip","application/x-cfb","application/x-mie","application/mxf","video/mp2t","application/x-blender","image/bpg","image/j2c","image/jp2","image/jpx","image/jpm","image/mj2","audio/aiff","application/xml","application/x-mobipocket-ebook","image/heif","image/heif-sequence","image/heic","image/heic-sequence","image/icns","image/ktx","application/dicom","audio/x-musepack","text/calendar","text/vcard","text/vtt","model/gltf-binary","application/vnd.tcpdump.pcap","audio/x-dsf","application/x.ms.shortcut","application/x.apple.alias","audio/x-voc","audio/vnd.dolby.dd-raw","audio/x-m4a","image/apng","image/x-olympus-orf","image/x-sony-arw","image/x-adobe-dng","image/x-nikon-nef","image/x-panasonic-rw2","image/x-fujifilm-raf","video/x-m4v","video/3gpp2","application/x-esri-shape","audio/aac","audio/x-it","audio/x-s3m","audio/x-xm","video/MP1S","video/MP2P","application/vnd.sketchup.skp","image/avif","application/x-lzh-compressed","application/pgp-encrypted","application/x-asar","model/stl","application/vnd.ms-htmlhelp","model/3mf","image/jxl","application/zstd","image/jls","application/vnd.ms-outlook","image/vnd.dwg","application/x-parquet","application/java-vm","application/x-arj","application/x-cpio","application/x-ace-compressed","application/avro","application/vnd.iccprofile","application/x.autodesk.fbx","application/vnd.visio","application/vnd.android.package-archive"]),exports.FileHelper=void 0,function(e){e.truncateFileName=(e,n)=>{let r,i=e,a=0;if(n&&n.current&&(r=t(n.current),a=n.current.getBoundingClientRect().width),r&&r.measureText(e).width>a){const t="...";let n="",o="",s=0,u=e.length-1,c=t,l=c;for(;s<u;){if(n+=e.charAt(s),c=n+t+o,r.measureText(c).width>a){i=l;break}if(l=c,o=e.charAt(u)+o,c=n+t+o,r.measureText(c).width>a){i=l;break}l=c,s++,u--}}return i};const t=e=>{const t=document.createDocumentFragment(),n=document.createElement("canvas");t.appendChild(n);const r=n.getContext("2d"),i=window.getComputedStyle(e);return r.font=i.font?i.font:`${i.fontSize}" "${i.fontFamily}`,r};e.fileToDataUrl=async e=>{if(window&&window.FileReader)return new Promise(((t,n)=>{const r=new FileReader;r.readAsDataURL(e),r.onload=()=>t(r.result),r.onerror=e=>n(e)}))},e.dataUrlToBlob=async e=>(await fetch(e)).blob(),e.getFilesizeFromBase64=e=>{const t=e.length;return.75*t-(e.substring(t-2,2).match(/=/g)?.length||0)},e.extensionsToSentence=e=>{const t=e.map((e=>`.${e.toUpperCase()}`)),n=t.indexOf(".JPG");return n>-1&&t.splice(n+1,0,".JPEG"),new Intl.ListFormat("en-GB",{style:"long",type:"disjunction"}).format(t)},e.fileExtensionToMimeType=e=>{switch(e.toLowerCase()){case"jpg":case"jpeg":return"image/jpeg";case"png":return"image/png";case"gif":return"image/gif";case"heic":return"image/heic";case"heif":return"image/heif";case"webp":return"image/webp"}},e.getType=async e=>{const t=await e.arrayBuffer(),n=await async function(e){return(new em).fromBuffer(e)}(t);if(!n&&e.type.startsWith("text")){const t=e.name||".txt";return{mime:e.type,ext:t.substring(t.lastIndexOf(".")+1,t.length)}}return n},e.deduplicateFileName=(t,n,r,i=r,a=1)=>{if(t.filter(((e,t)=>t!==n)).includes(r)){const o=i.split("."),s=o.pop();return s?(r=o.join(".").concat(` (${a}).`).concat(s),e.deduplicateFileName(t,n,r,i,++a)):r}return r},e.sanitizeFileName=e=>{const t=e.split(".");let n,r;2===t.length&&""===t[0]?r=e:t.length>1?(n=t.pop(),r=t.join(".")):r=t.join(".");let i=r.replace(/[^\u0020-\u007E]*/g,"");return i||(i="file"),n?`${i}.${n}`:`${i}`},e.blobToFile=(e,t)=>{const{name:n,lastModified:r}=t;return new File([e],n,{type:e.type,lastModified:r})}}(exports.FileHelper||(exports.FileHelper={}));const tm={COMMON:{FIELD_REQUIRED:"This field is required.",REQUIRED_OPTION:"An option is required.",REQUIRED_OPTIONS:"Both options are required."},CONTACT:{INVALID_SINGAPORE_NUMBER:"Invalid Singapore number.",INVALID_INTERNATIONAL_NUMBER:"Invalid international number."},DATE:{MUST_BE_FUTURE:"Date must be in the future.",MUST_BE_PAST:"Date must be in the past.",CANNOT_BE_FUTURE:"Date cannot be in the future.",CANNOT_BE_PAST:"Date cannot be in the past.",MIN_DATE:e=>`Date cannot be earlier than ${e}.`,MAX_DATE:e=>`Date cannot be later than ${e}.`,DISABLED_DATES:"Date is not allowed.",INVALID:"Invalid date.",WITHIN_DAYS:e=>{const{numberOfDays:t,fromDate:n}=e,r=Math.abs(t);return`Date must be within ${r} ${1!==r?"days":"day"} ${t>0?"from":"prior to"} ${n?` ${n}`:" today"}.`},BEYOND_DAYS:e=>{const{numberOfDays:t,fromDate:n}=e,r=Math.abs(t);return`Date must be beyond ${r} ${1!==r?"days":"day"} ${t>0?"from":"prior to"} ${n?` ${n}`:" today"}.`}},DATE_RANGE:{MUST_BE_FUTURE:"Dates must be in the future.",MUST_BE_PAST:"Dates must be in the past.",CANNOT_BE_FUTURE:"Dates cannot be in the future.",CANNOT_BE_PAST:"Dates cannot be in the past.",MIN_DATE:e=>`Dates cannot be earlier than ${e}.`,MAX_DATE:e=>`Dates cannot be later than ${e}.`,DISABLED_DATES:"Date range should not include disabled dates.",INVALID:"Invalid dates",REQUIRED:"Both dates are required",MUST_HAVE_NUMBER_OF_DAYS:e=>`Selection should have ${e} days.`},EMAIL:{INVALID:"Invalid email address."},ESIGNATURE:{UPLOAD:"Signature not uploaded."},GENERIC:{INVALID:"Invalid input",UNSUPPORTED:"This component is not supported by the engine."},UPLOAD:(t="file",n=`${t}s`)=>({REQUIRED:`Upload at least 1 ${t}.`,MAX_FILES:e=>`Upload failed. You can only upload a maximum of ${e} ${1!==e?n:t}.`,MAX_FILES_WITH_REMAINING:e=>`Upload failed. You can only upload ${e} more ${1===e?t:n}. To upload more ${n}, you may wish to delete your previously uploaded ${n}.`,MAX_FILE_SIZE:e=>`Upload failed. ${Ih(t)} exceeds the maximum size of ${e} KB.`,GENERIC:"Upload failed. Please try again.",FILE_TYPE:e=>`Upload failed. Only ${exports.FileHelper.extensionsToSentence(e)} files are accepted.`,UPLOADING:`Please wait for all ${n} to finish uploading.`,MODAL:{FILE_TYPE:{TITLE:`Unsupported ${t} format`,DESCRIPTION:(t,n)=>e.jsxs(e.Fragment,{children:[t," could not be uploaded. Try again with a"," ",exports.FileHelper.extensionsToSentence(n)," file."]})},GENERIC_ERROR:{TITLE:`${Ih(t)} not uploaded`,DESCRIPTION:t=>e.jsxs(e.Fragment,{children:["There was a problem uploading ",t,". Please try again."]})},MAX_FILE_SIZE:{TITLE:`${Ih(t)} exceeds maximum size`,DESCRIPTION:(t,n)=>e.jsxs(e.Fragment,{children:[t," exceeds the maximum size of ",n," KB."]})}}}),SLIDER:{MUST_BE_INCREMENTAL:"Input must be incremental."},UNIT_NUMBER:{INVALID:"Invalid unit number."},LOCATION:{MUST_HAVE_POSTAL_CODE:"Selected location must have postal code."},ARRAY_FIELD:{INVALID:"One or more of the sections is incomplete",REQUIRED:"At least one section must be filled in"}};var nm;!function(e){function t(e,t,n){if(e)try{const r=qd.ofPattern(t).withResolverStyle(Wl.STRICT).withLocale(jp.ENGLISH);switch(n){case"date":return mf.parse(e,r);case"time":return _f.parse(e,r);case"datetime":return yf.parse(e,r);default:return}}catch(e){return}}function n(e){const{numberOfDays:n,fromDate:r,dateFormat:i="uuuu-MM-dd"}=e,a=r&&t(r,i,"date")||mf.now();return n>=0?{startDate:a,endDate:a.plusDays(n)}:{startDate:a.plusDays(n),endDate:a}}e.formatDateTime=(e,t,n,r)=>{if(e)try{const i=qd.ofPattern(t).withResolverStyle(Wl.STRICT).withLocale(jp.ENGLISH);switch(n){case"date":return mf.parse(e).format(i);case"time":return _f.parse(e).format(i);case"datetime":return yf.parse(e).format(i);default:return r||tm.GENERIC.INVALID}}catch(e){return r||tm.GENERIC.INVALID}},e.toLocalDateOrTime=t,e.calculateWithinDaysRange=n,e.calculateDisabledWithinDaysRange=function(e){const{numberOfDays:t,inclusive:r}=e,{startDate:i,endDate:a}=n(e);return t>=0?{startDate:r?i:i.plusDays(1),endDate:a}:{startDate:i,endDate:r?a:a.minusDays(1)}},e.calculateDisabledBeyondDaysRange=function(e){const{numberOfDays:n,fromDate:r,dateFormat:i="uuuu-MM-dd"}=e,a=r&&t(r,i,"date")||mf.now(),o={startDate:void 0,endDate:void 0};return n>=0?o.startDate=a.plusDays(n+1):o.endDate=a.plusDays(n-1),o},e.checkWithinDays=function(e,r){if(!e)return!0;const{dateFormat:i="uuuu-MM-dd"}=r,a=t(e,i,"date");if(!a)return!1;const{startDate:o,endDate:s}=n(r),{numberOfDays:u,inclusive:c}=r;if(u>=0){const e=c?o.minusDays(1):o,t=s.plusDays(1);return a.isAfter(e)&&a.isBefore(t)}{const e=o.minusDays(1),t=c?s.plusDays(1):s;return a.isAfter(e)&&a.isBefore(t)}},e.checkBeyondDays=function(e,n){if(!e)return!0;const{dateFormat:r="uuuu-MM-dd"}=n,i=t(e,r,"date");if(!i)return!1;const{numberOfDays:a,fromDate:o}=n,s=o&&t(o,r,"date")||mf.now();return a>=0?i.isAfter(s.plusDays(a)):i.isBefore(s.plusDays(a))}}(nm||(nm={})),exports.GeoLocationHelper=void 0,function(e){const t=async(e,t)=>new Promise(((n,r)=>{"geolocation"in navigator?navigator.geolocation.getCurrentPosition((({coords:e})=>n({lat:e.latitude,lng:e.longitude})),(e=>r(e)),{enableHighAccuracy:!0,timeout:e,maximumAge:t}):r(new Error("geolocation not supported in this browser"))}));e.getCurrentLocation=async(e={})=>{const{maxAttempts:n=3,timeout:r=2e3,maximumAge:i=2e3}=e;let a=0;do{a++;try{return await t(r,i)}catch(e){if(a>=n||!e||e.code!==e.TIMEOUT)throw e}}while(a<n);throw"Failed to get current location"}}(exports.GeoLocationHelper||(exports.GeoLocationHelper={}));const rm=()=>Array(5).fill(0).map((()=>Math.random().toString(36).slice(2))).join("");class im{constructor(e){if(function(e){return"object"!=typeof e||void 0===e.length||void 0===e.readUInt8||void 0===e.readUInt16LE||void 0===e.readUInt16BE||void 0===e.readUInt32LE||void 0===e.readUInt32BE||void 0===e.readInt32LE||void 0===e.readInt32BE}(e))throw new Error("DataView: Passed buffer type is unsupported.");this.buffer=e,this.byteLength=this.buffer.length}getUint8(e){return this.buffer.readUInt8(e)}getUint16(e,t){return t?this.buffer.readUInt16LE(e):this.buffer.readUInt16BE(e)}getUint32(e,t){return t?this.buffer.readUInt32LE(e):this.buffer.readUInt32BE(e)}getInt32(e,t){return t?this.buffer.readInt32LE(e):this.buffer.readInt32BE(e)}}function am(e,t,n){try{return new DataView(e,t,n)}catch(r){return new im(e,t,n)}}function om(e,t,n){const r=[];for(let i=0;i<n&&t+i<e.byteLength;i++)r.push(e.getUint8(t+i));return lm(r)}function sm(e,t){const n=[];let r=0;for(;t+r<e.byteLength;){const i=e.getUint8(t+r);if(0===i)break;n.push(i),r++}return lm(n)}function um(e,t,n){const r=[];for(let i=0;i<n&&t+i<e.byteLength;i+=2)r.push(e.getUint16(t+i));return 0===r[r.length-1]&&r.pop(),lm(r)}function cm(e,t){const n=e.getUint8(t);return[n,om(e,t+1,n)]}function lm(e){return e.map((e=>String.fromCharCode(e))).join("")}function dm(){for(let e=1;e<arguments.length;e++)for(const t in arguments[e])arguments[0][t]=arguments[e][t];return arguments[0]}function fm(e,t,n){let r=!1;Object.defineProperty(e,t,{get:()=>(r||(r=!0,Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:n.apply(e),writable:!0})),e[t]),configurable:!0,enumerable:!0})}function pm(e){return"undefined"!=typeof btoa?"string"==typeof e?btoa(e):btoa(Array.prototype.reduce.call(new Uint8Array(e),((e,t)=>e+String.fromCharCode(t)),"")):"undefined"!=typeof Buffer?void 0!==Buffer.from?Buffer.from(e).toString("base64"):new Buffer(e).toString("base64"):void 0}function hm(e,t){return new Array(t+1).join(e)}const mm=void 0;function gm(e,t,n,r="string"){if(0===t&&"function"==typeof DecompressionStream){const t=new DecompressionStream("deflate"),i=new Blob([e]).stream().pipeThrough(t);return"dataview"===r?new Response(i).arrayBuffer().then((e=>new DataView(e))):new Response(i).arrayBuffer().then((e=>new TextDecoder(n).decode(e)))}return void 0!==t?Promise.reject(`Unknown compression method ${t}.`):e}var ym=!0,_m=!0;function vm(e){return e.map((e=>String.fromCharCode(e))).join("")}function bm(e){if(e.length>=8){const t=vm(e.slice(0,8));if("ASCII\0\0\0"===t)return vm(e.slice(8));if("JIS\0\0\0\0\0"===t)return"[JIS encoded text]";if("UNICODE\0"===t)return"[Unicode encoded text]";if("\0\0\0\0\0\0\0\0"===t)return"[Undefined encoding]"}return"Undefined"}function Em(e){return e[0][0]/e[0][1]+e[1][0]/e[1][1]/60+e[2][0]/e[2][1]/3600}const Sm=18761,Am=19789;var xm={BIG_ENDIAN:Am,LITTLE_ENDIAN:Sm,getByteOrder:function(e,t){if(e.getUint16(t)===Sm)return Sm;if(e.getUint16(t)===Am)return Am;throw new Error("Illegal byte order value. Faulty image.")}};var wm={isTiffFile:function(e){return!!e&&e.byteLength>=4&&function(e){const t=42,n=2,r=e.getUint16(0)===xm.LITTLE_ENDIAN;return e.getUint16(n,r)===t}(e)},findTiffOffsets:function(){return{hasAppMarkers:!0,tiffHeaderOffset:0}}};var Tm={isJpegFile:function(e){return!!e&&e.byteLength>=Mm&&e.getUint16(0)===Om},findJpegOffsets:function(e){let t,n,r,i,a,o,s,u,c,l=Cm;for(;l+Nm+5<=e.byteLength;){if(sg(e,l))t=e.getUint16(l+Dm),n=l+Dm;else if(ug(e,l))t=e.getUint16(l+Dm),r=l+Dm;else if(dg(e,l))t=e.getUint16(l+Dm),i=l+Lm;else if(fg(e,l))t=e.getUint16(l+Dm),a=l+Im;else if(pg(e,l))s||(s=[]),t=e.getUint16(l+Dm),s.push(mg(l,t));else if(hg(e,l))s||(s=[]),t=e.getUint16(l+Dm),s.push(gg(l,t));else if(yg(e,l))t=e.getUint16(l+Dm),o=l+km;else if(cg(e,l)){t=e.getUint16(l+Dm);const n=l+Fm,r=t-(Fm-Dm),i=e.getUint8(l+jm),a=e.getUint8(l+Zm);u||(u=[]),u.push({offset:n,length:r,chunkNumber:i,chunksTotal:a})}else if(lg(e,l))t=e.getUint16(l+Dm),c=l+zm;else{if(!_g(e,l)){if(vg(e,l)){l++;continue}break}t=e.getUint16(l+Dm)}l+=Dm+t}return{hasAppMarkers:l>Cm,fileDataOffset:n||r,jfifDataOffset:i,tiffHeaderOffset:a,iptcDataOffset:o,xmpChunks:s,iccChunks:u,mpfDataOffset:c}}};const Mm=2,Om=65496,Cm=2,Nm=4,Dm=2,Lm=2,Im=10,km=18,$m=33,Rm=79,Fm=18,zm=8,Pm="ICC_PROFILE\0",jm=Nm+Pm.length,Zm=jm+1,Um="MPF\0",Bm=65472,Vm=65474,Hm=65476,Gm=65499,Ym=65501,Wm=65498,qm=65504,Km=65505,Jm=65506,Xm=65517,Qm=65519,eg=65534,tg=65535,ng="JFIF",rg="Exif",ig="http://ns.adobe.com/xap/1.0/\0",ag="http://ns.adobe.com/xmp/extension/\0",og="Photoshop 3.0";function sg(e,t){return e.getUint16(t)===Bm}function ug(e,t){return e.getUint16(t)===Vm}function cg(e,t){const n=Pm.length;return e.getUint16(t)===Jm&&om(e,t+Nm,n)===Pm}function lg(e,t){const n=Um.length;return e.getUint16(t)===Jm&&om(e,t+Nm,n)===Um}function dg(e,t){const n=ng.length;return e.getUint16(t)===qm&&om(e,t+Nm,n)===ng&&0===e.getUint8(t+Nm+n)}function fg(e,t){const n=rg.length;return e.getUint16(t)===Km&&om(e,t+Nm,n)===rg&&0===e.getUint8(t+Nm+n)}function pg(e,t){return e.getUint16(t)===Km&&function(e,t){const n=ig.length;return om(e,t+Nm,n)===ig}(e,t)}function hg(e,t){return e.getUint16(t)===Km&&function(e,t){const n=ag.length;return om(e,t+Nm,n)===ag}(e,t)}function mg(e,t){return{dataOffset:e+$m,length:t-($m-Dm)}}function gg(e,t){return{dataOffset:e+Rm,length:t-(Rm-Dm)}}function yg(e,t){const n=og.length;return e.getUint16(t)===Xm&&om(e,t+Nm,n)===og&&0===e.getUint8(t+Nm+n)}function _g(e,t){const n=e.getUint16(t);return n>=qm&&n<=Qm||n===eg||n===Bm||n===Vm||n===Hm||n===Gm||n===Ym||n===Wm}function vg(e,t){return e.getUint16(t)===tg}var bg={isPngFile:function(e){return!!e&&om(e,0,Eg.length)===Eg},findPngOffsets:function(e,t){const n={hasAppMarkers:!1};let r=Eg.length;for(;r+Sg+Ag<=e.byteLength;){if($g(e,r))n.hasAppMarkers=!0,n.pngHeaderOffset=r+Tg;else if(Rg(e,r)){const t=Zg(e,r);void 0!==t&&(n.hasAppMarkers=!0,n.xmpChunks=[{dataOffset:t,length:e.getUint32(r+xg)-(t-(r+Tg))}])}else if(Fg(e,r,t)){n.hasAppMarkers=!0;const t=om(e,r+wg,Ag);n.pngTextChunks||(n.pngTextChunks=[]),n.pngTextChunks.push({length:e.getUint32(r+xg),type:t,offset:r+Tg})}else if(zg(e,r))n.hasAppMarkers=!0,n.tiffHeaderOffset=r+Tg;else if(t&&Pg(e,r)){n.hasAppMarkers=!0;const t=e.getUint32(r+xg),i=r+Tg,{profileName:a,compressionMethod:o,compressedProfileOffset:s}=Ug(e,i);n.iccChunks||(n.iccChunks=[]),n.iccChunks.push({offset:s,length:t-(s-i),chunkNumber:1,chunksTotal:1,profileName:a,compressionMethod:o})}else jg(e,r)&&(n.hasAppMarkers=!0,n.pngChunkOffsets||(n.pngChunkOffsets=[]),n.pngChunkOffsets.push(r+xg));r+=e.getUint32(r+xg)+Sg+Ag+4}return n}};const Eg="PNG\r\n\n",Sg=4,Ag=4,xg=0,wg=Sg,Tg=Sg+Ag,Mg="XML:com.adobe.xmp\0",Og="tEXt",Cg="iTXt",Ng="zTXt",Dg="pHYs",Lg="tIME",Ig="eXIf",kg="iCCP";function $g(e,t){return"IHDR"===om(e,t+wg,Ag)}function Rg(e,t){return om(e,t+wg,Ag)===Cg&&om(e,t+Tg,Mg.length)===Mg}function Fg(e,t,n){const r=om(e,t+wg,Ag);return r===Og||r===Cg||r===Ng&&n}function zg(e,t){return om(e,t+wg,Ag)===Ig}function Pg(e,t){return om(e,t+wg,Ag)===kg}function jg(e,t){const n=[Dg,Lg],r=om(e,t+wg,Ag);return n.includes(r)}function Zg(e,t){t+=Tg+Mg.length+1+1;let n=0;for(;n<2&&t<e.byteLength;)0===e.getUint8(t)&&n++,t++;if(!(n<2))return t}function Ug(e,t){const n=sm(e,t);t+=n.length+1;return{profileName:n,compressionMethod:e.getUint8(t),compressedProfileOffset:t+=1}}function Bg(e,t,n,r){const{offsets:i,sizes:a}=function(e,t){const n={item:{dataReferenceIndex:2,extentCount:2,extent:{}}};e<2?(n.itemCount=2,n.item.itemId=2):2===e&&(n.itemCount=4,n.item.itemId=4);n.item.constructionMethod=1===e||2===e?2:0;const r={offsetSize:t,lengthSize:t,baseOffsetSize:t+1,indexSize:t+1};return r.itemCount=t+2,r.items=r.itemCount+n.itemCount,r.item={itemId:0},r.item.constructionMethod=r.item.itemId+n.item.itemId,r.item.dataReferenceIndex=r.item.constructionMethod+n.item.constructionMethod,{offsets:r,sizes:n}}(t,n+3),o=e.getUint8(i.offsetSize)>>4;a.item.extent.extentOffset=o;const s=15&e.getUint8(i.lengthSize);a.item.extent.extentLength=s;const u=e.getUint8(i.baseOffsetSize)>>4;a.item.baseOffset=u;const c=function(e,t,n){if(1===n||2===n)return 15&e.getUint8(t);return}(e,i.indexSize,t);a.item.extent.extentIndex=void 0!==c?c:0;const l=function(e,t,n){if(n<2)return e.getUint16(t);if(2===n)return e.getUint32(t);return}(e,i.itemCount,t);return{type:"iloc",items:Vg(e,t,i,a,o,s,c,l),length:r}}function Vg(e,t,n,r,i,a,o,s){if(void 0===s)return[];const u=[];let c=n.items;for(let n=0;n<s;n++){const n={extents:[]};n.itemId=Hg(e,c,t),c+=r.item.itemId,n.constructionMethod=1===t||2===t?15&e.getUint16(c):void 0,c+=r.item.constructionMethod,n.dataReferenceIndex=e.getUint16(c),c+=r.item.dataReferenceIndex,n.baseOffset=Yg(e,c,r.item.baseOffset),c+=r.item.baseOffset,n.extentCount=e.getUint16(c),c+=r.item.extentCount;for(let s=0;s<n.extentCount;s++){const s={};s.extentIndex=Gg(e,t,c,o),c+=r.item.extent.extentIndex,s.extentOffset=Yg(e,c,i),c+=r.item.extent.extentOffset,s.extentLength=Yg(e,c,a),c+=r.item.extent.extentLength,n.extents.push(s)}u.push(n)}return u}function Hg(e,t,n){return n<2?e.getUint16(t):2===n?e.getUint32(t):void 0}function Gg(e,t,n,r){if((1===t||2===t)&&r>0)return Yg(e,n,r)}function Yg(e,t,n){return 4===n?e.getUint32(t):8===n?(console.warn("This file uses an 8-bit offset which is currently not supported by ExifReader. Contact the maintainer to get it fixed."),function(e,t){return e.getUint32(t+4)}(e,t)):0}const Wg=1165519206,qg=1835625829,Kg=1970432288;function Jg(e,t){const{length:n,contentOffset:r}=function(e,t){const n=4,r=4,i=8,a=12,o=e.getUint32(t);if(function(e){return 0===e}(o))return{length:e.byteLength-t,contentOffset:t+n+r};if(function(e){return 1===e}(o)&&function(e,t){const n=8;return 0===e.getUint32(t+n)}(e,t))return{length:e.getUint32(t+a),contentOffset:t+n+r+i};return{length:o,contentOffset:t+n+r}}(e,t);if(n<8)return;const i=e.getUint32(t+4);if(1718909296===i)return function(e,t,n){const r=om(e,t,4);return{type:"ftyp",majorBrand:r,length:n}}(e,r,n);if(1768977008===i)return function(e,t,n,r){return{type:"iprp",subBoxes:ty(e,n,r-(n-t)),length:r}}(e,t,r,n);if(1768973167===i)return function(e,t,n,r){return{type:"ipco",properties:ty(e,n,r-(n-t)),length:r}}(e,t,r,n);if(1668246642===i)return function(e,t,n){return{type:"colr",icc:ey(e,t),length:n}}(e,r,n);const a=e.getUint8(r);return 1835365473===i?function(e,t,n,r){const i=3;return{type:"meta",subBoxes:ty(e,n+i,r-(n+i-t)),length:r}}(e,t,r+1,n):1768714083===i?Bg(e,a,r+1,n):1768517222===i?function(e,t,n,r,i){const{offsets:a}=function(e,t){const n={entryCount:t+3},r={};r.entryCount=0===e?2:4;return n.itemInfos=n.entryCount+r.entryCount,{offsets:n}}(n,r);return{type:"iinf",itemInfos:ty(e,a.itemInfos,i-(a.itemInfos-t)),length:i}}(e,t,a,r+1,n):1768842853===i?function(e,t,n,r,i){r+=3;const a={type:"infe",length:i};0!==n&&1!==n||(a.itemId=e.getUint16(r),r+=2,a.itemProtectionIndex=e.getUint16(r),r+=2,a.itemName=sm(e,r),r+=a.itemName.length+1);n>=2&&(2===n?(a.itemId=e.getUint16(r),r+=2):3===n&&(a.itemId=e.getUint32(r),r+=4),a.itemProtectionIndex=e.getUint16(r),r+=2,a.itemType=e.getUint32(r),r+=4,a.itemName=sm(e,r),r+=a.itemName.length+1,a.itemType===qg?(a.contentType=sm(e,r),t+i>(r+=a.contentType.length+1)&&(a.contentEncoding=sm(e,r),r+=a.contentEncoding.length+1)):a.itemType===Kg&&(a.itemUri=sm(e,r),r+=a.itemUri.length+1));return a}(e,t,a,r+1,n):{type:void 0,length:n}}function Xg(e){{const t={},n=function(e){const t=4,n=4;let r=0;for(;r+t+n<=e.byteLength;){const t=Jg(e,r);if(void 0===t)break;if("meta"===t.type)return t;r+=t.length}return}(e);return n?(t.tiffHeaderOffset=function(e,t){try{const n=function(e){return e.subBoxes.find((e=>"iinf"===e.type)).itemInfos.find((e=>e.itemType===Wg))}(t).itemId,r=Qg(t,n);return function(e,t){return t+4+e.getUint32(t)}(e,r.baseOffset+r.extents[0].extentOffset)}catch(e){return}}(e,n),t.xmpChunks=function(e){try{const t=function(e){return e.subBoxes.find((e=>"iinf"===e.type)).itemInfos.find((e=>e.itemType===qg&&"application/rdf+xml"===e.contentType))}(e).itemId,n=Qg(e,t),r=Qg(e,t).extents[0];return[{dataOffset:n.baseOffset+r.extentOffset,length:r.extentLength}]}catch(e){return}}(n),t.iccChunks=function(e){try{const t=e.subBoxes.find((e=>"iprp"===e.type)).subBoxes.find((e=>"ipco"===e.type)).properties.find((e=>"colr"===e.type)).icc;if(t)return[t]}catch(e){}return}(n),t.hasAppMarkers=void 0!==t.tiffHeaderOffset||void 0!==t.xmpChunks||void 0!==t.iccChunks,t):{hasAppMarkers:!1}}}function Qg(e,t){return e.subBoxes.find((e=>"iloc"===e.type)).items.find((e=>e.itemId===t))}function ey(e,t){const n=om(e,t,4);if("prof"===n||"rICC"===n)return{offset:t+4,length:e.getUint32(t+4),chunkNumber:1,chunksTotal:1}}function ty(e,t,n){const r=[Wg,qg],i=[];let a=t;for(;a<t+n;){const t=Jg(e,a);if(void 0===t)break;void 0===t.type||void 0!==t.itemType&&-1===r.indexOf(t.itemType)||i.push(t),a+=t.length}return i}var ny={isHeicFile:function(e){if(!e)return!1;const t=["heic","heix","hevc","hevx","heim","heis","hevm","hevs","mif1"];try{const n=Jg(e,0);return n&&-1!==t.indexOf(n.majorBrand)}catch(e){return!1}},findHeicOffsets:function(e){return Xg(e)}};var ry={isAvifFile:function(e){if(!e)return!1;try{const t=Jg(e,0);return t&&"avif"===t.majorBrand}catch(e){return!1}},findAvifOffsets:function(e){return Xg(e)}};var iy={isWebpFile:function(e){const t="RIFF",n="WEBP";return!!e&&om(e,0,4)===t&&om(e,8,4)===n},findOffsets:function(e){const t="Exif\0\0";let n,r,i,a,o=12,s=!1;for(;o+8<e.byteLength;){const u=om(e,o,4),c=e.getUint32(o+4,!0);"EXIF"===u?(s=!0,n=om(e,o+8,6)===t?o+8+6:o+8):"XMP "===u?(s=!0,r=[{dataOffset:o+8,length:c}]):"ICCP"===u?(s=!0,i=[{offset:o+8,length:c,chunkNumber:1,chunksTotal:1}]):"VP8X"===u&&(s=!0,a=o+8),o+=8+(c%2==0?c:c+1)}return{hasAppMarkers:s,tiffHeaderOffset:n,xmpChunks:r,iccChunks:i,vp8xChunkOffset:a}}};var ay={isGifFile:function(e){return!!e&&sy.includes(om(e,0,oy))},findOffsets:function(){return{gifHeaderOffset:0}}};const oy=6,sy=["GIF87a","GIF89a"];var uy={isXMLFile:function(e){return!!e&&om(e,cy,ly.length)===ly},findOffsets:function(e){const t=[];return t.push({dataOffset:cy,length:e.byteLength}),{xmpChunks:t}}};const cy=0,ly="<?xpacket begin";var dy={parseAppMarkers:function(e,t){if(wm.isTiffFile(e))return fy(wm.findTiffOffsets(),"tiff","TIFF");if(Tm.isJpegFile(e))return fy(Tm.findJpegOffsets(e),"jpeg","JPEG");if(bg.isPngFile(e))return fy(bg.findPngOffsets(e,t),"png","PNG");if(ny.isHeicFile(e))return fy(ny.findHeicOffsets(e),"heic","HEIC");if(ry.isAvifFile(e))return fy(ry.findAvifOffsets(e),"avif","AVIF");if(iy.isWebpFile(e))return fy(iy.findOffsets(e),"webp","WebP");if(ay.isGifFile(e))return fy(ay.findOffsets(e),"gif","GIF");if(uy.isXMLFile(e))return fy(uy.findOffsets(e),"xml","XML");throw new Error("Invalid image format")}};function fy(e,t,n){return dm({},e,{fileType:{value:t,description:n}})}var py={ApertureValue:e=>Math.pow(Math.sqrt(2),e[0]/e[1]).toFixed(2),ColorSpace:e=>1===e?"sRGB":65535===e?"Uncalibrated":"Unknown",ComponentsConfiguration:e=>e.map((e=>49===e?"Y":50===e?"Cb":51===e?"Cr":52===e?"R":53===e?"G":54===e?"B":void 0)).join(""),Contrast:e=>0===e?"Normal":1===e?"Soft":2===e?"Hard":"Unknown",CustomRendered:e=>0===e?"Normal process":1===e?"Custom process":"Unknown",ExposureMode:e=>0===e?"Auto exposure":1===e?"Manual exposure":2===e?"Auto bracket":"Unknown",ExposureProgram:e=>0===e?"Undefined":1===e?"Manual":2===e?"Normal program":3===e?"Aperture priority":4===e?"Shutter priority":5===e?"Creative program":6===e?"Action program":7===e?"Portrait mode":8===e?"Landscape mode":9===e?"Bulb":"Unknown",ExposureTime(e){if(e[0]/e[1]>.25){const t=e[0]/e[1];return Number.isInteger(t)?""+t:t.toFixed(1)}return 0!==e[0]?`1/${Math.round(e[1]/e[0])}`:`0/${e[1]}`},FNumber:e=>"f/"+e[0]/e[1],FocalLength:e=>e[0]/e[1]+" mm",FocalPlaneResolutionUnit:e=>2===e?"inches":3===e?"centimeters":"Unknown",LightSource:e=>1===e?"Daylight":2===e?"Fluorescent":3===e?"Tungsten (incandescent light)":4===e?"Flash":9===e?"Fine weather":10===e?"Cloudy weather":11===e?"Shade":12===e?"Daylight fluorescent (D 5700 – 7100K)":13===e?"Day white fluorescent (N 4600 – 5400K)":14===e?"Cool white fluorescent (W 3900 – 4500K)":15===e?"White fluorescent (WW 3200 – 3700K)":17===e?"Standard light A":18===e?"Standard light B":19===e?"Standard light C":20===e?"D55":21===e?"D65":22===e?"D75":23===e?"D50":24===e?"ISO studio tungsten":255===e?"Other light source":"Unknown",MeteringMode:e=>1===e?"Average":2===e?"CenterWeightedAverage":3===e?"Spot":4===e?"MultiSpot":5===e?"Pattern":6===e?"Partial":255===e?"Other":"Unknown",ResolutionUnit:e=>2===e?"inches":3===e?"centimeters":"Unknown",Saturation:e=>0===e?"Normal":1===e?"Low saturation":2===e?"High saturation":"Unknown",SceneCaptureType:e=>0===e?"Standard":1===e?"Landscape":2===e?"Portrait":3===e?"Night scene":"Unknown",Sharpness:e=>0===e?"Normal":1===e?"Soft":2===e?"Hard":"Unknown",ShutterSpeedValue(e){const t=Math.pow(2,e[0]/e[1]);return t<=1?`${Math.round(1/t)}`:`1/${Math.round(t)}`},WhiteBalance:e=>0===e?"Auto white balance":1===e?"Manual white balance":"Unknown",XResolution:e=>""+Math.round(e[0]/e[1]),YResolution:e=>""+Math.round(e[0]/e[1])},hy={11:"ProcessingSoftware",254:{name:"SubfileType",description:e=>({0:"Full-resolution image",1:"Reduced-resolution image",2:"Single page of multi-page image",3:"Single page of multi-page reduced-resolution image",4:"Transparency mask",5:"Transparency mask of reduced-resolution image",6:"Transparency mask of multi-page image",7:"Transparency mask of reduced-resolution multi-page image",65537:"Alternate reduced-resolution image",4294967295:"Invalid"}[e]||"Unknown")},255:{name:"OldSubfileType",description:e=>({0:"Full-resolution image",1:"Reduced-resolution image",2:"Single page of multi-page image"}[e]||"Unknown")},256:"ImageWidth",257:"ImageLength",258:"BitsPerSample",259:"Compression",262:"PhotometricInterpretation",263:{name:"Thresholding",description:e=>({1:"No dithering or halftoning",2:"Ordered dither or halfton",3:"Randomized dither"}[e]||"Unknown")},264:"CellWidth",265:"CellLength",266:{name:"FillOrder",description:e=>({1:"Normal",2:"Reversed"}[e]||"Unknown")},269:"DocumentName",270:"ImageDescription",271:"Make",272:"Model",273:"StripOffsets",274:{name:"Orientation",description:e=>1===e?"top-left":2===e?"top-right":3===e?"bottom-right":4===e?"bottom-left":5===e?"left-top":6===e?"right-top":7===e?"right-bottom":8===e?"left-bottom":"Undefined"},277:"SamplesPerPixel",278:"RowsPerStrip",279:"StripByteCounts",280:"MinSampleValue",281:"MaxSampleValue",282:{name:"XResolution",description:py.XResolution},283:{name:"YResolution",description:py.YResolution},284:"PlanarConfiguration",285:"PageName",286:{name:"XPosition",description:e=>""+Math.round(e[0]/e[1])},287:{name:"YPosition",description:e=>""+Math.round(e[0]/e[1])},290:{name:"GrayResponseUnit",description:e=>({1:"0.1",2:"0.001",3:"0.0001",4:"1e-05",5:"1e-06"}[e]||"Unknown")},296:{name:"ResolutionUnit",description:py.ResolutionUnit},297:"PageNumber",301:"TransferFunction",305:"Software",306:"DateTime",315:"Artist",316:"HostComputer",317:"Predictor",318:{name:"WhitePoint",description:e=>e.map((e=>`${e[0]}/${e[1]}`)).join(", ")},319:{name:"PrimaryChromaticities",description:e=>e.map((e=>`${e[0]}/${e[1]}`)).join(", ")},321:"HalftoneHints",322:"TileWidth",323:"TileLength",330:"A100DataOffset",332:{name:"InkSet",description:e=>({1:"CMYK",2:"Not CMYK"}[e]||"Unknown")},337:"TargetPrinter",338:{name:"ExtraSamples",description:e=>({0:"Unspecified",1:"Associated Alpha",2:"Unassociated Alpha"}[e]||"Unknown")},339:{name:"SampleFormat",description:e=>{const t={1:"Unsigned",2:"Signed",3:"Float",4:"Undefined",5:"Complex int",6:"Complex float"};return Array.isArray(e)?e.map((e=>t[e]||"Unknown")).join(", "):"Unknown"}},513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength",529:{name:"YCbCrCoefficients",description:e=>e.map((e=>""+e[0]/e[1])).join("/")},530:"YCbCrSubSampling",531:{name:"YCbCrPositioning",description:e=>1===e?"centered":2===e?"co-sited":"undefined "+e},532:{name:"ReferenceBlackWhite",description:e=>e.map((e=>""+e[0]/e[1])).join(", ")},700:"ApplicationNotes",18246:"Rating",18249:"RatingPercent",33432:{name:"Copyright",description:e=>e.join("; ")},33550:"PixelScale",33723:"IPTC-NAA",33920:"IntergraphMatrix",33922:"ModelTiePoint",34118:"SEMInfo",34264:"ModelTransform",34377:"PhotoshopSettings",34665:"Exif IFD Pointer",34675:"ICC_Profile",34735:"GeoTiffDirectory",34736:"GeoTiffDoubleParams",34737:"GeoTiffAsciiParams",34853:"GPS Info IFD Pointer",40091:{name:"XPTitle",description:my},40092:{name:"XPComment",description:my},40093:{name:"XPAuthor",description:my},40094:{name:"XPKeywords",description:my},40095:{name:"XPSubject",description:my},42112:"GDALMetadata",42113:"GDALNoData",50341:"PrintIM",50707:"DNGBackwardVersion",50708:"UniqueCameraModel",50709:"LocalizedCameraModel",50721:"ColorMatrix1",50722:"ColorMatrix2",50723:"CameraCalibration1",50724:"CameraCalibration2",50725:"ReductionMatrix1",50726:"ReductionMatrix2",50727:"AnalogBalance",50728:"AsShotNeutral",50729:"AsShotWhiteXY",50730:"BaselineExposure",50731:"BaselineNoise",50732:"BaselineSharpness",50734:"LinearResponseLimit",50735:"CameraSerialNumber",50736:"DNGLensInfo",50739:"ShadowScale",50741:{name:"MakerNoteSafety",description:e=>({0:"Unsafe",1:"Safe"}[e]||"Unknown")},50778:{name:"CalibrationIlluminant1",description:py.LightSource},50779:{name:"CalibrationIlluminant2",description:py.LightSource},50781:"RawDataUniqueID",50827:"OriginalRawFileName",50828:"OriginalRawFileData",50831:"AsShotICCProfile",50832:"AsShotPreProfileMatrix",50833:"CurrentICCProfile",50834:"CurrentPreProfileMatrix",50879:"ColorimetricReference",50885:"SRawType",50898:"PanasonicTitle",50899:"PanasonicTitle2",50931:"CameraCalibrationSig",50932:"ProfileCalibrationSig",50933:"ProfileIFD",50934:"AsShotProfileName",50936:"ProfileName",50937:"ProfileHueSatMapDims",50938:"ProfileHueSatMapData1",50939:"ProfileHueSatMapData2",50940:"ProfileToneCurve",50941:{name:"ProfileEmbedPolicy",description:e=>({0:"Allow Copying",1:"Embed if Used",2:"Never Embed",3:"No Restrictions"}[e]||"Unknown")},50942:"ProfileCopyright",50964:"ForwardMatrix1",50965:"ForwardMatrix2",50966:"PreviewApplicationName",50967:"PreviewApplicationVersion",50968:"PreviewSettingsName",50969:"PreviewSettingsDigest",50970:{name:"PreviewColorSpace",description:e=>({1:"Gray Gamma 2.2",2:"sRGB",3:"Adobe RGB",4:"ProPhoto RGB"}[e]||"Unknown")},50971:"PreviewDateTime",50972:"RawImageDigest",50973:"OriginalRawFileDigest",50981:"ProfileLookTableDims",50982:"ProfileLookTableData",51043:"TimeCodes",51044:"FrameRate",51058:"TStop",51081:"ReelName",51089:"OriginalDefaultFinalSize",51090:"OriginalBestQualitySize",51091:"OriginalDefaultCropSize",51105:"CameraLabel",51107:{name:"ProfileHueSatMapEncoding",description:e=>({0:"Linear",1:"sRGB"}[e]||"Unknown")},51108:{name:"ProfileLookTableEncoding",description:e=>({0:"Linear",1:"sRGB"}[e]||"Unknown")},51109:"BaselineExposureOffset",51110:{name:"DefaultBlackRender",description:e=>({0:"Auto",1:"None"}[e]||"Unknown")},51111:"NewRawImageDigest",51112:"RawToPreviewGain"};function my(e){return new TextDecoder("utf-16").decode(new Uint8Array(e)).replace(/\u0000+$/,"")}var gy={33434:{name:"ExposureTime",description:py.ExposureTime},33437:{name:"FNumber",description:py.FNumber},34850:{name:"ExposureProgram",description:py.ExposureProgram},34852:"SpectralSensitivity",34855:"ISOSpeedRatings",34856:{name:"OECF",description:()=>"[Raw OECF table data]"},34858:"TimeZoneOffset",34859:"SelfTimerMode",34864:{name:"SensitivityType",description:e=>({1:"Standard Output Sensitivity",2:"Recommended Exposure Index",3:"ISO Speed",4:"Standard Output Sensitivity and Recommended Exposure Index",5:"Standard Output Sensitivity and ISO Speed",6:"Recommended Exposure Index and ISO Speed",7:"Standard Output Sensitivity, Recommended Exposure Index and ISO Speed"}[e]||"Unknown")},34865:"StandardOutputSensitivity",34866:"RecommendedExposureIndex",34867:"ISOSpeed",34868:"ISOSpeedLatitudeyyy",34869:"ISOSpeedLatitudezzz",36864:{name:"ExifVersion",description:e=>vm(e)},36867:"DateTimeOriginal",36868:"DateTimeDigitized",36873:"GooglePlusUploadCode",36880:"OffsetTime",36881:"OffsetTimeOriginal",36882:"OffsetTimeDigitized",37121:{name:"ComponentsConfiguration",description:py.ComponentsConfiguration},37122:"CompressedBitsPerPixel",37377:{name:"ShutterSpeedValue",description:py.ShutterSpeedValue},37378:{name:"ApertureValue",description:py.ApertureValue},37379:"BrightnessValue",37380:"ExposureBiasValue",37381:{name:"MaxApertureValue",description:e=>Math.pow(Math.sqrt(2),e[0]/e[1]).toFixed(2)},37382:{name:"SubjectDistance",description:e=>e[0]/e[1]+" m"},37383:{name:"MeteringMode",description:py.MeteringMode},37384:{name:"LightSource",description:py.LightSource},37385:{name:"Flash",description:e=>0===e?"Flash did not fire":1===e?"Flash fired":5===e?"Strobe return light not detected":7===e?"Strobe return light detected":9===e?"Flash fired, compulsory flash mode":13===e?"Flash fired, compulsory flash mode, return light not detected":15===e?"Flash fired, compulsory flash mode, return light detected":16===e?"Flash did not fire, compulsory flash mode":24===e?"Flash did not fire, auto mode":25===e?"Flash fired, auto mode":29===e?"Flash fired, auto mode, return light not detected":31===e?"Flash fired, auto mode, return light detected":32===e?"No flash function":65===e?"Flash fired, red-eye reduction mode":69===e?"Flash fired, red-eye reduction mode, return light not detected":71===e?"Flash fired, red-eye reduction mode, return light detected":73===e?"Flash fired, compulsory flash mode, red-eye reduction mode":77===e?"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected":79===e?"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected":89===e?"Flash fired, auto mode, red-eye reduction mode":93===e?"Flash fired, auto mode, return light not detected, red-eye reduction mode":95===e?"Flash fired, auto mode, return light detected, red-eye reduction mode":"Unknown"},37386:{name:"FocalLength",description:py.FocalLength},37393:"ImageNumber",37394:{name:"SecurityClassification",description:e=>({C:"Confidential",R:"Restricted",S:"Secret",T:"Top Secret",U:"Unclassified"}[e]||"Unknown")},37395:"ImageHistory",37396:{name:"SubjectArea",description:e=>2===e.length?`Location; X: ${e[0]}, Y: ${e[1]}`:3===e.length?`Circle; X: ${e[0]}, Y: ${e[1]}, diameter: ${e[2]}`:4===e.length?`Rectangle; X: ${e[0]}, Y: ${e[1]}, width: ${e[2]}, height: ${e[3]}`:"Unknown"},37500:{name:"MakerNote",description:()=>"[Raw maker note data]"},37510:{name:"UserComment",description:bm},37520:"SubSecTime",37521:"SubSecTimeOriginal",37522:"SubSecTimeDigitized",37724:"ImageSourceData",37888:{name:"AmbientTemperature",description:e=>e[0]/e[1]+" °C"},37889:{name:"Humidity",description:e=>e[0]/e[1]+" %"},37890:{name:"Pressure",description:e=>e[0]/e[1]+" hPa"},37891:{name:"WaterDepth",description:e=>e[0]/e[1]+" m"},37892:{name:"Acceleration",description:e=>e[0]/e[1]+" mGal"},37893:{name:"CameraElevationAngle",description:e=>e[0]/e[1]+" °"},40960:{name:"FlashpixVersion",description:e=>e.map((e=>String.fromCharCode(e))).join("")},40961:{name:"ColorSpace",description:py.ColorSpace},40962:"PixelXDimension",40963:"PixelYDimension",40964:"RelatedSoundFile",40965:"Interoperability IFD Pointer",41483:"FlashEnergy",41484:{name:"SpatialFrequencyResponse",description:()=>"[Raw SFR table data]"},41486:"FocalPlaneXResolution",41487:"FocalPlaneYResolution",41488:{name:"FocalPlaneResolutionUnit",description:py.FocalPlaneResolutionUnit},41492:{name:"SubjectLocation",description:([e,t])=>`X: ${e}, Y: ${t}`},41493:"ExposureIndex",41495:{name:"SensingMethod",description:e=>1===e?"Undefined":2===e?"One-chip color area sensor":3===e?"Two-chip color area sensor":4===e?"Three-chip color area sensor":5===e?"Color sequential area sensor":7===e?"Trilinear sensor":8===e?"Color sequential linear sensor":"Unknown"},41728:{name:"FileSource",description:e=>3===e?"DSC":"Unknown"},41729:{name:"SceneType",description:e=>1===e?"A directly photographed image":"Unknown"},41730:{name:"CFAPattern",description:()=>"[Raw CFA pattern table data]"},41985:{name:"CustomRendered",description:py.CustomRendered},41986:{name:"ExposureMode",description:py.ExposureMode},41987:{name:"WhiteBalance",description:py.WhiteBalance},41988:{name:"DigitalZoomRatio",description:e=>0===e[0]?"Digital zoom was not used":""+e[0]/e[1]},41989:{name:"FocalLengthIn35mmFilm",description:e=>0===e?"Unknown":e},41990:{name:"SceneCaptureType",description:py.SceneCaptureType},41991:{name:"GainControl",description:e=>0===e?"None":1===e?"Low gain up":2===e?"High gain up":3===e?"Low gain down":4===e?"High gain down":"Unknown"},41992:{name:"Contrast",description:py.Contrast},41993:{name:"Saturation",description:py.Saturation},41994:{name:"Sharpness",description:py.Sharpness},41995:{name:"DeviceSettingDescription",description:()=>"[Raw device settings table data]"},41996:{name:"SubjectDistanceRange",description:e=>1===e?"Macro":2===e?"Close view":3===e?"Distant view":"Unknown"},42016:"ImageUniqueID",42032:"CameraOwnerName",42033:"BodySerialNumber",42034:{name:"LensSpecification",description:e=>{const t=`${parseFloat((e[0][0]/e[0][1]).toFixed(5))}-${parseFloat((e[1][0]/e[1][1]).toFixed(5))} mm`;if(0===e[3][1])return`${t} f/?`;const n=1/(e[2][1]/e[2][1]/(e[3][0]/e[3][1]));return`${t} f/${parseFloat(n.toFixed(5))}`}},42035:"LensMake",42036:"LensModel",42037:"LensSerialNumber",42080:{name:"CompositeImage",description:e=>({1:"Not a Composite Image",2:"General Composite Image",3:"Composite Image Captured While Shooting"}[e]||"Unknown")},42081:"SourceImageNumberOfCompositeImage",42082:"SourceExposureTimesOfCompositeImage",42240:"Gamma",59932:"Padding",59933:"OffsetSchema",65e3:"OwnerName",65001:"SerialNumber",65002:"Lens",65100:"RawFile",65101:"Converter",65102:"WhiteBalance",65105:"Exposure",65106:"Shadows",65107:"Brightness",65108:"Contrast",65109:"Saturation",65110:"Sharpness",65111:"Smoothness",65112:"MoireFilter"},yy={0:{name:"GPSVersionID",description:e=>2===e[0]&&2===e[1]&&0===e[2]&&0===e[3]?"Version 2.2":"Unknown"},1:{name:"GPSLatitudeRef",description:e=>{const t=e.join("");return"N"===t?"North latitude":"S"===t?"South latitude":"Unknown"}},2:{name:"GPSLatitude",description:Em},3:{name:"GPSLongitudeRef",description:e=>{const t=e.join("");return"E"===t?"East longitude":"W"===t?"West longitude":"Unknown"}},4:{name:"GPSLongitude",description:Em},5:{name:"GPSAltitudeRef",description:e=>0===e?"Sea level":1===e?"Sea level reference (negative value)":"Unknown"},6:{name:"GPSAltitude",description:e=>e[0]/e[1]+" m"},7:{name:"GPSTimeStamp",description:e=>e.map((([e,t])=>{const n=e/t;return/^\d(\.|$)/.test(`${n}`)?`0${n}`:n})).join(":")},8:"GPSSatellites",9:{name:"GPSStatus",description:e=>{const t=e.join("");return"A"===t?"Measurement in progress":"V"===t?"Measurement Interoperability":"Unknown"}},10:{name:"GPSMeasureMode",description:e=>{const t=e.join("");return"2"===t?"2-dimensional measurement":"3"===t?"3-dimensional measurement":"Unknown"}},11:"GPSDOP",12:{name:"GPSSpeedRef",description:e=>{const t=e.join("");return"K"===t?"Kilometers per hour":"M"===t?"Miles per hour":"N"===t?"Knots":"Unknown"}},13:"GPSSpeed",14:{name:"GPSTrackRef",description:e=>{const t=e.join("");return"T"===t?"True direction":"M"===t?"Magnetic direction":"Unknown"}},15:"GPSTrack",16:{name:"GPSImgDirectionRef",description:e=>{const t=e.join("");return"T"===t?"True direction":"M"===t?"Magnetic direction":"Unknown"}},17:"GPSImgDirection",18:"GPSMapDatum",19:{name:"GPSDestLatitudeRef",description:e=>{const t=e.join("");return"N"===t?"North latitude":"S"===t?"South latitude":"Unknown"}},20:{name:"GPSDestLatitude",description:e=>e[0][0]/e[0][1]+e[1][0]/e[1][1]/60+e[2][0]/e[2][1]/3600},21:{name:"GPSDestLongitudeRef",description:e=>{const t=e.join("");return"E"===t?"East longitude":"W"===t?"West longitude":"Unknown"}},22:{name:"GPSDestLongitude",description:e=>e[0][0]/e[0][1]+e[1][0]/e[1][1]/60+e[2][0]/e[2][1]/3600},23:{name:"GPSDestBearingRef",description:e=>{const t=e.join("");return"T"===t?"True direction":"M"===t?"Magnetic direction":"Unknown"}},24:"GPSDestBearing",25:{name:"GPSDestDistanceRef",description:e=>{const t=e.join("");return"K"===t?"Kilometers":"M"===t?"Miles":"N"===t?"Knots":"Unknown"}},26:"GPSDestDistance",27:{name:"GPSProcessingMethod",description:bm},28:{name:"GPSAreaInformation",description:bm},29:"GPSDateStamp",30:{name:"GPSDifferential",description:e=>0===e?"Measurement without differential correction":1===e?"Differential correction applied":"Unknown"},31:"GPSHPositioningError"},_y={1:"InteroperabilityIndex",2:{name:"InteroperabilityVersion",description:e=>vm(e)},4096:"RelatedImageFileFormat",4097:"RelatedImageWidth",4098:"RelatedImageHeight"},vy={45056:{name:"MPFVersion",description:e=>vm(e)},45057:"NumberOfImages",45058:"MPEntry",45059:"ImageUIDList",45060:"TotalFrames"};const by=dm({},hy,gy),Ey="0th",Sy="1st",Ay="exif",xy="gps",wy="interoperability",Ty="mpf",My="canon";var Oy={[Ey]:by,[Sy]:hy,[Ay]:by,[xy]:yy,[wy]:_y,[Ty]:vy,[My]:{4:{name:"ShotInfo",description:e=>e}}};const Cy={1:1,2:1,3:2,4:4,5:8,7:1,9:4,10:8,13:4},Ny={BYTE:1,ASCII:2,SHORT:3,LONG:4,RATIONAL:5,UNDEFINED:7,SLONG:9,SRATIONAL:10,IFD:13};var Dy={getAsciiValue:function(e){return e.map((e=>String.fromCharCode(e)))},getByteAt:Ly,getAsciiAt:function(e,t){return e.getUint8(t)},getShortAt:function(e,t,n){return e.getUint16(t,n===xm.LITTLE_ENDIAN)},getLongAt:Iy,getRationalAt:function(e,t,n){return[Iy(e,t,n),Iy(e,t+4,n)]},getUndefinedAt:function(e,t){return Ly(e,t)},getSlongAt:ky,getSrationalAt:function(e,t,n){return[ky(e,t,n),ky(e,t+4,n)]},getIfdPointerAt:function(e,t,n){return Iy(e,t,n)},typeSizes:Cy,tagTypes:Ny,getTypeSize:function(e){if(void 0===Ny[e])throw new Error("No such type found.");return Cy[Ny[e]]}};function Ly(e,t){return e.getUint8(t)}function Iy(e,t,n){return e.getUint32(t,n===xm.LITTLE_ENDIAN)}function ky(e,t,n){return e.getInt32(t,n===xm.LITTLE_ENDIAN)}const $y={1:Dy.getByteAt,2:Dy.getAsciiAt,3:Dy.getShortAt,4:Dy.getLongAt,5:Dy.getRationalAt,7:Dy.getUndefinedAt,9:Dy.getSlongAt,10:Dy.getSrationalAt,13:Dy.getIfdPointerAt};function Ry(e,t,n){return t+Dy.getLongAt(e,t+4,n)}function Fy(e,t,n,r,i,a){const o=Dy.getTypeSize("SHORT"),s={},u=function(e,t,n){if(t+Dy.getTypeSize("SHORT")<=e.byteLength)return Dy.getShortAt(e,t,n);return 0}(e,r,i);r+=o;for(let o=0;o<u&&!(r+12>e.byteLength);o++){const o=zy(e,t,n,r,i,a);void 0!==o&&(s[o.name]={id:o.id,value:o.value,description:o.description},"MakerNote"===o.name&&(s[o.name].__offset=o.__offset)),r+=12}if(r<e.byteLength-Dy.getTypeSize("LONG")){const o=Dy.getLongAt(e,r,i);0!==o&&t===Ey&&(s.Thumbnail=Fy(e,"1st",n,n+o,i,a))}return s}function zy(e,t,n,r,i,a){const o=Dy.getTypeSize("SHORT"),s=o+Dy.getTypeSize("SHORT"),u=s+Dy.getTypeSize("LONG"),c=Dy.getShortAt(e,r,i),l=Dy.getShortAt(e,r+o,i),d=Dy.getLongAt(e,r+s,i);let f,p;if(void 0===Dy.typeSizes[l]||!a&&void 0===Oy[t][c])return;if(function(e,t){return Dy.typeSizes[e]*t<=Dy.getTypeSize("LONG")}(l,d))p=r+u,f=Py(e,p,l,d,i);else if(p=Dy.getLongAt(e,r+u,i),function(e,t,n,r,i){return t+n+Dy.typeSizes[r]*i<=e.byteLength}(e,n,p,l,d)){f=Py(e,n+p,l,d,i,33723===c)}else f="<faulty value>";l===Dy.tagTypes.ASCII&&(f=function(e){const t=[];let n=0;for(let r=0;r<e.length;r++)"\0"!==e[r]?(void 0===t[n]&&(t[n]=""),t[n]+=e[r]):n++;return t}(f),f=function(e){try{return e.map((e=>decodeURIComponent(escape(e))))}catch(t){return e}}(f));let h=`undefined-${c}`,m=f;if(void 0!==Oy[t][c])if(void 0!==Oy[t][c].name&&void 0!==Oy[t][c].description){h=Oy[t][c].name;try{m=Oy[t][c].description(f)}catch(e){m=jy(f)}}else l===Dy.tagTypes.RATIONAL||l===Dy.tagTypes.SRATIONAL?(h=Oy[t][c],m=""+f[0]/f[1]):(h=Oy[t][c],m=jy(f));return{id:c,name:h,value:f,description:m,__offset:p}}function Py(e,t,n,r,i,a=!1){let o=[];a&&(r*=Dy.typeSizes[n],n=Dy.tagTypes.BYTE);for(let a=0;a<r;a++)o.push($y[n](e,t,i)),t+=Dy.typeSizes[n];return n===Dy.tagTypes.ASCII?o=Dy.getAsciiValue(o):1===o.length&&(o=o[0]),o}function jy(e){return e instanceof Array?e.join(", "):e}const Zy="Exif IFD Pointer",Uy="GPS Info IFD Pointer",By="Interoperability IFD Pointer";var Vy={read:function(e,t,n){const r=xm.getByteOrder(e,t);let i=function(e,t,n,r){return Fy(e,Ey,t,Ry(e,t,n),n,r)}(e,t,r,n);return i=Hy(i,e,t,r,n),i=Gy(i,e,t,r,n),i=Yy(i,e,t,r,n),{tags:i,byteOrder:r}}};function Hy(e,t,n,r,i){return void 0!==e[Zy]?dm(e,Fy(t,Ay,n,n+e[Zy].value,r,i)):e}function Gy(e,t,n,r,i){return void 0!==e[Uy]?dm(e,Fy(t,"gps",n,n+e[Uy].value,r,i)):e}function Yy(e,t,n,r,i){return void 0!==e[By]?dm(e,Fy(t,wy,n,n+e[By].value,r,i)):e}var Wy={read:function(e,t,n){const r=xm.getByteOrder(e,t),i=Fy(e,"mpf",t,Ry(e,t,r),r,n);return function(e,t,n,r){if(!n.MPEntry)return n;const i=[];for(let a=0;a<Math.ceil(n.MPEntry.value.length/qy);a++){i[a]={};const o=Ky(n.MPEntry.value,a*qy,Dy.getTypeSize("LONG"),r);i[a].ImageFlags=Jy(o),i[a].ImageFormat=Xy(o),i[a].ImageType=Qy(o);const s=Ky(n.MPEntry.value,a*qy+4,Dy.getTypeSize("LONG"),r);i[a].ImageSize={value:s,description:""+s};const u=e_(a,n.MPEntry,r,t);i[a].ImageOffset={value:u,description:""+u};const c=Ky(n.MPEntry.value,a*qy+12,Dy.getTypeSize("SHORT"),r);i[a].DependentImage1EntryNumber={value:c,description:""+c};const l=Ky(n.MPEntry.value,a*qy+14,Dy.getTypeSize("SHORT"),r);i[a].DependentImage2EntryNumber={value:l,description:""+l},i[a].image=e.buffer.slice(u,u+s),fm(i[a],"base64",(function(){return pm(this.image)}))}return n.Images=i,n}(e,t,i,r)}};const qy=16;function Ky(e,t,n,r){if(r===xm.LITTLE_ENDIAN){let r=0;for(let i=0;i<n;i++)r+=e[t+i]<<8*i;return r}let i=0;for(let r=0;r<n;r++)i+=e[t+r]<<8*(n-1-r);return i}function Jy(e){const t=[e>>31&1,e>>30&1,e>>29&1],n=[];return t[0]&&n.push("Dependent Parent Image"),t[1]&&n.push("Dependent Child Image"),t[2]&&n.push("Representative Image"),{value:t,description:n.join(", ")||"None"}}function Xy(e){const t=e>>24&7;return{value:t,description:0===t?"JPEG":"Unknown"}}function Qy(e){const t=16777215&e;return{value:t,description:{196608:"Baseline MP Primary Image",65537:"Large Thumbnail (VGA equivalent)",65538:"Large Thumbnail (Full HD equivalent)",131073:"Multi-Frame Image (Panorama)",131074:"Multi-Frame Image (Disparity)",131075:"Multi-Frame Image (Multi-Angle)",0:"Undefined"}[t]||"Unknown"}}function e_(e,t,n,r){return function(e){return 0===e}(e)?0:Ky(t.value,e*qy+8,Dy.getTypeSize("LONG"),n)+r}var t_={read:function(e,t){const n=function(e,t){return Dy.getShortAt(e,t)}(e,t),r=function(e,t,n){const r=7;if(r+1>n)return;const i=Dy.getByteAt(e,t+r);return{value:i,description:""+i}}(e,t,n);return{"Bits Per Sample":n_(e,t,n),"Image Height":r_(e,t,n),"Image Width":i_(e,t,n),"Color Components":r,Subsampling:r&&a_(e,t,r.value,n)}}};function n_(e,t,n){if(3>n)return;const r=Dy.getByteAt(e,t+2);return{value:r,description:""+r}}function r_(e,t,n){if(5>n)return;const r=Dy.getShortAt(e,t+3);return{value:r,description:`${r}px`}}function i_(e,t,n){if(7>n)return;const r=Dy.getShortAt(e,t+5);return{value:r,description:`${r}px`}}function a_(e,t,n,r){if(8+3*n>r)return;const i=[];for(let r=0;r<n;r++){const n=t+8+3*r;i.push([Dy.getByteAt(e,n),Dy.getByteAt(e,n+1),Dy.getByteAt(e,n+2)])}return{value:i,description:i.length>1?o_(i)+s_(i):""}}function o_(e){const t={1:"Y",2:"Cb",3:"Cr",4:"I",5:"Q"};return e.map((e=>t[e[0]])).join("")}function s_(e){const t={17:"4:4:4 (1 1)",18:"4:4:0 (1 2)",20:"4:4:1 (1 4)",33:"4:2:2 (2 1)",34:"4:2:0 (2 2)",36:"4:2:1 (2 4)",65:"4:1:1 (4 1)",66:"4:1:0 (4 2)"};return 0===e.length||void 0===e[0][1]||void 0===t[e[0][1]]?"":t[e[0][1]]}var u_={read:function(e,t){const n=function(e,t){return Dy.getShortAt(e,t)}(e,t),r=function(e,t,n){const r=14;if(r+1>n)return;const i=Dy.getByteAt(e,t+r);return{value:i,description:`${i}px`}}(e,t,n),i=function(e,t,n){const r=15;if(r+1>n)return;const i=Dy.getByteAt(e,t+r);return{value:i,description:`${i}px`}}(e,t,n),a={"JFIF Version":c_(e,t,n),"Resolution Unit":l_(e,t,n),XResolution:f_(e,t,n),YResolution:p_(e,t,n),"JFIF Thumbnail Width":r,"JFIF Thumbnail Height":i};if(void 0!==r&&void 0!==i){const o=function(e,t,n,r){const i=16;if(0===n||i+n>r)return;const a=e.buffer.slice(t+i,t+i+n);return{value:a,description:"<24-bit RGB pixel data>"}}(e,t,3*r.value*i.value,n);o&&(a["JFIF Thumbnail"]=o)}for(const e in a)void 0===a[e]&&delete a[e];return a}};function c_(e,t,n){if(9>n)return;const r=Dy.getByteAt(e,t+7),i=Dy.getByteAt(e,t+7+1);return{value:256*r+i,description:r+"."+i}}function l_(e,t,n){if(10>n)return;const r=Dy.getByteAt(e,t+9);return{value:r,description:d_(r)}}function d_(e){return 0===e?"None":1===e?"inches":2===e?"cm":"Unknown"}function f_(e,t,n){if(12>n)return;const r=Dy.getShortAt(e,t+10);return{value:r,description:""+r}}function p_(e,t,n){if(14>n)return;const r=Dy.getShortAt(e,t+12);return{value:r,description:""+r}}var h_={iptc:{256:{name:"Model Version",description:e=>((e[0]<<8)+e[1]).toString()},261:{name:"Destination",repeatable:!0},276:{name:"File Format",description:e=>((e[0]<<8)+e[1]).toString()},278:{name:"File Format Version",description:e=>((e[0]<<8)+e[1]).toString()},286:"Service Identifier",296:"Envelope Number",306:"Product ID",316:"Envelope Priority",326:{name:"Date Sent",description:m_},336:{name:"Time Sent",description:g_},346:{name:"Coded Character Set",description:y_,encoding_name:y_},356:"UNO",376:{name:"ARM Identifier",description:e=>((e[0]<<8)+e[1]).toString()},378:{name:"ARM Version",description:e=>((e[0]<<8)+e[1]).toString()},512:{name:"Record Version",description:e=>((e[0]<<8)+e[1]).toString()},515:"Object Type Reference",516:"Object Attribute Reference",517:"Object Name",519:"Edit Status",520:{name:"Editorial Update",description:e=>"01"===vm(e)?"Additional Language":"Unknown"},522:"Urgency",524:{name:"Subject Reference",repeatable:!0,description:e=>{const t=vm(e).split(":");return t[2]+(t[3]?"/"+t[3]:"")+(t[4]?"/"+t[4]:"")}},527:"Category",532:{name:"Supplemental Category",repeatable:!0},534:"Fixture Identifier",537:{name:"Keywords",repeatable:!0},538:{name:"Content Location Code",repeatable:!0},539:{name:"Content Location Name",repeatable:!0},542:"Release Date",547:"Release Time",549:"Expiration Date",550:"Expiration Time",552:"Special Instructions",554:{name:"Action Advised",description:e=>{const t=vm(e);return"01"===t?"Object Kill":"02"===t?"Object Replace":"03"===t?"Object Append":"04"===t?"Object Reference":"Unknown"}},557:{name:"Reference Service",repeatable:!0},559:{name:"Reference Date",repeatable:!0},562:{name:"Reference Number",repeatable:!0},567:{name:"Date Created",description:m_},572:{name:"Time Created",description:g_},574:{name:"Digital Creation Date",description:m_},575:{name:"Digital Creation Time",description:g_},577:"Originating Program",582:"Program Version",587:{name:"Object Cycle",description:e=>{const t=vm(e);return"a"===t?"morning":"p"===t?"evening":"b"===t?"both":"Unknown"}},592:{name:"By-line",repeatable:!0},597:{name:"By-line Title",repeatable:!0},602:"City",604:"Sub-location",607:"Province/State",612:"Country/Primary Location Code",613:"Country/Primary Location Name",615:"Original Transmission Reference",617:"Headline",622:"Credit",627:"Source",628:"Copyright Notice",630:{name:"Contact",repeatable:!0},632:"Caption/Abstract",634:{name:"Writer/Editor",repeatable:!0},637:{name:"Rasterized Caption",description:e=>e},642:"Image Type",643:{name:"Image Orientation",description:e=>{const t=vm(e);return"P"===t?"Portrait":"L"===t?"Landscape":"S"===t?"Square":"Unknown"}},647:"Language Identifier",662:{name:"Audio Type",description:e=>{const t=vm(e),n=t.charAt(0),r=t.charAt(1);let i="";return"1"===n?i+="Mono":"2"===n&&(i+="Stereo"),"A"===r?i+=", actuality":"C"===r?i+=", question and answer session":"M"===r?i+=", music, transmitted by itself":"Q"===r?i+=", response to a question":"R"===r?i+=", raw sound":"S"===r?i+=", scener":"V"===r?i+=", voicer":"W"===r&&(i+=", wrap"),""!==i?i:t}},663:{name:"Audio Sampling Rate",description:e=>parseInt(vm(e),10)+" Hz"},664:{name:"Audio Sampling Resolution",description:e=>{const t=parseInt(vm(e),10);return t+(1===t?" bit":" bits")}},665:{name:"Audio Duration",description:e=>{const t=vm(e);return t.length>=6?t.substr(0,2)+":"+t.substr(2,2)+":"+t.substr(4,2):t}},666:"Audio Outcue",698:"Short Document ID",699:"Unique Document ID",700:"Owner ID",712:{name:e=>2===e.length?"ObjectData Preview File Format":"Record 2 destination",description:e=>{if(2===e.length){const t=(e[0]<<8)+e[1];return 0===t?"No ObjectData":1===t?"IPTC-NAA Digital Newsphoto Parameter Record":2===t?"IPTC7901 Recommended Message Format":3===t?"Tagged Image File Format (Adobe/Aldus Image data)":4===t?"Illustrator (Adobe Graphics data)":5===t?"AppleSingle (Apple Computer Inc)":6===t?"NAA 89-3 (ANPA 1312)":7===t?"MacBinary II":8===t?"IPTC Unstructured Character Oriented File Format (UCOFF)":9===t?"United Press International ANPA 1312 variant":10===t?"United Press International Down-Load Message":11===t?"JPEG File Interchange (JFIF)":12===t?"Photo-CD Image-Pac (Eastman Kodak)":13===t?"Microsoft Bit Mapped Graphics File [*.BMP]":14===t?"Digital Audio File [*.WAV] (Microsoft & Creative Labs)":15===t?"Audio plus Moving Video [*.AVI] (Microsoft)":16===t?"PC DOS/Windows Executable Files [*.COM][*.EXE]":17===t?"Compressed Binary File [*.ZIP] (PKWare Inc)":18===t?"Audio Interchange File Format AIFF (Apple Computer Inc)":19===t?"RIFF Wave (Microsoft Corporation)":20===t?"Freehand (Macromedia/Aldus)":21===t?'Hypertext Markup Language "HTML" (The Internet Society)':22===t?"MPEG 2 Audio Layer 2 (Musicom), ISO/IEC":23===t?"MPEG 2 Audio Layer 3, ISO/IEC":24===t?"Portable Document File (*.PDF) Adobe":25===t?"News Industry Text Format (NITF)":26===t?"Tape Archive (*.TAR)":27===t?"Tidningarnas Telegrambyrå NITF version (TTNITF DTD)":28===t?"Ritzaus Bureau NITF version (RBNITF DTD)":29===t?"Corel Draw [*.CDR]":`Unknown format ${t}`}return vm(e)}},713:{name:"ObjectData Preview File Format Version",description:(e,t)=>{const n={"00":{"00":"1"},"01":{"01":"1","02":"2","03":"3","04":"4"},"02":{"04":"4"},"03":{"01":"5.0","02":"6.0"},"04":{"01":"1.40"},"05":{"01":"2"},"06":{"01":"1"},11:{"01":"1.02"},20:{"01":"3.1","02":"4.0","03":"5.0","04":"5.5"},21:{"02":"2.0"}},r=vm(e);if(t["ObjectData Preview File Format"]){const e=vm(t["ObjectData Preview File Format"].value);if(n[e]&&n[e][r])return n[e][r]}return r}},714:"ObjectData Preview Data",1802:{name:"Size Mode",description:e=>e[0].toString()},1812:{name:"Max Subfile Size",description:e=>{let t=0;for(let n=0;n<e.length;n++)t=(t<<8)+e[n];return t.toString()}},1882:{name:"ObjectData Size Announced",description:e=>{let t=0;for(let n=0;n<e.length;n++)t=(t<<8)+e[n];return t.toString()}},1887:{name:"Maximum ObjectData Size",description:e=>{let t=0;for(let n=0;n<e.length;n++)t=(t<<8)+e[n];return t.toString()}}}};function m_(e){const t=vm(e);return t.length>=8?t.substr(0,4)+"-"+t.substr(4,2)+"-"+t.substr(6,2):t}function g_(e){const t=vm(e);let n=t;return t.length>=6&&(n=t.substr(0,2)+":"+t.substr(2,2)+":"+t.substr(4,2),11===t.length&&(n+=t.substr(6,1)+t.substr(7,2)+":"+t.substr(9,2))),n}function y_(e){const t=vm(e);return"%G"===t?"UTF-8":"%5"===t?"Windows-1252":"%/G"===t?"UTF-8 Level 1":"%/H"===t?"UTF-8 Level 2":"%/I"===t?"UTF-8 Level 3":"/A"===t?"ISO-8859-1":"/B"===t?"ISO-8859-2":"/C"===t?"ISO-8859-3":"/D"===t?"ISO-8859-4":"/@"===t?"ISO-8859-5":"/G"===t?"ISO-8859-6":"/F"===t?"ISO-8859-7":"/H"===t?"ISO-8859-8":"Unknown"}var __={get:function(){if("undefined"!=typeof TextDecoder)return TextDecoder;return}};var v_={decode:function(e,t){const n=__.get();if(void 0!==n&&void 0!==e)try{return new n(e).decode(t instanceof DataView?t.buffer:Uint8Array.from(t))}catch(e){}return function(e){try{return decodeURIComponent(escape(e))}catch(t){return e}}(t.map((e=>String.fromCharCode(e))).join(""))},TAG_HEADER_SIZE:5};var b_={read:function(e,t,n){try{if(Array.isArray(e))return x_(new DataView(Uint8Array.from(e).buffer),{size:e.length},0,n);const{naaBlock:r,dataOffset:i}=function(e,t){for(;t+12<=e.byteLength;){const n=E_(e,t);if(S_(n))return{naaBlock:n,dataOffset:t+n.headerSize};t+=n.headerSize+n.size+A_(n)}throw new Error("No IPTC NAA resource block.")}(e,t);return x_(e,r,i,n)}catch(e){return{}}}};function E_(e,t){if(943868237!==e.getUint32(t,!1))throw new Error("Not an IPTC resource block.");const n=e.getUint8(t+4+2),r=(n%2==0?n+1:n)+1;return{headerSize:6+r+4,type:e.getUint16(t+4),size:e.getUint32(t+4+2+r)}}function S_(e){return 1028===e.type}function A_(e){return e.size%2!=0?1:0}function x_(e,t,n,r){const i={};let a;const o=n+t.size;for(;n<o&&n<e.byteLength;){const{tag:t,tagSize:o}=w_(e,n,i,a,r);if(null===t)break;t&&("encoding"in t&&(a=t.encoding),void 0===i[t.name]||void 0===t.repeatable?i[t.name]={id:t.id,value:t.value,description:t.description}:(i[t.name]instanceof Array||(i[t.name]=[{id:i[t.name].id,value:i[t.name].value,description:i[t.name].description}]),i[t.name].push({id:t.id,value:t.value,description:t.description}))),n+=5+o}return i}function w_(e,t,n,r,i){if(function(e,t){const n=28;return e.getUint8(t)!==n}(e,t))return{tag:null,tagSize:0};const a=e.getUint16(t+1),o=e.getUint16(t+3);if(!i&&!h_.iptc[a])return{tag:void 0,tagSize:o};const s=function(e,t,n){const r=[];for(let i=0;i<n;i++)r.push(e.getUint8(t+i));return r}(e,t+5,o),u={id:a,name:T_(h_.iptc[a],a,s),value:s,description:M_(h_.iptc[a],s,n,r)};return function(e){return h_.iptc[e]&&h_.iptc[e].repeatable}(a)&&(u.repeatable=!0),function(e){return h_.iptc[e]&&void 0!==h_.iptc[e].encoding_name}(a)&&(u.encoding=h_.iptc[a].encoding_name(s)),{tag:u,tagSize:o}}function T_(e,t,n){return e?function(e){return"string"==typeof e}(e)?e:function(e){return"function"==typeof e.name}(e)?e.name(n):e.name:`undefined-${t}`}function M_(e,t,n,r){if(function(e){return e&&void 0!==e.description}(e))try{return e.description(t,n)}catch(e){}return function(e,t){return e&&t instanceof Array}(e,t)?v_.decode(r,t):t}var O_={"tiff:Orientation":e=>"1"===e?"Horizontal (normal)":"2"===e?"Mirror horizontal":"3"===e?"Rotate 180":"4"===e?"Mirror vertical":"5"===e?"Mirror horizontal and rotate 270 CW":"6"===e?"Rotate 90 CW":"7"===e?"Mirror horizontal and rotate 90 CW":"8"===e?"Rotate 270 CW":e,"tiff:ResolutionUnit":e=>py.ResolutionUnit(parseInt(e,10)),"tiff:XResolution":e=>C_(py.XResolution,e),"tiff:YResolution":e=>C_(py.YResolution,e),"exif:ApertureValue":e=>C_(py.ApertureValue,e),"exif:GPSLatitude":D_,"exif:GPSLongitude":D_,"exif:FNumber":e=>C_(py.FNumber,e),"exif:FocalLength":e=>C_(py.FocalLength,e),"exif:FocalPlaneResolutionUnit":e=>py.FocalPlaneResolutionUnit(parseInt(e,10)),"exif:ColorSpace":e=>py.ColorSpace(function(e){if("0x"===e.substring(0,2))return parseInt(e.substring(2),16);return parseInt(e,10)}(e)),"exif:ComponentsConfiguration"(e,t){if(/^\d, \d, \d, \d$/.test(t)){const e=t.split(", ").map((e=>e.charCodeAt(0)));return py.ComponentsConfiguration(e)}return t},"exif:Contrast":e=>py.Contrast(parseInt(e,10)),"exif:CustomRendered":e=>py.CustomRendered(parseInt(e,10)),"exif:ExposureMode":e=>py.ExposureMode(parseInt(e,10)),"exif:ExposureProgram":e=>py.ExposureProgram(parseInt(e,10)),"exif:ExposureTime":e=>N_(e)?py.ExposureTime(e.split("/").map((e=>parseInt(e,10)))):e,"exif:MeteringMode":e=>py.MeteringMode(parseInt(e,10)),"exif:Saturation":e=>py.Saturation(parseInt(e,10)),"exif:SceneCaptureType":e=>py.SceneCaptureType(parseInt(e,10)),"exif:Sharpness":e=>py.Sharpness(parseInt(e,10)),"exif:ShutterSpeedValue":e=>C_(py.ShutterSpeedValue,e),"exif:WhiteBalance":e=>py.WhiteBalance(parseInt(e,10))};function C_(e,t){return N_(t)?e(t.split("/")):t}function N_(e){return/^-?\d+\/-?\d+$/.test(e)}function D_(e){const[t,n]=e.split(",");if(void 0!==t&&void 0!==n){const e=parseFloat(t),r=parseFloat(n),i=n.charAt(n.length-1);if(!Number.isNaN(e)&&!Number.isNaN(r))return""+(e+r/60)+i}return e}var L_={get:function(e){if(e)return e;if("undefined"!=typeof DOMParser)return new DOMParser;try{const{DOMParser:e,onErrorStopParsing:t}=__non_webpack_require__("@xmldom/xmldom");return new e({onError:t})}catch(e){return}}};function I_(e){const t=e.match(/<([A-Za-z_][A-Za-z0-9._-]*)([^>]*)>/);if(!t)return e;const n=t[1],r=function(e){const t=[],n=/xmlns:([\w-]+)=["'][^"']+["']/g;let r;for(;null!==(r=n.exec(e));)-1===t.indexOf(r[1])&&t.push(r[1]);return t}(e),i=function(e){const t=[],n=/\b([A-Za-z_][A-Za-z0-9._-]*):[A-Za-z_][A-Za-z0-9._-]*\b/g;let r;for(;null!==(r=n.exec(e));){const e=r[1];"xmlns"!==e&&"xml"!==e&&(-1===t.indexOf(e)&&t.push(e))}return t}(e),a=i.filter((e=>-1===r.indexOf(e)));if(0===a.length)return e;const o=function(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n],i=k_[r]||"http://fallback.namespace/"+r;t.push(" xmlns:"+r+'="'+i+'"')}return t.join("")}(a);return function(e,t,n){const r=new RegExp("<"+t+"([^>]*)>");return e.replace(r,"<"+t+"$1"+n+">")}(e,n,o)}const k_={xmp:"http://ns.adobe.com/xap/1.0/",tiff:"http://ns.adobe.com/tiff/1.0/",exif:"http://ns.adobe.com/exif/1.0/",dc:"http://purl.org/dc/elements/1.1/",xmpMM:"http://ns.adobe.com/xap/1.0/mm/",stEvt:"http://ns.adobe.com/xap/1.0/sType/ResourceEvent#",stRef:"http://ns.adobe.com/xap/1.0/sType/ResourceRef#",photoshop:"http://ns.adobe.com/photoshop/1.0/"};var $_={read:function(e,t,n){const r={};if("string"==typeof e)return z_(r,e,n),r;const[i,a]=function(e,t){if(0===t.length)return[];const n=[F_(e,t.slice(0,1))];t.length>1&&n.push(F_(e,t.slice(1)));return n}(e,t),o=z_(r,i,n);if(a){const i=z_(r,a,n);o||i||(delete r._raw,z_(r,F_(e,t),n))}return r}};class R_ extends Error{constructor(e){super(e),this.name="ParseError"}}function F_(e,t){const n=t.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(n);let i=0;for(let n=0;n<t.length;n++){const a=t[n],o=e.buffer.slice(a.dataOffset,a.dataOffset+a.length);r.set(new Uint8Array(o),i),i+=a.length}return new DataView(r.buffer)}function z_(e,t,n){try{const{doc:r,raw:i}=function(e,t){const n=L_.get(t);if(!n)throw console.warn("Warning: DOMParser is not available. It is needed to be able to parse XMP tags."),new Error;const r="string"==typeof e?e:om(e,0,e.byteLength),i=P_(n,(a=r,a.replace(/^.+(<\?xpacket begin)/,"$1").replace(/(<\?xpacket end=".*"\?>).+$/,"$1")));var a;return{doc:i,raw:r}}(t,n);e._raw=(e._raw||"")+i;return dm(e,B_(Z_(j_(r),!0))),!0}catch(e){return!1}}function P_(e,t,n=!1){try{const n=e.parseFromString(t,"application/xml"),r=n.getElementsByTagName("parsererror");if(r.length>0)throw new R_(r[0].textContent);return n}catch(r){if("ParseError"===r.name&&function(e){const t=["prefix is non-null and namespace is null","prefix not bound to a namespace","prefix inte bundet till en namnrymd",/Namespace prefix .+ is not defined/];for(let n=0;n<t.length;n++)if(new RegExp(t[n]).test(e.message))return!0;return!1}(r)&&!n)return P_(e,I_(t),!0);throw r}}function j_(e){for(let t=0;t<e.childNodes.length;t++){if("x:xmpmeta"===e.childNodes[t].tagName)return j_(e.childNodes[t]);if("rdf:RDF"===e.childNodes[t].tagName)return e.childNodes[t]}throw new Error}function Z_(e,t=!1){const n=function(e){const t=[];for(let n=0;n<e.childNodes.length;n++)t.push(e.childNodes[n]);return t}(e);return 1===(r=n).length&&"#text"===r[0].nodeName?t?{}:function(e){return e.nodeValue}(n[0]):function(e){const t={};return e.forEach((e=>{if(function(e){return e.nodeName&&"#text"!==e.nodeName}(e)){const n=function(e){return{attributes:U_(e),value:Z_(e)}}(e);void 0!==t[e.nodeName]?(Array.isArray(t[e.nodeName])||(t[e.nodeName]=[t[e.nodeName]]),t[e.nodeName].push(n)):t[e.nodeName]=n}})),t}(n);var r}function U_(e){const t={};for(let n=0;n<e.attributes.length;n++)t[e.attributes[n].nodeName]=decodeURIComponent(escape(e.attributes[n].value));return t}function B_(e){const t={};if("string"==typeof e)return e;for(const n in e){let r=e[n];Array.isArray(r)||(r=[r]),r.forEach((e=>{dm(t,V_(e.attributes)),"object"==typeof e.value&&dm(t,K_(e.value))}))}return t}function V_(e){const t={};for(const n in e)try{H_(n)&&(t[Y_(n)]={value:e[n],attributes:{},description:W_(e[n],n)})}catch(e){}return t}function H_(e){return"rdf:parseType"!==e&&!G_(e)}function G_(e){return"xmlns"===e.split(":")[0]}function Y_(e){return/^MicrosoftPhoto(_\d+_)?:Rating$/i.test(e)?"RatingPercent":e.split(":")[1]}function W_(e,t=void 0){if(Array.isArray(e)){const n=function(e){return e.map((e=>void 0!==e.value?W_(e.value):W_(e))).join(", ")}(e);return t&&"function"==typeof O_[t]?O_[t](e,n):n}if("object"==typeof e)return function(e){const t=[];for(const n in e)t.push(`${q_(n)}: ${W_(e[n].value)}`);return t.join("; ")}(e);try{return t&&"function"==typeof O_[t]?O_[t](e):decodeURIComponent(escape(e))}catch(t){return e}}function q_(e){return"CiAdrCity"===e?"CreatorCity":"CiAdrCtry"===e?"CreatorCountry":"CiAdrExtadr"===e?"CreatorAddress":"CiAdrPcode"===e?"CreatorPostalCode":"CiAdrRegion"===e?"CreatorRegion":"CiEmailWork"===e?"CreatorWorkEmail":"CiTelWork"===e?"CreatorWorkPhone":"CiUrlWork"===e?"CreatorWorkUrl":e}function K_(e){const t={};for(const n in e)try{G_(n)||(t[Y_(n)]=J_(e[n],n))}catch(e){}return t}function J_(e,t){return function(e){return Array.isArray(e)}(e)?function(e,t){return ov(e[e.length-1],t)}(e,t):function(e){return"Resource"===e.attributes["rdf:parseType"]&&"string"==typeof e.value&&""===e.value.trim()}(e)?{value:"",attributes:{},description:""}:X_(e)?Q_(e,t):tv(e)?nv(e,t):rv(e)?iv(e,t):function(e){return void 0!==av(e.value)}(e)?function(e,t){let n=av(e.value).value["rdf:li"];const r=ev(e),i=[];void 0===n?n=[]:Array.isArray(n)||(n=[n]);return n.forEach((e=>{i.push(function(e){if(X_(e))return Q_(e);if(tv(e))return nv(e).value;if(rv(e))return iv(e).value;return ov(e)}(e))})),{value:i,attributes:r,description:W_(i,t)}}(e,t):ov(e,t)}function X_(e){return"Resource"===e.attributes["rdf:parseType"]&&void 0!==e.value["rdf:value"]||void 0!==e.value["rdf:Description"]&&void 0!==e.value["rdf:Description"].value["rdf:value"]}function Q_(e,t){const n=ev(e);void 0!==e.value["rdf:Description"]&&(e=e.value["rdf:Description"]),dm(n,ev(e),function(e){const t={};for(const n in e.value)"rdf:value"===n||G_(n)||(t[Y_(n)]=e.value[n].value);return t}(e));const r=function(e){return sv(e.value["rdf:value"])||e.value["rdf:value"].value}(e);return{value:r,attributes:n,description:W_(r,t)}}function ev(e){const t={};for(const n in e.attributes)"rdf:parseType"===n||"rdf:resource"===n||G_(n)||(t[Y_(n)]=e.attributes[n]);return t}function tv(e){return"Resource"===e.attributes["rdf:parseType"]||void 0!==e.value["rdf:Description"]&&void 0===e.value["rdf:Description"].value["rdf:value"]}function nv(e,t){const n={value:{},attributes:{}};return void 0!==e.value["rdf:Description"]&&(dm(n.value,V_(e.value["rdf:Description"].attributes)),dm(n.attributes,ev(e)),e=e.value["rdf:Description"]),dm(n.value,K_(e.value)),n.description=W_(n.value,t),n}function rv(e){return 0===Object.keys(e.value).length&&void 0===e.attributes["xml:lang"]&&void 0===e.attributes["rdf:resource"]}function iv(e,t){const n=V_(e.attributes);return{value:n,attributes:{},description:W_(n,t)}}function av(e){return e["rdf:Bag"]||e["rdf:Seq"]||e["rdf:Alt"]}function ov(e,t){const n=sv(e)||B_(e.value);return{value:n,attributes:ev(e),description:W_(n,t)}}function sv(e){return e.attributes&&e.attributes["rdf:resource"]}const uv=0,cv=1,lv=2,dv=3,fv=4,pv=5,hv=6,mv=7,gv=8;var yv={2e3:{name:"PathInformation",description:function(e){const t={},n=[];for(let r=0;r<e.byteLength;r+=26){const i=Dy.getShortAt(e,r);_v[i]&&(t[i]||(t[i]=_v[i].description),n.push({type:i,path:_v[i].path(e,r+2)}))}return JSON.stringify({types:t,paths:n})}},2999:{name:"ClippingPathName",description(e){const[,t]=cm(e,0);return t}}};const _v={[uv]:{description:"Closed subpath length",path:(e,t)=>[Dy.getShortAt(e,t)]},[cv]:{description:"Closed subpath Bezier knot, linked",path:vv},[lv]:{description:"Closed subpath Bezier knot, unlinked",path:vv},[dv]:{description:"Open subpath length",path:(e,t)=>[Dy.getShortAt(e,t)]},[fv]:{description:"Open subpath Bezier knot, linked",path:vv},[pv]:{description:"Open subpath Bezier knot, unlinked",path:vv},[hv]:{description:"Path fill rule",path:()=>[]},[gv]:{description:"Initial fill rule",path:(e,t)=>[Dy.getShortAt(e,t)]},[mv]:{description:"Clipboard",path:function(e,t){return[[Ev(e,t,8),Ev(e,t+4,8),Ev(e,t+8,8),Ev(e,t+12,8)],Ev(e,t+16,8)]}}};function vv(e,t){const n=[];for(let r=0;r<24;r+=8)n.push(bv(e,t+r));return n}function bv(e,t){const n=Ev(e,t,8);return[Ev(e,t+4,8),n]}function Ev(e,t,n){const r=Dy.getLongAt(e,t),i=r>>>31==0?1:-1,a=(2130706432&r)>>>32-n,o=r&parseInt(hm("1",32-n),2);return i*function(e,t){return parseInt(e.replace(".",""),t)/Math.pow(t,(e.split(".")[1]||"").length)}(a.toString(2)+"."+function(e,t,n){return hm(n,t-e.length)+e}(o.toString(2),32-n,"0"),2)}var Sv={read:function(e,t){const n=am(new Uint8Array(e).buffer),r={};let i=0;for(;i<e.length;){const e=om(n,i,Tv);i+=Tv;const a=Dy.getShortAt(n,i);i+=xv;const{tagName:o,tagNameSize:s}=Mv(n,i);i+=s;const u=Dy.getLongAt(n,i);if(i+=wv,e===Av){const e=am(n.buffer,i,u),s={id:a,value:om(e,0,u)};if(yv[a]){try{s.description=yv[a].description(e)}catch(e){s.description="<no description formatter>"}r[o||yv[a].name]=s}else t&&(r[`undefined-${a}`]=s)}i+=u+u%2}return r}};const Av="8BIM",xv=2,wv=4,Tv=Av.length;function Mv(e,t){const[n,r]=cm(e,t);return{tagName:r,tagNameSize:1+n+(n%2==0?1:0)}}const Ov={desc:{name:"ICC Description"},cprt:{name:"ICC Copyright"},dmdd:{name:"ICC Device Model Description"},vued:{name:"ICC Viewing Conditions Description"},dmnd:{name:"ICC Device Manufacturer for Display"},tech:{name:"Technology"}},Cv={4:{name:"Preferred CMM type",value:(e,t)=>om(e,t,4),description:e=>null!==e?Nv(e):""},8:{name:"Profile Version",value:(e,t)=>e.getUint8(t).toString(10)+"."+(e.getUint8(t+1)>>4).toString(10)+"."+(e.getUint8(t+1)%16).toString(10)},12:{name:"Profile/Device class",value:(e,t)=>om(e,t,4),description:e=>{switch(e.toLowerCase()){case"scnr":return"Input Device profile";case"mntr":return"Display Device profile";case"prtr":return"Output Device profile";case"link":return"DeviceLink profile";case"abst":return"Abstract profile";case"spac":return"ColorSpace profile";case"nmcl":return"NamedColor profile";case"cenc":return"ColorEncodingSpace profile";case"mid ":return"MultiplexIdentification profile";case"mlnk":return"MultiplexLink profile";case"mvis":return"MultiplexVisualization profile";default:return e}}},16:{name:"Color Space",value:(e,t)=>om(e,t,4)},20:{name:"Connection Space",value:(e,t)=>om(e,t,4)},24:{name:"ICC Profile Date",value:(e,t)=>function(e,t){const n=e.getUint16(t),r=e.getUint16(t+2)-1,i=e.getUint16(t+4),a=e.getUint16(t+6),o=e.getUint16(t+8),s=e.getUint16(t+10);return new Date(Date.UTC(n,r,i,a,o,s))}(e,t).toISOString()},36:{name:"ICC Signature",value:(e,t)=>{return n=e.buffer.slice(t,t+4),String.fromCharCode.apply(null,new Uint8Array(n));var n}},40:{name:"Primary Platform",value:(e,t)=>om(e,t,4),description:e=>Nv(e)},48:{name:"Device Manufacturer",value:(e,t)=>om(e,t,4),description:e=>Nv(e)},52:{name:"Device Model Number",value:(e,t)=>om(e,t,4)},64:{name:"Rendering Intent",value:(e,t)=>e.getUint32(t),description:e=>{switch(e){case 0:return"Perceptual";case 1:return"Relative Colorimetric";case 2:return"Saturation";case 3:return"Absolute Colorimetric";default:return e}}},80:{name:"Profile Creator",value:(e,t)=>om(e,t,4)}};function Nv(e){switch(e.toLowerCase()){case"appl":return"Apple";case"adbe":return"Adobe";case"msft":return"Microsoft";case"sunw":return"Sun Microsystems";case"sgi":return"Silicon Graphics";case"tgnt":return"Taligent";default:return e}}var Dv={read:function(e,t,n){if(n&&t[0].compressionMethod!==mm)return function(e,t){if(n=t[0].compressionMethod,0!==n)return{};var n;const r=new DataView(e.buffer.slice(t[0].offset,t[0].offset+t[0].length));return gm(r,t[0].compressionMethod,"utf-8","dataview").then(Zv).catch((()=>({})))}(e,t);return function(e,t){try{const n=t.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(n);let i=0;const a=function(e){if(Array.isArray(e))return new DataView(Uint8Array.from(e).buffer).buffer;return e.buffer}(e);for(let e=1;e<=t.length;e++){const n=t.find((t=>t.chunkNumber===e));if(!n)throw new Error(`ICC chunk ${e} not found`);const o=a.slice(n.offset,n.offset+n.length),s=new Uint8Array(o);r.set(s,i),i+=s.length}return Zv(new DataView(r.buffer))}catch(e){return{}}}(e,t)}};const Lv=84,Iv=128,kv="acsp",$v="desc",Rv="mluc",Fv="text",zv="sig ",Pv=12;function jv(e,t){return e.length<t+Pv}function Zv(e){const t=e.buffer,n=e.getUint32();if(e.byteLength!==n)throw new Error("ICC profile length not matching");if(e.length<Lv)throw new Error("ICC profile too short");const r={},i=Object.keys(Cv);for(let t=0;t<i.length;t++){const n=i[t],a=Cv[n],o=a.value(e,parseInt(n,10));let s=o;a.description&&(s=a.description(o)),r[a.name]={value:o,description:s}}if(Uv(t.slice(36,40))!==kv)throw new Error("ICC profile: missing signature");if(function(e){return e.length<Iv+4}(t))return r;const a=e.getUint32(128);let o=132;for(let n=0;n<a;n++){if(jv(t,o))return r;const n=om(e,o,4),i=e.getUint32(o+4),a=e.getUint32(o+8);if(i>t.length)return r;const s=om(e,i,4);if(s===$v){const o=e.getUint32(i+8);if(o>a)return r;Bv(r,n,Uv(t.slice(i+12,i+o+11)))}else if(s===Rv){const t=e.getUint32(i+8),a=e.getUint32(i+12);let o=i+16;const s=[];for(let n=0;n<t;n++){const t=om(e,o+0,2),n=om(e,o+2,2),r=e.getUint32(o+4),u=e.getUint32(o+8),c=um(e,i+u,r);s.push({languageCode:t,countryCode:n,text:c}),o+=a}if(1===t)Bv(r,n,s[0].text);else{const e={};for(let t=0;t<s.length;t++)e[`${s[t].languageCode}-${s[t].countryCode}`]=s[t].text;Bv(r,n,e)}}else if(s===Fv){Bv(r,n,Uv(t.slice(i+8,i+a-7)))}else if(s===zv){Bv(r,n,Uv(t.slice(i+8,i+12)))}o+=12}return r}function Uv(e){return String.fromCharCode.apply(null,new Uint8Array(e))}function Bv(e,t,n){Ov[t]?e[Ov[t].name]={value:n,description:n}:e[t]={value:n,description:n}}const Vv=27;var Hv={read:function(e,t,n,r,i){let a=Fy(e,My,t,t+n,r,i);a.ShotInfo&&(a=dm({},a,function(e){const t={};void 0!==e[27]&&(t.AutoRotate={value:e[27],description:Gv(e[27])});return t}(a.ShotInfo.value)),delete a.ShotInfo);return a},SHOT_INFO_AUTO_ROTATE:Vv};function Gv(e){return 0===e?"None":1===e?"Rotate 90 CW":2===e?"Rotate 180":3===e?"Rotate 270 CW":"Unknown"}var Yv={read:function(e,t){return{"Image Width":Wv(e,t),"Image Height":qv(e,t),"Bit Depth":Kv(e,t),"Color Type":Jv(e,t),Compression:Xv(e,t),Filter:Qv(e,t),Interlace:eb(e,t)}}};function Wv(e,t){if(t+0+4>e.byteLength)return;const n=Dy.getLongAt(e,t);return{value:n,description:`${n}px`}}function qv(e,t){if(t+4+4>e.byteLength)return;const n=Dy.getLongAt(e,t+4);return{value:n,description:`${n}px`}}function Kv(e,t){if(t+8+1>e.byteLength)return;const n=Dy.getByteAt(e,t+8);return{value:n,description:`${n}`}}function Jv(e,t){if(t+9+1>e.byteLength)return;const n=Dy.getByteAt(e,t+9);return{value:n,description:{0:"Grayscale",2:"RGB",3:"Palette",4:"Grayscale with Alpha",6:"RGB with Alpha"}[n]||"Unknown"}}function Xv(e,t){if(t+10+1>e.byteLength)return;const n=Dy.getByteAt(e,t+10);return{value:n,description:0===n?"Deflate/Inflate":"Unknown"}}function Qv(e,t){if(t+11+1>e.byteLength)return;const n=Dy.getByteAt(e,t+11);return{value:n,description:0===n?"Adaptive":"Unknown"}}function eb(e,t){if(t+12+1>e.byteLength)return;const n=Dy.getByteAt(e,t+12);return{value:n,description:{0:"Noninterlaced",1:"Adam7 Interlace"}[n]||"Unknown"}}var tb={read:function(e,t,n,r){const i={},a=[];for(let o=0;o<t.length;o++){const{offset:s,length:u,type:c}=t[o],l=lb(e,s,u,c,n);if(l instanceof Promise)a.push(l.then((({name:e,value:t,description:n})=>{try{if(ym&&gb(e,t))return{__exif:Vy.read(_b(t),cb,r).tags};if(_m&&yb(e,t))return{__iptc:b_.read(_b(t),0,r)};if(e&&!gb(e,t)&&!yb(e,t))return{[e]:{value:t,description:n}}}catch(e){}return{}})));else{const{name:e,value:t,description:n}=l;e&&(i[e]={value:t,description:n})}}return{readTags:i,readTagsPromise:a.length>0?Promise.all(a):void 0}}};const nb="STATE_KEYWORD",rb="STATE_COMPRESSION",ib="STATE_LANG",ab="STATE_TRANSLATED_KEYWORD",ob="STATE_TEXT",sb=1,ub=1,cb=6;function lb(e,t,n,r,i){const a=[],o=[];let s,u=nb,c=mm;for(let i=0;i<n&&t+i<e.byteLength;i++){if(u===rb){c=db({type:r,dataView:e,offset:t+i}),r===Cg&&(i+=sb),u=fb(r,u);continue}if(u===ob){s=new DataView(e.buffer.slice(t+i,t+n));break}const l=e.getUint8(t+i);0===l?u=fb(r,u):u===nb?a.push(l):u===ib&&o.push(l)}if(c!==mm&&!i)return{};const l=gm(s,c,function(e){if(e===Og||e===Ng)return"latin1";return"utf-8"}(r));return l instanceof Promise?l.then((e=>pb(e,r,o,a))).catch((()=>pb("<text using unknown compression>".split(""),r,o,a))):pb(l,r,o,a)}function db({type:e,dataView:t,offset:n}){if(e===Cg){if(t.getUint8(n)===ub)return t.getUint8(n+1)}else if(e===Ng)return t.getUint8(n);return mm}function fb(e,t){return t===nb&&[Cg,Ng].includes(e)?rb:t===rb?e===Cg?ib:ob:t===ib?ab:ob}function pb(e,t,n,r){const i=function(e){if(e instanceof DataView)return om(e,0,e.byteLength);return e}(e);return{name:hb(t,n,r),value:i,description:t===Cg?mb(e):i}}function hb(e,t,n){const r=lm(n);if(e===Og||0===t.length)return r;return`${r} (${lm(t)})`}function mb(e){return v_.decode("UTF-8",e)}function gb(e,t){return"raw profile type exif"===e.toLowerCase()&&"exif"===t.substring(1,5)}function yb(e,t){return"raw profile type iptc"===e.toLowerCase()&&"iptc"===t.substring(1,5)}function _b(e){return function(e){const t=new DataView(new ArrayBuffer(e.length/2));for(let n=0;n<e.length;n+=2)t.setUint8(n/2,parseInt(e.substring(n,n+2),16));return t}(e.match(/\n(exif|iptc)\n\s*\d+\n([\s\S]*)$/)[2].replace(/\n/g,""))}var vb={read:function(e,t){const n={};for(let r=0;r<t.length;r++){const i=Dy.getLongAt(e,t[r]+xg),a=om(e,t[r]+wg,Ag);a===Dg?(n["Pixels Per Unit X"]=bb(e,t[r],i),n["Pixels Per Unit Y"]=Eb(e,t[r],i),n["Pixel Units"]=Sb(e,t[r],i)):a===Lg&&(n["Modify Date"]=Ab(e,t[r],i))}return n}};function bb(e,t,n){if(!xb(e,t,n,0,4))return;const r=Dy.getLongAt(e,t+Tg+0);return{value:r,description:""+r}}function Eb(e,t,n){if(!xb(e,t,n,4,4))return;const r=Dy.getLongAt(e,t+Tg+4);return{value:r,description:""+r}}function Sb(e,t,n){if(!xb(e,t,n,8,1))return;const r=Dy.getByteAt(e,t+Tg+8);return{value:r,description:1===r?"meters":"Unknown"}}function Ab(e,t,n){if(!xb(e,t,n,0,7))return;const r=Dy.getShortAt(e,t+Tg),i=Dy.getByteAt(e,t+Tg+2),a=Dy.getByteAt(e,t+Tg+3),o=Dy.getByteAt(e,t+Tg+4),s=Dy.getByteAt(e,t+Tg+5),u=Dy.getByteAt(e,t+Tg+6);return{value:[r,i,a,o,s,u],description:`${wb(r,4)}-${wb(i,2)}-${wb(a,2)} ${wb(o,2)}:${wb(s,2)}:${wb(u,2)}`}}function xb(e,t,n,r,i){return r+i<=n&&t+Tg+r+i<=e.byteLength}function wb(e,t){return`${"0".repeat(t-(""+e).length)}${e}`}var Tb={read:function(e,t){const n={},r=Dy.getByteAt(e,t);return n.Alpha=Cb(r),n.Animation=Nb(r),n.ImageWidth=Db(e,t+Mb),n.ImageHeight=Db(e,t+Ob),n}};const Mb=4,Ob=7;function Cb(e){const t=16&e;return{value:t?1:0,description:t?"Yes":"No"}}function Nb(e){const t=2&e;return{value:t?1:0,description:t?"Yes":"No"}}function Db(e,t){const n=Dy.getByteAt(e,t)+256*Dy.getByteAt(e,t+1)+65536*Dy.getByteAt(e,t+2)+1;return{value:n,description:n+"px"}}var Lb={read:function(e){return{"GIF Version":Ib(e),"Image Width":kb(e),"Image Height":$b(e),"Global Color Map":Rb(e),"Bits Per Pixel":zb(e),"Color Resolution Depth":Fb(e)}}};function Ib(e){if(6>e.byteLength)return;const t=om(e,3,3);return{value:t,description:t}}function kb(e){if(8>e.byteLength)return;const t=e.getUint16(6,!0);return{value:t,description:`${t}px`}}function $b(e){if(10>e.byteLength)return;const t=e.getUint16(8,!0);return{value:t,description:`${t}px`}}function Rb(e){if(11>e.byteLength)return;const t=(128&e.getUint8(10))>>>7;return{value:t,description:1===t?"Yes":"No"}}function Fb(e){if(11>e.byteLength)return;const t=1+((112&e.getUint8(10))>>>4);return{value:t,description:`${t} ${1===t?"bit":"bits"}`}}function zb(e){if(11>e.byteLength)return;const t=1+(7&e.getUint8(10));return{value:t,description:`${t} ${1===t?"bit":"bits"}`}}const Pb=[6,7,99];var jb={get:function(e,t,n){if(r=t,r&&(void 0===r.Compression||Pb.includes(r.Compression.value))&&r.JPEGInterchangeFormat&&r.JPEGInterchangeFormat.value&&r.JPEGInterchangeFormatLength&&r.JPEGInterchangeFormatLength.value){t.type="image/jpeg";const r=n+t.JPEGInterchangeFormat.value;t.image=e.buffer.slice(r,r+t.JPEGInterchangeFormatLength.value),fm(t,"base64",(function(){return pm(this.image)}))}var r;return t}};function Zb(e){this.name="MetadataMissingError",this.message=e||"No Exif data",this.stack=(new Error).stack}Zb.prototype=new Error;var Ub,Bb,Vb={MetadataMissingError:Zb},Hb={load:function(e,t={}){if(function(e){return"string"==typeof e}(e))return t.async=!0,function(e,t){if(/^\w+:\/\//.test(e))return"undefined"!=typeof fetch?function(e,{length:t}={}){const n={method:"GET"};Number.isInteger(t)&&t>=0&&(n.headers={range:"bytes=0-"+(t-1)});return fetch(e,n).then((e=>e.arrayBuffer()))}(e,t):function(e,{length:t}={}){return new Promise(((n,r)=>{const i={};Number.isInteger(t)&&t>=0&&(i.headers={range:"bytes=0-"+(t-1)});const a=function(e){if(/^https:\/\//.test(e))return __non_webpack_require__("https").get;return __non_webpack_require__("http").get}(e);a(e,i,(e=>{if(e.statusCode>=200&&e.statusCode<=299){const t=[];e.on("data",(e=>t.push(Buffer.from(e)))),e.on("error",(e=>r(e))),e.on("end",(()=>n(Buffer.concat(t))))}else r(`Could not fetch file: ${e.statusCode} ${e.statusMessage}`),e.resume()})).on("error",(e=>r(e)))}))}(e,t);if(function(e){return/^data:[^;,]*(;base64)?,/.test(e)}(e))return Promise.resolve(function(e){const t=e.substring(e.indexOf(",")+1);if(-1!==e.indexOf(";base64")){if("undefined"!=typeof atob)return Uint8Array.from(atob(t),(e=>e.charCodeAt(0))).buffer;if("undefined"==typeof Buffer)return;return void 0!==Buffer.from?Buffer.from(t,"base64"):new Buffer(t,"base64")}const n=decodeURIComponent(t);return"undefined"!=typeof Buffer?void 0!==Buffer.from?Buffer.from(n):new Buffer(n):Uint8Array.from(n,(e=>e.charCodeAt(0))).buffer}(e));return function(e,{length:t}={}){return new Promise(((n,r)=>{const i=function(){try{return __non_webpack_require__("fs")}catch(e){return}}();i.open(e,((a,o)=>{a?r(a):i.stat(e,((a,s)=>{if(a)r(a);else{const a=Math.min(s.size,void 0!==t?t:s.size),u=Buffer.alloc(a),c={buffer:u,length:a};i.read(o,c,(t=>{t?r(t):i.close(o,(t=>{t&&console.warn(`Could not close file ${e}:`,t),n(u)}))}))}}))}))}))}(e,t)}(e,t).then((e=>Gb(e,t)));if(function(e){return"undefined"!=typeof File&&e instanceof File}(e))return t.async=!0,(n=e,new Promise(((e,t)=>{const r=new FileReader;r.onload=t=>e(t.target.result),r.onerror=()=>t(r.error),r.readAsArrayBuffer(n)}))).then((e=>Gb(e,t)));var n;return Gb(e,t)},loadView:Yb,errors:Vb};function Gb(e,t){return function(e){try{return Buffer.isBuffer(e)}catch(e){return!1}}(e)&&(e=new Uint8Array(e).buffer),Yb(function(e){try{return new DataView(e)}catch(t){return new im(e)}}(e),t)}function Yb(e,{expanded:t=!1,async:n=!1,includeUnknown:r=!1,domParser:i}={expanded:!1,async:!1,includeUnknown:!1,domParser:void 0}){let a=!1,o={};const s=[],{fileType:u,fileDataOffset:c,jfifDataOffset:l,tiffHeaderOffset:d,iptcDataOffset:f,xmpChunks:p,iccChunks:h,mpfDataOffset:m,pngHeaderOffset:g,pngTextChunks:y,pngChunkOffsets:_,vp8xChunkOffset:v,gifHeaderOffset:b}=dy.parseAppMarkers(e,n);if(function(e){return void 0!==e}(c)){a=!0;const n=t_.read(e,c);t?o.file=n:o=dm({},o,n)}if(function(e){return void 0!==e}(l)){a=!0;const n=u_.read(e,l);t?o.jfif=n:o=dm({},o,n)}if(function(e){return void 0!==e}(d)){a=!0;const{tags:n,byteOrder:s}=Vy.read(e,d,r);if(n.Thumbnail&&(o.Thumbnail=n.Thumbnail,delete n.Thumbnail),t?(o.exif=n,function(e){if(e.exif){if(e.exif.GPSLatitude&&e.exif.GPSLatitudeRef)try{e.gps=e.gps||{},e.gps.Latitude=Em(e.exif.GPSLatitude.value),"S"===e.exif.GPSLatitudeRef.value.join("")&&(e.gps.Latitude=-e.gps.Latitude)}catch(e){}if(e.exif.GPSLongitude&&e.exif.GPSLongitudeRef)try{e.gps=e.gps||{},e.gps.Longitude=Em(e.exif.GPSLongitude.value),"W"===e.exif.GPSLongitudeRef.value.join("")&&(e.gps.Longitude=-e.gps.Longitude)}catch(e){}if(e.exif.GPSAltitude&&e.exif.GPSAltitudeRef)try{e.gps=e.gps||{},e.gps.Altitude=e.exif.GPSAltitude.value[0]/e.exif.GPSAltitude.value[1],1===e.exif.GPSAltitudeRef.value&&(e.gps.Altitude=-e.gps.Altitude)}catch(e){}}}(o)):o=dm({},o,n),n["IPTC-NAA"]&&!Wb(f)){const e=b_.read(n["IPTC-NAA"].value,0,r);t?o.iptc=e:o=dm({},o,e)}if(n.ApplicationNotes&&!qb(p)){const e=$_.read(lm(n.ApplicationNotes.value),void 0,i);t?o.xmp=e:(delete e._raw,o=dm({},o,e))}if(n.ImageSourceData){const e=Sv.read(n.PhotoshopSettings.value,r);t?o.photoshop=e:o=dm({},o,e)}if(n.ICC_Profile&&!Kb(h)){const e=Dv.read(n.ICC_Profile.value,[{offset:0,length:n.ICC_Profile.value.length,chunkNumber:1,chunksTotal:1}]);t?o.icc=e:o=dm({},o,e)}if(function(e){return e.Make&&e.Make.value&&Array.isArray(e.Make.value)&&"Canon"===e.Make.value[0]&&e.MakerNote&&e.MakerNote.__offset}(n)){const i=Hv.read(e,d,n.MakerNote.__offset,s,r);t?o.makerNotes=i:o=dm({},o,i)}n.MakerNote&&delete n.MakerNote.__offset}if(Wb(f)){a=!0;const n=b_.read(e,f,r);t?o.iptc=n:o=dm({},o,n)}if(qb(p)){a=!0;const n=$_.read(e,p,i);t?o.xmp=n:(delete n._raw,o=dm({},o,n))}if(Kb(h)){a=!0;const t=Dv.read(e,h,n);t instanceof Promise?s.push(t.then(S)):S(t)}if(function(e){return void 0!==e}(m)){a=!0;const n=Wy.read(e,m,r);t?o.mpf=n:o=dm({},o,n)}if(void 0!==g){a=!0;const n=Yv.read(e,g);t?(o.png=o.png?dm({},o.png,n):n,o.pngFile=n):o=dm({},o,n)}if(function(e){return void 0!==e}(y)){a=!0;const{readTags:t,readTagsPromise:i}=tb.read(e,y,n,r);A(t),i&&s.push(i.then((e=>e.forEach(A))))}if(function(e){return void 0!==e}(_)){a=!0;const n=vb.read(e,_);t?o.png=o.png?dm({},o.png,n):n:o=dm({},o,n)}if(function(e){return void 0!==e}(v)){a=!0;const n=Tb.read(e,v);t?o.riff=o.riff?dm({},o.riff,n):n:o=dm({},o,n)}if(function(e){return void 0!==e}(b)){a=!0;const n=Lb.read(e,b);t?o.gif=o.gif?dm({},o.gif,n):n:o=dm({},o,n)}const E=jb.get(e,o.Thumbnail,d);if(E?(a=!0,o.Thumbnail=E):delete o.Thumbnail,u&&(t?(o.file||(o.file={}),o.file.FileType=u):o.FileType=u,a=!0),!a)throw new Vb.MetadataMissingError;return n?Promise.all(s).then((()=>o)):o;function S(e){t?o.icc=e:o=dm({},o,e)}function A(e){if(t){for(const t of["exif","iptc"]){const n=`__${t}`;e[n]&&(o[t]=o[t]?dm({},o.exif,e[n]):e[n],delete e[n])}o.png=o.png?dm({},o.png,e):e,o.pngText=o.pngText?dm({},o.png,e):e}else o=dm({},o,e.__exif?e.__exif:{},e.__iptc?e.__iptc:{},e),delete o.__exif,delete o.__iptc}}function Wb(e){return void 0!==e}function qb(e){return Array.isArray(e)&&e.length>0}function Kb(e){return Array.isArray(e)&&e.length>0}exports.ImageHelper=void 0,(Ub=exports.ImageHelper||(exports.ImageHelper={})).convertBlob=async(e,t="image/jpeg")=>{const n=(await exports.FileHelper.getType(e)).mime;if("image/heic"===n||"image/heif"===n){const{heicTo:n}=await Promise.resolve().then((function(){return require("./heic-to.cfb16ea4.js")}));e=await n({blob:e,type:t})}const r=await Ub.blobToImage(e),i=document.createElement("canvas");return i.width=r.width,i.height=r.height,i.getContext("2d").drawImage(r,0,0),i.toDataURL(t)},Ub.dataUrlToImage=async e=>new Promise(((t,n)=>{const r=new Image;r.onload=()=>t(r),r.onerror=()=>n(new Error("dataURLtoImage(): dataURL is illegal")),r.src=e})),Ub.blobToImage=async e=>{const t=URL.createObjectURL(e);return new Promise(((e,n)=>{const r=new Image;r.onload=()=>{URL.revokeObjectURL(t),e(r)},r.onerror=()=>n(new Error("blobToImage(): blob is illegal")),r.src=t}))},Ub.resampleImage=async(e,t)=>{const{crop:n,scale:r,width:i,height:a,quality:o=1,type:s="image/jpeg"}=t,u=document.createElement("canvas"),c=u.getContext("2d");if(r)u.width=e.width*r,u.height=e.height*r,c.drawImage(e,0,0,u.width,u.height);else if(i&&a){u.width=i,u.height=a;let t=e.height/a*i,r=e.height,o=(e.width-t)/2,s=0;(n&&e.height>e.width||!n&&e.height<e.width)&&(t=e.width,r=e.width/i*a,o=0,s=(e.height-r)/2),c.drawImage(e,o,s,t,r,0,0,i,a)}return new Promise((e=>u.toBlob((t=>e(t)),s,o)))},Ub.compressImage=async(e,t)=>{const{quality:n=1,fileSize:r,attempts:i=0,maxAttempts:a}=t,o=await Ub.blobToImage(e);if(e.size<=1024*r||n<0)return e;const s=await Ub.resampleImage(o,{scale:1,quality:n});return s.size>1024*r&&(i<a||!a)?Ub.compressImage(e,{...t,quality:n-.1,attempts:i+1}):s},Ub.getMetadata=async e=>{try{const t=await Hb.load(e),n=t.DateTimeOriginal?.description,r=Number(t.GPSLongitude?.description),i=Number(t.GPSLatitude?.description),a=isNaN(r)?void 0:Number(r);return{dateTimeOriginal:n,lat:isNaN(i)?void 0:Number(i),lng:a}}catch{}},function(e){e.degreesToRadians=e=>Math.PI*e/180,e.radiansToDegrees=e=>180*e/Math.PI,e.nauticalMilesToMetres=e=>1852*e}(Bb||(Bb={}));var Jb=xi,Xb=qa,Qb=Vr,eE=Hr,tE=Mi,nE=Gr.exports,rE=_i,iE=ui,aE=Object.prototype.hasOwnProperty;var oE=function(e){if(null==e)return!0;if(tE(e)&&(eE(e)||"string"==typeof e||"function"==typeof e.splice||nE(e)||iE(e)||Qb(e)))return!e.length;var t=Xb(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(rE(e))return!Jb(e).length;for(var n in e)if(aE.call(e,n))return!1;return!0};var sE,uE,cE=function(e){return null==e};!function(e){e.upsert=(e,t,n)=>{const r={...e};return r[t]=t in r?{...r[t],...n}:n,r},e.getNestedValueByKey=(t,n,r={})=>{const{skipRoot:i,searchIn:a}=r;if(!i&&n in t)return{[n]:t[n]};for(const[i,o]of Object.entries(t))if(o&&"object"==typeof o&&!Array.isArray(o)&&(!a||a.includes(i))){const t=e.getNestedValueByKey(o,n,{...r,skipRoot:!1});if(!oE(t))return t}},e.removeNil=t=>{if(null!==t){if(Array.isArray(t)){const n=t.map((t=>e.removeNil(t))).filter((e=>e));return n.length?n:void 0}if("object"==typeof t){const n={...t};return Object.entries(n).forEach((([t,r])=>{const i=e.removeNil(r);cE(i)?delete n[t]:n[t]=i})),oE(n)?void 0:n}return t}}}(sE||(sE={})),exports.TestHelper=void 0,(uE=exports.TestHelper||(exports.TestHelper={})).generateId=(e,t,n)=>{let r=e;return t&&(r+=`__${t}`),n&&(r+=`--${n}`),r},uE.getError=e=>{try{return e()}catch(e){return e}};const lE=t.createContext({formValidationConfig:null,setFormValidationConfig:()=>null,warnings:null,setWarnings:()=>null,yupId:null}),dE=({children:n})=>{const[r,i]=t.useState(),[a,o]=t.useState(),[s]=t.useState(rm()),u=t.useMemo((()=>({formValidationConfig:r,setFormValidationConfig:i,warnings:a,setWarnings:o,yupId:s})),[r,a,s]);return e.jsx(lE.Provider,{value:u,children:n})};var fE=dr,pE=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},hE=function(e){return this.__data__.has(e)};function mE(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new fE;++t<n;)this.add(e[t])}mE.prototype.add=mE.prototype.push=pE,mE.prototype.has=hE;var gE=mE;var yE=function(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1};var _E=function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1},vE=yE,bE=function(e){return e!=e},EE=_E;var SE=function(e,t,n){return t==t?EE(e,t,n):vE(e,bE,n)},AE=SE;var xE=function(e,t){return!!(null==e?0:e.length)&&AE(e,t,0)>-1};var wE=function(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1};var TE=function(e,t){return e.has(t)},ME=gE,OE=xE,CE=wE,NE=Vp,DE=ni,LE=TE,IE=Math.min;var kE=function(e,t,n){for(var r=n?CE:OE,i=e[0].length,a=e.length,o=a,s=Array(a),u=1/0,c=[];o--;){var l=e[o];o&&t&&(l=NE(l,DE(t))),u=IE(l.length,u),s[o]=!n&&(t||i>=120&&l.length>=120)?new ME(o&&l):void 0}l=e[0];var d=-1,f=s[0];e:for(;++d<i&&c.length<u;){var p=l[d],h=t?t(p):p;if(p=n||0!==p?p:0,!(f?LE(f,h):r(c,h,n))){for(o=a;--o;){var m=s[o];if(!(m?LE(m,h):r(e[o],h,n)))continue e}f&&f.push(h),c.push(p)}}return c};var $E=function(e){return e};var RE=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)},FE=Math.max;var zE=function(e,t,n){return t=FE(void 0===t?e.length-1:t,0),function(){for(var r=arguments,i=-1,a=FE(r.length-t,0),o=Array(a);++i<a;)o[i]=r[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=r[i];return s[t]=n(o),RE(e,this,s)}};var PE=function(e){return function(){return e}},jE=wr,ZE=jE?function(e,t){return jE(e,"toString",{configurable:!0,enumerable:!1,value:PE(t),writable:!0})}:$E,UE=ZE,BE=Date.now;var VE=function(e){var t=0,n=0;return function(){var r=BE(),i=16-(r-n);if(n=r,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(UE),HE=$E,GE=zE,YE=VE;var WE=function(e,t){return YE(GE(e,t,HE),e+"")},qE=Mi,KE=Rr;var JE=function(e){return KE(e)&&qE(e)},XE=JE;var QE,eS,tS=Vp,nS=kE,rS=function(e){return XE(e)?e:[]},iS=WE((function(e){var t=tS(e,rS);return t.length&&t[0]===e[0]?nS(t):[]}));try{QE=Map}catch(kf){}try{eS=Set}catch(kf){}function aS(e,t,n){if(!e||"object"!=typeof e||"function"==typeof e)return e;if(e.nodeType&&"cloneNode"in e)return e.cloneNode(!0);if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e);if(Array.isArray(e))return e.map(oS);if(QE&&e instanceof QE)return new Map(Array.from(e.entries()));if(eS&&e instanceof eS)return new Set(Array.from(e.values()));if(e instanceof Object){t.push(e);var r=Object.create(e);for(var i in n.push(r),e){var a=t.findIndex((function(t){return t===e[i]}));r[i]=a>-1?n[a]:aS(e[i],t,n)}return r}return e}function oS(e){return aS(e,[],[])}const sS=Object.prototype.toString,uS=Error.prototype.toString,cS=RegExp.prototype.toString,lS="undefined"!=typeof Symbol?Symbol.prototype.toString:()=>"",dS=/^Symbol\((.*)\)(.*)$/;function fS(e,t=!1){if(null==e||!0===e||!1===e)return""+e;const n=typeof e;if("number"===n)return function(e){return e!=+e?"NaN":0===e&&1/e<0?"-0":""+e}(e);if("string"===n)return t?`"${e}"`:e;if("function"===n)return"[Function "+(e.name||"anonymous")+"]";if("symbol"===n)return lS.call(e).replace(dS,"Symbol($1)");const r=sS.call(e).slice(8,-1);return"Date"===r?isNaN(e.getTime())?""+e:e.toISOString(e):"Error"===r||e instanceof Error?"["+uS.call(e)+"]":"RegExp"===r?cS.call(e):null}function pS(e,t){let n=fS(e,t);return null!==n?n:JSON.stringify(e,(function(e,n){let r=fS(this[e],t);return null!==r?r:n}),2)}let hS={default:"${path} is invalid",required:"${path} is a required field",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:n,originalValue:r})=>{let i=null!=r&&r!==n,a=`${e} must be a \`${t}\` type, but the final value was: \`${pS(n,!0)}\``+(i?` (cast from the value \`${pS(r,!0)}\`).`:".");return null===n&&(a+='\n If "null" is intended as an empty value be sure to mark the schema as `.nullable()`'),a},defined:"${path} must be defined"},mS={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},gS={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},yS={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},_S={isValue:"${path} field must be ${value}"},vS={noUnknown:"${path} field has unspecified keys: ${unknown}"},bS={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"};var ES=Object.assign(Object.create(null),{mixed:hS,string:mS,number:gS,date:yS,object:vS,array:bS,boolean:_S}),SS=Object.prototype.hasOwnProperty;var AS=function(e,t){return null!=e&&SS.call(e,t)},xS=Hr,wS=Yp,TS=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,MS=/^\w*$/;var OS=function(e,t){if(xS(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!wS(e))||(MS.test(e)||!TS.test(e)||null!=t&&e in Object(t))},CS=dr;function NS(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(NS.Cache||CS),n}NS.Cache=CS;var DS=NS;var LS=function(e){var t=DS(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t},IS=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,kS=/\\(\\)?/g,$S=LS((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(IS,(function(e,n,r,i){t.push(r?i.replace(kS,"$1"):n||e)})),t})),RS=Hr,FS=OS,zS=$S,PS=th;var jS=function(e,t){return RS(e)?e:FS(e,t)?[e]:zS(PS(e))},ZS=Yp;var US=function(e){if("string"==typeof e||ZS(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},BS=jS,VS=Vr,HS=Hr,GS=qr,YS=Kr,WS=US;var qS=function(e,t,n){for(var r=-1,i=(t=BS(t,e)).length,a=!1;++r<i;){var o=WS(t[r]);if(!(a=null!=e&&n(e,o)))break;e=e[o]}return a||++r!=i?a:!!(i=null==e?0:e.length)&&YS(i)&&GS(o,i)&&(HS(e)||VS(e))},KS=AS,JS=qS;var XS=function(e,t){return null!=e&&JS(e,t,KS)};const QS=e=>e&&e.__isYupSchema__;class eA{constructor(e,t){if(this.fn=void 0,this.refs=e,this.refs=e,"function"==typeof t)return void(this.fn=t);if(!XS(t,"is"))throw new TypeError("`is:` is required for `when()` conditions");if(!t.then&&!t.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:n,then:r,otherwise:i}=t,a="function"==typeof n?n:(...e)=>e.every((e=>e===n));this.fn=function(...e){let t=e.pop(),n=e.pop(),o=a(...e)?r:i;if(o)return"function"==typeof o?o(n):n.concat(o.resolve(t))}}resolve(e,t){let n=this.refs.map((e=>e.getValue(null==t?void 0:t.value,null==t?void 0:t.parent,null==t?void 0:t.context))),r=this.fn.apply(e,n.concat(e,t));if(void 0===r||r===e)return e;if(!QS(r))throw new TypeError("conditions must return a schema object");return r.resolve(t)}}function tA(e){return null==e?[]:[].concat(e)}function nA(){return nA=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},nA.apply(this,arguments)}let rA=/\$\{\s*(\w+)\s*\}/g;class iA extends Error{static formatError(e,t){const n=t.label||t.path||"this";return n!==t.path&&(t=nA({},t,{path:n})),"string"==typeof e?e.replace(rA,((e,n)=>pS(t[n]))):"function"==typeof e?e(t):e}static isError(e){return e&&"ValidationError"===e.name}constructor(e,t,n,r){super(),this.value=void 0,this.path=void 0,this.type=void 0,this.errors=void 0,this.params=void 0,this.inner=void 0,this.name="ValidationError",this.value=t,this.path=n,this.type=r,this.errors=[],this.inner=[],tA(e).forEach((e=>{iA.isError(e)?(this.errors.push(...e.errors),this.inner=this.inner.concat(e.inner.length?e.inner:e)):this.errors.push(e)})),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0],Error.captureStackTrace&&Error.captureStackTrace(this,iA)}}function aA(e,t){let{endEarly:n,tests:r,args:i,value:a,errors:o,sort:s,path:u}=e,c=(e=>{let t=!1;return(...n)=>{t||(t=!0,e(...n))}})(t),l=r.length;const d=[];if(o=o||[],!l)return o.length?c(new iA(o,a,u)):c(null,a);for(let e=0;e<r.length;e++){(0,r[e])(i,(function(e){if(e){if(!iA.isError(e))return c(e,a);if(n)return e.value=a,c(e,a);d.push(e)}if(--l<=0){if(d.length&&(s&&d.sort(s),o.length&&d.push(...o),o=d),o.length)return void c(new iA(o,a,u),a);c(null,a)}}))}}var oA=function(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var u=o[e?s:++i];if(!1===n(a[u],u,a))break}return t}},sA=oA(),uA=sA,cA=Di;var lA=function(e,t){return e&&uA(e,t,cA)};var dA=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1},fA=gE,pA=dA,hA=TE;var mA=function(e,t,n,r,i,a){var o=1&n,s=e.length,u=t.length;if(s!=u&&!(o&&u>s))return!1;var c=a.get(e),l=a.get(t);if(c&&l)return c==t&&l==e;var d=-1,f=!0,p=2&n?new fA:void 0;for(a.set(e,t),a.set(t,e);++d<s;){var h=e[d],m=t[d];if(r)var g=o?r(m,h,d,t,e,a):r(h,m,d,e,t,a);if(void 0!==g){if(g)continue;f=!1;break}if(p){if(!pA(t,(function(e,t){if(!hA(p,t)&&(h===e||i(h,e,n,r,a)))return p.push(t)}))){f=!1;break}}else if(h!==m&&!i(h,m,n,r,a)){f=!1;break}}return a.delete(e),a.delete(t),f};var gA=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n};var yA=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n},_A=Xa,vA=wt,bA=mA,EA=gA,SA=yA,AA=qt?qt.prototype:void 0,xA=AA?AA.valueOf:void 0;var wA=function(e,t,n,r,i,a,o){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!a(new _A(e),new _A(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return vA(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var s=EA;case"[object Set]":var u=1&r;if(s||(s=SA),e.size!=t.size&&!u)return!1;var c=o.get(e);if(c)return c==t;r|=2,o.set(e,t);var l=bA(s(e),s(t),r,i,a,o);return o.delete(e),l;case"[object Symbol]":if(xA)return xA.call(e)==xA.call(t)}return!1},TA=Aa,MA=Object.prototype.hasOwnProperty;var OA=function(e,t,n,r,i,a){var o=1&n,s=TA(e),u=s.length;if(u!=TA(t).length&&!o)return!1;for(var c=u;c--;){var l=s[c];if(!(o?l in t:MA.call(t,l)))return!1}var d=a.get(e),f=a.get(t);if(d&&f)return d==t&&f==e;var p=!0;a.set(e,t),a.set(t,e);for(var h=o;++c<u;){var m=e[l=s[c]],g=t[l];if(r)var y=o?r(g,m,l,t,e,a):r(m,g,l,e,t,a);if(!(void 0===y?m===g||i(m,g,n,r,a):y)){p=!1;break}h||(h="constructor"==l)}if(p&&!h){var _=e.constructor,v=t.constructor;_==v||!("constructor"in e)||!("constructor"in t)||"function"==typeof _&&_ instanceof _&&"function"==typeof v&&v instanceof v||(p=!1)}return a.delete(e),a.delete(t),p},CA=Sr,NA=mA,DA=wA,LA=OA,IA=qa,kA=Hr,$A=Gr.exports,RA=ui,FA="[object Arguments]",zA="[object Array]",PA="[object Object]",jA=Object.prototype.hasOwnProperty;var ZA=function(e,t,n,r,i,a){var o=kA(e),s=kA(t),u=o?zA:IA(e),c=s?zA:IA(t),l=(u=u==FA?PA:u)==PA,d=(c=c==FA?PA:c)==PA,f=u==c;if(f&&$A(e)){if(!$A(t))return!1;o=!0,l=!1}if(f&&!l)return a||(a=new CA),o||RA(e)?NA(e,t,n,r,i,a):DA(e,t,u,n,r,i,a);if(!(1&n)){var p=l&&jA.call(e,"__wrapped__"),h=d&&jA.call(t,"__wrapped__");if(p||h){var m=p?e.value():e,g=h?t.value():t;return a||(a=new CA),i(m,g,n,r,a)}}return!!f&&(a||(a=new CA),LA(e,t,n,r,i,a))},UA=ZA,BA=Rr;var VA=function e(t,n,r,i,a){return t===n||(null==t||null==n||!BA(t)&&!BA(n)?t!=t&&n!=n:UA(t,n,r,i,e,a))},HA=Sr,GA=VA;var YA=function(e,t,n,r){var i=n.length,a=i,o=!r;if(null==e)return!a;for(e=Object(e);i--;){var s=n[i];if(o&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<a;){var u=(s=n[i])[0],c=e[u],l=s[1];if(o&&s[2]){if(void 0===c&&!(u in e))return!1}else{var d=new HA;if(r)var f=r(c,l,u,e,t,d);if(!(void 0===f?GA(l,c,3,r,d):f))return!1}}return!0},WA=un;var qA=function(e){return e==e&&!WA(e)},KA=qA,JA=Di;var XA=function(e){for(var t=JA(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,KA(i)]}return t};var QA=function(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}},ex=YA,tx=XA,nx=QA;var rx=function(e){var t=tx(e);return 1==t.length&&t[0][2]?nx(t[0][0],t[0][1]):function(n){return n===e||ex(n,e,t)}},ix=jS,ax=US;var ox=function(e,t){for(var n=0,r=(t=ix(t,e)).length;null!=e&&n<r;)e=e[ax(t[n++])];return n&&n==r?e:void 0},sx=ox;var ux=function(e,t,n){var r=null==e?void 0:sx(e,t);return void 0===r?n:r};var cx=function(e,t){return null!=e&&t in Object(e)},lx=cx,dx=qS;var fx=function(e,t){return null!=e&&dx(e,t,lx)},px=VA,hx=ux,mx=fx,gx=OS,yx=qA,_x=QA,vx=US;var bx=function(e,t){return gx(e)&&yx(t)?_x(vx(e),t):function(n){var r=hx(n,e);return void 0===r&&r===t?mx(n,e):px(t,r,3)}};var Ex=function(e){return function(t){return null==t?void 0:t[e]}},Sx=ox;var Ax=function(e){return function(t){return Sx(t,e)}},xx=Ex,wx=Ax,Tx=OS,Mx=US;var Ox=rx,Cx=bx,Nx=$E,Dx=Hr,Lx=function(e){return Tx(e)?xx(Mx(e)):wx(e)};var Ix=function(e){return"function"==typeof e?e:null==e?Nx:"object"==typeof e?Dx(e)?Cx(e[0],e[1]):Ox(e):Lx(e)},kx=Mr,$x=lA,Rx=Ix;var Fx=function(e,t){var n={};return t=Rx(t),$x(e,(function(e,r,i){kx(n,r,t(e,r,i))})),n};function zx(e){this._maxSize=e,this.clear()}zx.prototype.clear=function(){this._size=0,this._values=Object.create(null)},zx.prototype.get=function(e){return this._values[e]},zx.prototype.set=function(e,t){return this._size>=this._maxSize&&this.clear(),e in this._values||this._size++,this._values[e]=t};var Px=/[^.^\]^[]+|(?=\[\]|\.\.)/g,jx=/^\d+$/,Zx=/^\d/,Ux=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,Bx=/^\s*(['"]?)(.*?)(\1)\s*$/,Vx=new zx(512),Hx=new zx(512),Gx=new zx(512),Yx={Cache:zx,split:qx,normalizePath:Wx,setter:function(e){var t=Wx(e);return Hx.get(e)||Hx.set(e,(function(e,n){for(var r=0,i=t.length,a=e;r<i-1;){var o=t[r];if("__proto__"===o||"constructor"===o||"prototype"===o)return e;a=a[t[r++]]}a[t[r]]=n}))},getter:function(e,t){var n=Wx(e);return Gx.get(e)||Gx.set(e,(function(e){for(var r=0,i=n.length;r<i;){if(null==e&&t)return;e=e[n[r++]]}return e}))},join:function(e){return e.reduce((function(e,t){return e+(Kx(t)||jx.test(t)?"["+t+"]":(e?".":"")+t)}),"")},forEach:function(e,t,n){!function(e,t,n){var r,i,a,o,s=e.length;for(i=0;i<s;i++)(r=e[i])&&(Jx(r)&&(r='"'+r+'"'),a=!(o=Kx(r))&&/^\d+$/.test(r),t.call(n,r,o,a,i,e))}(Array.isArray(e)?e:qx(e),t,n)}};function Wx(e){return Vx.get(e)||Vx.set(e,qx(e).map((function(e){return e.replace(Bx,"$2")})))}function qx(e){return e.match(Px)||[""]}function Kx(e){return"string"==typeof e&&e&&-1!==["'",'"'].indexOf(e.charAt(0))}function Jx(e){return!Kx(e)&&(function(e){return e.match(Zx)&&!e.match(jx)}(e)||function(e){return Ux.test(e)}(e))}const Xx="$",Qx=".";class ew{constructor(e,t={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,"string"!=typeof e)throw new TypeError("ref must be a string, got: "+e);if(this.key=e.trim(),""===e)throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===Xx,this.isValue=this.key[0]===Qx,this.isSibling=!this.isContext&&!this.isValue;let n=this.isContext?Xx:this.isValue?Qx:"";this.path=this.key.slice(n.length),this.getter=this.path&&Yx.getter(this.path,!0),this.map=t.map}getValue(e,t,n){let r=this.isContext?n:this.isValue?e:t;return this.getter&&(r=this.getter(r||{})),this.map&&(r=this.map(r)),r}cast(e,t){return this.getValue(e,null==t?void 0:t.parent,null==t?void 0:t.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(e){return e&&e.__isYupRef}}function tw(){return tw=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tw.apply(this,arguments)}function nw(e){function t(t,n){let{value:r,path:i="",label:a,options:o,originalValue:s,sync:u}=t,c=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(t,["value","path","label","options","originalValue","sync"]);const{name:l,test:d,params:f,message:p}=e;let{parent:h,context:m}=o;function g(e){return ew.isRef(e)?e.getValue(r,h,m):e}function y(e={}){const t=Fx(tw({value:r,originalValue:s,label:a,path:e.path||i},f,e.params),g),n=new iA(iA.formatError(e.message||p,t),r,t.path,e.type||l);return n.params=t,n}let _,v=tw({path:i,parent:h,type:l,createError:y,resolve:g,options:o,originalValue:s},c);if(u){try{var b;if(_=d.call(v,r,v),"function"==typeof(null==(b=_)?void 0:b.then))throw new Error(`Validation test of type: "${v.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`)}catch(e){return void n(e)}iA.isError(_)?n(_):_?n(null,_):n(y())}else try{Promise.resolve(d.call(v,r,v)).then((e=>{iA.isError(e)?n(e):e?n(null,e):n(y())})).catch(n)}catch(e){n(e)}}return t.OPTIONS=e,t}ew.prototype.__isYupRef=!0;function rw(e,t,n,r=n){let i,a,o;return t?(Yx.forEach(t,((s,u,c)=>{let l=u?(e=>e.substr(0,e.length-1).substr(1))(s):s;if((e=e.resolve({context:r,parent:i,value:n})).innerType){let r=c?parseInt(l,10):0;if(n&&r>=n.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${s}, in the path: ${t}. because there is no value at that index. `);i=n,n=n&&n[r],e=e.innerType}if(!c){if(!e.fields||!e.fields[l])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${o} which is a type: "${e._type}")`);i=n,n=n&&n[l],e=e.fields[l]}a=l,o=u?"["+s+"]":"."+s})),{schema:e,parent:i,parentPath:a}):{parent:i,parentPath:t,schema:e}}class iw{constructor(){this.list=void 0,this.refs=void 0,this.list=new Set,this.refs=new Map}get size(){return this.list.size+this.refs.size}describe(){const e=[];for(const t of this.list)e.push(t);for(const[,t]of this.refs)e.push(t.describe());return e}toArray(){return Array.from(this.list).concat(Array.from(this.refs.values()))}resolveAll(e){return this.toArray().reduce(((t,n)=>t.concat(ew.isRef(n)?e(n):n)),[])}add(e){ew.isRef(e)?this.refs.set(e.key,e):this.list.add(e)}delete(e){ew.isRef(e)?this.refs.delete(e.key):this.list.delete(e)}clone(){const e=new iw;return e.list=new Set(this.list),e.refs=new Map(this.refs),e}merge(e,t){const n=this.clone();return e.list.forEach((e=>n.add(e))),e.refs.forEach((e=>n.add(e))),t.list.forEach((e=>n.delete(e))),t.refs.forEach((e=>n.delete(e))),n}}function aw(){return aw=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},aw.apply(this,arguments)}class ow{constructor(e){this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this._typeError=void 0,this._whitelist=new iw,this._blacklist=new iw,this.exclusiveTests=Object.create(null),this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation((()=>{this.typeError(hS.notType)})),this.type=(null==e?void 0:e.type)||"mixed",this.spec=aw({strip:!1,strict:!1,abortEarly:!0,recursive:!0,nullable:!1,presence:"optional"},null==e?void 0:e.spec)}get _type(){return this.type}_typeCheck(e){return!0}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),this;const t=Object.create(Object.getPrototypeOf(this));return t.type=this.type,t._typeError=this._typeError,t._whitelistError=this._whitelistError,t._blacklistError=this._blacklistError,t._whitelist=this._whitelist.clone(),t._blacklist=this._blacklist.clone(),t.exclusiveTests=aw({},this.exclusiveTests),t.deps=[...this.deps],t.conditions=[...this.conditions],t.tests=[...this.tests],t.transforms=[...this.transforms],t.spec=oS(aw({},this.spec,e)),t}label(e){let t=this.clone();return t.spec.label=e,t}meta(...e){if(0===e.length)return this.spec.meta;let t=this.clone();return t.spec.meta=Object.assign(t.spec.meta||{},e[0]),t}withMutation(e){let t=this._mutate;this._mutate=!0;let n=e(this);return this._mutate=t,n}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&"mixed"!==this.type)throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let t=this,n=e.clone();const r=aw({},t.spec,n.spec);return n.spec=r,n._typeError||(n._typeError=t._typeError),n._whitelistError||(n._whitelistError=t._whitelistError),n._blacklistError||(n._blacklistError=t._blacklistError),n._whitelist=t._whitelist.merge(e._whitelist,e._blacklist),n._blacklist=t._blacklist.merge(e._blacklist,e._whitelist),n.tests=t.tests,n.exclusiveTests=t.exclusiveTests,n.withMutation((t=>{e.tests.forEach((e=>{t.test(e.OPTIONS)}))})),n.transforms=[...t.transforms,...n.transforms],n}isType(e){return!(!this.spec.nullable||null!==e)||this._typeCheck(e)}resolve(e){let t=this;if(t.conditions.length){let n=t.conditions;t=t.clone(),t.conditions=[],t=n.reduce(((t,n)=>n.resolve(t,e)),t),t=t.resolve(e)}return t}cast(e,t={}){let n=this.resolve(aw({value:e},t)),r=n._cast(e,t);if(void 0!==e&&!1!==t.assert&&!0!==n.isType(r)){let i=pS(e),a=pS(r);throw new TypeError(`The value of ${t.path||"field"} could not be cast to a value that satisfies the schema type: "${n._type}". \n\nattempted value: ${i} \n`+(a!==i?`result of cast: ${a}`:""))}return r}_cast(e,t){let n=void 0===e?e:this.transforms.reduce(((t,n)=>n.call(this,t,e,this)),e);return void 0===n&&(n=this.getDefault()),n}_validate(e,t={},n){let{sync:r,path:i,from:a=[],originalValue:o=e,strict:s=this.spec.strict,abortEarly:u=this.spec.abortEarly}=t,c=e;s||(c=this._cast(c,aw({assert:!1},t)));let l={value:c,path:i,options:t,originalValue:o,schema:this,label:this.spec.label,sync:r,from:a},d=[];this._typeError&&d.push(this._typeError);let f=[];this._whitelistError&&f.push(this._whitelistError),this._blacklistError&&f.push(this._blacklistError),aA({args:l,value:c,path:i,sync:r,tests:d,endEarly:u},(e=>{e?n(e,c):aA({tests:this.tests.concat(f),args:l,path:i,sync:r,value:c,endEarly:u},n)}))}validate(e,t,n){let r=this.resolve(aw({},t,{value:e}));return"function"==typeof n?r._validate(e,t,n):new Promise(((n,i)=>r._validate(e,t,((e,t)=>{e?i(e):n(t)}))))}validateSync(e,t){let n;return this.resolve(aw({},t,{value:e}))._validate(e,aw({},t,{sync:!0}),((e,t)=>{if(e)throw e;n=t})),n}isValid(e,t){return this.validate(e,t).then((()=>!0),(e=>{if(iA.isError(e))return!1;throw e}))}isValidSync(e,t){try{return this.validateSync(e,t),!0}catch(e){if(iA.isError(e))return!1;throw e}}_getDefault(){let e=this.spec.default;return null==e?e:"function"==typeof e?e.call(this):oS(e)}getDefault(e){return this.resolve(e||{})._getDefault()}default(e){if(0===arguments.length)return this._getDefault();return this.clone({default:e})}strict(e=!0){let t=this.clone();return t.spec.strict=e,t}_isPresent(e){return null!=e}defined(e=hS.defined){return this.test({message:e,name:"defined",exclusive:!0,test:e=>void 0!==e})}required(e=hS.required){return this.clone({presence:"required"}).withMutation((t=>t.test({message:e,name:"required",exclusive:!0,test(e){return this.schema._isPresent(e)}})))}notRequired(){let e=this.clone({presence:"optional"});return e.tests=e.tests.filter((e=>"required"!==e.OPTIONS.name)),e}nullable(e=!0){return this.clone({nullable:!1!==e})}transform(e){let t=this.clone();return t.transforms.push(e),t}test(...e){let t;if(t=1===e.length?"function"==typeof e[0]?{test:e[0]}:e[0]:2===e.length?{name:e[0],test:e[1]}:{name:e[0],message:e[1],test:e[2]},void 0===t.message&&(t.message=hS.default),"function"!=typeof t.test)throw new TypeError("`test` is a required parameters");let n=this.clone(),r=nw(t),i=t.exclusive||t.name&&!0===n.exclusiveTests[t.name];if(t.exclusive&&!t.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return t.name&&(n.exclusiveTests[t.name]=!!t.exclusive),n.tests=n.tests.filter((e=>{if(e.OPTIONS.name===t.name){if(i)return!1;if(e.OPTIONS.test===r.OPTIONS.test)return!1}return!0})),n.tests.push(r),n}when(e,t){Array.isArray(e)||"string"==typeof e||(t=e,e=".");let n=this.clone(),r=tA(e).map((e=>new ew(e)));return r.forEach((e=>{e.isSibling&&n.deps.push(e.key)})),n.conditions.push(new eA(r,t)),n}typeError(e){let t=this.clone();return t._typeError=nw({message:e,name:"typeError",test(e){return!(void 0!==e&&!this.schema.isType(e))||this.createError({params:{type:this.schema._type}})}}),t}oneOf(e,t=hS.oneOf){let n=this.clone();return e.forEach((e=>{n._whitelist.add(e),n._blacklist.delete(e)})),n._whitelistError=nw({message:t,name:"oneOf",test(e){if(void 0===e)return!0;let t=this.schema._whitelist,n=t.resolveAll(this.resolve);return!!n.includes(e)||this.createError({params:{values:t.toArray().join(", "),resolved:n}})}}),n}notOneOf(e,t=hS.notOneOf){let n=this.clone();return e.forEach((e=>{n._blacklist.add(e),n._whitelist.delete(e)})),n._blacklistError=nw({message:t,name:"notOneOf",test(e){let t=this.schema._blacklist,n=t.resolveAll(this.resolve);return!n.includes(e)||this.createError({params:{values:t.toArray().join(", "),resolved:n}})}}),n}strip(e=!0){let t=this.clone();return t.spec.strip=e,t}describe(){const e=this.clone(),{label:t,meta:n}=e.spec,r={meta:n,label:t,type:e.type,oneOf:e._whitelist.describe(),notOneOf:e._blacklist.describe(),tests:e.tests.map((e=>({name:e.OPTIONS.name,params:e.OPTIONS.params}))).filter(((e,t,n)=>n.findIndex((t=>t.name===e.name))===t))};return r}}ow.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])ow.prototype[`${e}At`]=function(t,n,r={}){const{parent:i,parentPath:a,schema:o}=rw(this,t,n,r.context);return o[e](i&&i[a],aw({},r,{parent:i,path:t}))};for(const e of["equals","is"])ow.prototype[e]=ow.prototype.oneOf;for(const e of["not","nope"])ow.prototype[e]=ow.prototype.notOneOf;ow.prototype.optional=ow.prototype.notRequired;const sw=ow;function uw(){return new sw}uw.prototype=sw.prototype;const cw=e=>null==e;function lw(){return new dw}class dw extends ow{constructor(){super({type:"boolean"}),this.withMutation((()=>{this.transform((function(e){if(!this.isType(e)){if(/^(true|1)$/i.test(String(e)))return!0;if(/^(false|0)$/i.test(String(e)))return!1}return e}))}))}_typeCheck(e){return e instanceof Boolean&&(e=e.valueOf()),"boolean"==typeof e}isTrue(e=_S.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"true"},test:e=>cw(e)||!0===e})}isFalse(e=_S.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"false"},test:e=>cw(e)||!1===e})}}lw.prototype=dw.prototype;let fw=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i,pw=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,hw=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,mw=e=>cw(e)||e===e.trim(),gw={}.toString();function yw(){return new _w}class _w extends ow{constructor(){super({type:"string"}),this.withMutation((()=>{this.transform((function(e){if(this.isType(e))return e;if(Array.isArray(e))return e;const t=null!=e&&e.toString?e.toString():e;return t===gw?e:t}))}))}_typeCheck(e){return e instanceof String&&(e=e.valueOf()),"string"==typeof e}_isPresent(e){return super._isPresent(e)&&!!e.length}length(e,t=mS.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},test(t){return cw(t)||t.length===this.resolve(e)}})}min(e,t=mS.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},test(t){return cw(t)||t.length>=this.resolve(e)}})}max(e,t=mS.max){return this.test({name:"max",exclusive:!0,message:t,params:{max:e},test(t){return cw(t)||t.length<=this.resolve(e)}})}matches(e,t){let n,r,i=!1;return t&&("object"==typeof t?({excludeEmptyString:i=!1,message:n,name:r}=t):n=t),this.test({name:r||"matches",message:n||mS.matches,params:{regex:e},test:t=>cw(t)||""===t&&i||-1!==t.search(e)})}email(e=mS.email){return this.matches(fw,{name:"email",message:e,excludeEmptyString:!0})}url(e=mS.url){return this.matches(pw,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=mS.uuid){return this.matches(hw,{name:"uuid",message:e,excludeEmptyString:!1})}ensure(){return this.default("").transform((e=>null===e?"":e))}trim(e=mS.trim){return this.transform((e=>null!=e?e.trim():e)).test({message:e,name:"trim",test:mw})}lowercase(e=mS.lowercase){return this.transform((e=>cw(e)?e:e.toLowerCase())).test({message:e,name:"string_case",exclusive:!0,test:e=>cw(e)||e===e.toLowerCase()})}uppercase(e=mS.uppercase){return this.transform((e=>cw(e)?e:e.toUpperCase())).test({message:e,name:"string_case",exclusive:!0,test:e=>cw(e)||e===e.toUpperCase()})}}yw.prototype=_w.prototype;function vw(){return new bw}class bw extends ow{constructor(){super({type:"number"}),this.withMutation((()=>{this.transform((function(e){let t=e;if("string"==typeof t){if(t=t.replace(/\s/g,""),""===t)return NaN;t=+t}return this.isType(t)?t:parseFloat(t)}))}))}_typeCheck(e){return e instanceof Number&&(e=e.valueOf()),"number"==typeof e&&!(e=>e!=+e)(e)}min(e,t=gS.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},test(t){return cw(t)||t>=this.resolve(e)}})}max(e,t=gS.max){return this.test({message:t,name:"max",exclusive:!0,params:{max:e},test(t){return cw(t)||t<=this.resolve(e)}})}lessThan(e,t=gS.lessThan){return this.test({message:t,name:"max",exclusive:!0,params:{less:e},test(t){return cw(t)||t<this.resolve(e)}})}moreThan(e,t=gS.moreThan){return this.test({message:t,name:"min",exclusive:!0,params:{more:e},test(t){return cw(t)||t>this.resolve(e)}})}positive(e=gS.positive){return this.moreThan(0,e)}negative(e=gS.negative){return this.lessThan(0,e)}integer(e=gS.integer){return this.test({name:"integer",message:e,test:e=>cw(e)||Number.isInteger(e)})}truncate(){return this.transform((e=>cw(e)?e:0|e))}round(e){var t;let n=["ceil","floor","round","trunc"];if("trunc"===(e=(null==(t=e)?void 0:t.toLowerCase())||"round"))return this.truncate();if(-1===n.indexOf(e.toLowerCase()))throw new TypeError("Only valid options for round() are: "+n.join(", "));return this.transform((t=>cw(t)?t:Math[e](t)))}}vw.prototype=bw.prototype;var Ew=/^(\d{4}|[+\-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,\.](\d{1,}))?)?(?:(Z)|([+\-])(\d{2})(?::?(\d{2}))?)?)?$/;let Sw=new Date("");function Aw(){return new xw}class xw extends ow{constructor(){super({type:"date"}),this.withMutation((()=>{this.transform((function(e){return this.isType(e)?e:(e=function(e){var t,n,r=[1,4,5,6,7,10,11],i=0;if(n=Ew.exec(e)){for(var a,o=0;a=r[o];++o)n[a]=+n[a]||0;n[2]=(+n[2]||1)-1,n[3]=+n[3]||1,n[7]=n[7]?String(n[7]).substr(0,3):0,void 0!==n[8]&&""!==n[8]||void 0!==n[9]&&""!==n[9]?("Z"!==n[8]&&void 0!==n[9]&&(i=60*n[10]+n[11],"+"===n[9]&&(i=0-i)),t=Date.UTC(n[1],n[2],n[3],n[4],n[5]+i,n[6],n[7])):t=+new Date(n[1],n[2],n[3],n[4],n[5],n[6],n[7])}else t=Date.parse?Date.parse(e):NaN;return t}(e),isNaN(e)?Sw:new Date(e))}))}))}_typeCheck(e){return t=e,"[object Date]"===Object.prototype.toString.call(t)&&!isNaN(e.getTime());var t}prepareParam(e,t){let n;if(ew.isRef(e))n=e;else{let r=this.cast(e);if(!this._typeCheck(r))throw new TypeError(`\`${t}\` must be a Date or a value that can be \`cast()\` to a Date`);n=r}return n}min(e,t=yS.min){let n=this.prepareParam(e,"min");return this.test({message:t,name:"min",exclusive:!0,params:{min:e},test(e){return cw(e)||e>=this.resolve(n)}})}max(e,t=yS.max){let n=this.prepareParam(e,"max");return this.test({message:t,name:"max",exclusive:!0,params:{max:e},test(e){return cw(e)||e<=this.resolve(n)}})}}xw.INVALID_DATE=Sw,Aw.prototype=xw.prototype,Aw.INVALID_DATE=Sw;var ww=function(e,t,n,r){var i=-1,a=null==e?0:e.length;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n};var Tw=function(e){return function(t){return null==e?void 0:e[t]}},Mw=Tw({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Ow=th,Cw=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Nw=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");var Dw=function(e){return(e=Ow(e))&&e.replace(Cw,Mw).replace(Nw,"")},Lw=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var Iw=function(e){return e.match(Lw)||[]},kw=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var $w=function(e){return kw.test(e)},Rw="\\ud800-\\udfff",Fw="\\u2700-\\u27bf",zw="a-z\\xdf-\\xf6\\xf8-\\xff",Pw="A-Z\\xc0-\\xd6\\xd8-\\xde",jw="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Zw="["+jw+"]",Uw="\\d+",Bw="["+Fw+"]",Vw="["+zw+"]",Hw="[^"+Rw+jw+Uw+Fw+zw+Pw+"]",Gw="(?:\\ud83c[\\udde6-\\uddff]){2}",Yw="[\\ud800-\\udbff][\\udc00-\\udfff]",Ww="["+Pw+"]",qw="(?:"+Vw+"|"+Hw+")",Kw="(?:"+Ww+"|"+Hw+")",Jw="(?:['’](?:d|ll|m|re|s|t|ve))?",Xw="(?:['’](?:D|LL|M|RE|S|T|VE))?",Qw="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",eT="[\\ufe0e\\ufe0f]?",tT=eT+Qw+("(?:\\u200d(?:"+["[^"+Rw+"]",Gw,Yw].join("|")+")"+eT+Qw+")*"),nT="(?:"+[Bw,Gw,Yw].join("|")+")"+tT,rT=RegExp([Ww+"?"+Vw+"+"+Jw+"(?="+[Zw,Ww,"$"].join("|")+")",Kw+"+"+Xw+"(?="+[Zw,Ww+qw,"$"].join("|")+")",Ww+"?"+qw+"+"+Jw,Ww+"+"+Xw,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Uw,nT].join("|"),"g");var iT=function(e){return e.match(rT)||[]},aT=Iw,oT=$w,sT=th,uT=iT;var cT=function(e,t,n){return e=sT(e),void 0===(t=n?void 0:t)?oT(e)?uT(e):aT(e):e.match(t)||[]},lT=ww,dT=Dw,fT=cT,pT=RegExp("['’]","g");var hT=function(e){return function(t){return lT(fT(dT(t).replace(pT,"")),e,"")}},mT=hT((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()})),gT=mT,yT=Ih,_T=hT((function(e,t,n){return t=t.toLowerCase(),e+(n?yT(t):t)})),vT=_T,bT=Mr,ET=lA,ST=Ix;var AT=function(e,t){var n={};return t=ST(t),ET(e,(function(e,r,i){bT(n,t(e,r,i),e)})),n},xT={exports:{}};function wT(e,t){var n=e.length,r=new Array(n),i={},a=n,o=function(e){for(var t=new Map,n=0,r=e.length;n<r;n++){var i=e[n];t.has(i[0])||t.set(i[0],new Set),t.has(i[1])||t.set(i[1],new Set),t.get(i[0]).add(i[1])}return t}(t),s=function(e){for(var t=new Map,n=0,r=e.length;n<r;n++)t.set(e[n],n);return t}(e);for(t.forEach((function(e){if(!s.has(e[0])||!s.has(e[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")}));a--;)i[a]||u(e[a],a,new Set);return r;function u(e,t,a){if(a.has(e)){var c;try{c=", node was:"+JSON.stringify(e)}catch(e){c=""}throw new Error("Cyclic dependency"+c)}if(!s.has(e))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(e));if(!i[t]){i[t]=!0;var l=o.get(e)||new Set;if(t=(l=Array.from(l)).length){a.add(e);do{var d=l[--t];u(d,s.get(d),a)}while(t);a.delete(e)}r[--n]=e}}}function TT(e,t){let n=1/0;return e.some(((e,r)=>{var i;if(-1!==(null==(i=t.path)?void 0:i.indexOf(e)))return n=r,!0})),n}function MT(e){return(t,n)=>TT(e,t)-TT(e,n)}function OT(){return OT=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},OT.apply(this,arguments)}xT.exports=function(e){return wT(function(e){for(var t=new Set,n=0,r=e.length;n<r;n++){var i=e[n];t.add(i[0]),t.add(i[1])}return Array.from(t)}(e),e)},xT.exports.array=wT;let CT=e=>"[object Object]"===Object.prototype.toString.call(e);const NT=MT([]);class DT extends ow{constructor(e){super({type:"object"}),this.fields=Object.create(null),this._sortErrors=NT,this._nodes=[],this._excludedEdges=[],this.withMutation((()=>{this.transform((function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(t){e=null}return this.isType(e)?e:null})),e&&this.shape(e)}))}_typeCheck(e){return CT(e)||"function"==typeof e}_cast(e,t={}){var n;let r=super._cast(e,t);if(void 0===r)return this.getDefault();if(!this._typeCheck(r))return r;let i=this.fields,a=null!=(n=t.stripUnknown)?n:this.spec.noUnknown,o=this._nodes.concat(Object.keys(r).filter((e=>-1===this._nodes.indexOf(e)))),s={},u=OT({},t,{parent:s,__validating:t.__validating||!1}),c=!1;for(const e of o){let n=i[e],o=XS(r,e);if(n){let i,a=r[e];u.path=(t.path?`${t.path}.`:"")+e,n=n.resolve({value:a,context:t.context,parent:s});let o="spec"in n?n.spec:void 0,l=null==o?void 0:o.strict;if(null==o?void 0:o.strip){c=c||e in r;continue}i=t.__validating&&l?r[e]:n.cast(r[e],u),void 0!==i&&(s[e]=i)}else o&&!a&&(s[e]=r[e]);s[e]!==r[e]&&(c=!0)}return c?s:r}_validate(e,t={},n){let r=[],{sync:i,from:a=[],originalValue:o=e,abortEarly:s=this.spec.abortEarly,recursive:u=this.spec.recursive}=t;a=[{schema:this,value:o},...a],t.__validating=!0,t.originalValue=o,t.from=a,super._validate(e,t,((e,c)=>{if(e){if(!iA.isError(e)||s)return void n(e,c);r.push(e)}if(!u||!CT(c))return void n(r[0]||null,c);o=o||c;let l=this._nodes.map((e=>(n,r)=>{let i=-1===e.indexOf(".")?(t.path?`${t.path}.`:"")+e:`${t.path||""}["${e}"]`,s=this.fields[e];s&&"validate"in s?s.validate(c[e],OT({},t,{path:i,from:a,strict:!0,parent:c,originalValue:o[e]}),r):r(null)}));aA({sync:i,tests:l,value:c,errors:r,endEarly:s,sort:this._sortErrors,path:t.path},n)}))}clone(e){const t=super.clone(e);return t.fields=OT({},this.fields),t._nodes=this._nodes,t._excludedEdges=this._excludedEdges,t._sortErrors=this._sortErrors,t}concat(e){let t=super.concat(e),n=t.fields;for(let[e,t]of Object.entries(this.fields)){const r=n[e];void 0===r?n[e]=t:r instanceof ow&&t instanceof ow&&(n[e]=t.concat(r))}return t.withMutation((()=>t.shape(n,this._excludedEdges)))}getDefaultFromShape(){let e={};return this._nodes.forEach((t=>{const n=this.fields[t];e[t]="default"in n?n.getDefault():void 0})),e}_getDefault(){return"default"in this.spec?super._getDefault():this._nodes.length?this.getDefaultFromShape():void 0}shape(e,t=[]){let n=this.clone(),r=Object.assign(n.fields,e);return n.fields=r,n._sortErrors=MT(Object.keys(r)),t.length&&(Array.isArray(t[0])||(t=[t]),n._excludedEdges=[...n._excludedEdges,...t]),n._nodes=function(e,t=[]){let n=[],r=new Set,i=new Set(t.map((([e,t])=>`${e}-${t}`)));function a(e,t){let a=Yx.split(e)[0];r.add(a),i.has(`${t}-${a}`)||n.push([t,a])}for(const t in e)if(XS(e,t)){let n=e[t];r.add(t),ew.isRef(n)&&n.isSibling?a(n.path,t):QS(n)&&"deps"in n&&n.deps.forEach((e=>a(e,t)))}return xT.exports.array(Array.from(r),n).reverse()}(r,n._excludedEdges),n}pick(e){const t={};for(const n of e)this.fields[n]&&(t[n]=this.fields[n]);return this.clone().withMutation((e=>(e.fields={},e.shape(t))))}omit(e){const t=this.clone(),n=t.fields;t.fields={};for(const t of e)delete n[t];return t.withMutation((()=>t.shape(n)))}from(e,t,n){let r=Yx.getter(e,!0);return this.transform((i=>{if(null==i)return i;let a=i;return XS(i,e)&&(a=OT({},i),n||delete a[e],a[t]=r(i)),a}))}noUnknown(e=!0,t=vS.noUnknown){"string"==typeof e&&(t=e,e=!0);let n=this.test({name:"noUnknown",exclusive:!0,message:t,test(t){if(null==t)return!0;const n=function(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter((e=>-1===n.indexOf(e)))}(this.schema,t);return!e||0===n.length||this.createError({params:{unknown:n.join(", ")}})}});return n.spec.noUnknown=e,n}unknown(e=!0,t=vS.noUnknown){return this.noUnknown(!e,t)}transformKeys(e){return this.transform((t=>t&&AT(t,((t,n)=>e(n)))))}camelCase(){return this.transformKeys(vT)}snakeCase(){return this.transformKeys(gT)}constantCase(){return this.transformKeys((e=>gT(e).toUpperCase()))}describe(){let e=super.describe();return e.fields=Fx(this.fields,(e=>e.describe())),e}}function LT(e){return new DT(e)}function IT(){return IT=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},IT.apply(this,arguments)}function kT(e){return new $T(e)}LT.prototype=DT.prototype;class $T extends ow{constructor(e){super({type:"array"}),this.innerType=void 0,this.innerType=e,this.withMutation((()=>{this.transform((function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(t){e=null}return this.isType(e)?e:null}))}))}_typeCheck(e){return Array.isArray(e)}get _subType(){return this.innerType}_cast(e,t){const n=super._cast(e,t);if(!this._typeCheck(n)||!this.innerType)return n;let r=!1;const i=n.map(((e,n)=>{const i=this.innerType.cast(e,IT({},t,{path:`${t.path||""}[${n}]`}));return i!==e&&(r=!0),i}));return r?i:n}_validate(e,t={},n){var r,i;let a=[],o=t.sync,s=t.path,u=this.innerType,c=null!=(r=t.abortEarly)?r:this.spec.abortEarly,l=null!=(i=t.recursive)?i:this.spec.recursive,d=null!=t.originalValue?t.originalValue:e;super._validate(e,t,((e,r)=>{if(e){if(!iA.isError(e)||c)return void n(e,r);a.push(e)}if(!l||!u||!this._typeCheck(r))return void n(a[0]||null,r);d=d||r;let i=new Array(r.length);for(let e=0;e<r.length;e++){let n=r[e],a=`${t.path||""}[${e}]`,o=IT({},t,{path:a,strict:!0,parent:r,index:e,originalValue:d[e]});i[e]=(e,t)=>u.validate(n,o,t)}aA({sync:o,path:s,value:r,errors:a,endEarly:c,tests:i},n)}))}clone(e){const t=super.clone(e);return t.innerType=this.innerType,t}concat(e){let t=super.concat(e);return t.innerType=this.innerType,e.innerType&&(t.innerType=t.innerType?t.innerType.concat(e.innerType):e.innerType),t}of(e){let t=this.clone();if(!QS(e))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+pS(e));return t.innerType=e,t}length(e,t=bS.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},test(t){return cw(t)||t.length===this.resolve(e)}})}min(e,t){return t=t||bS.min,this.test({message:t,name:"min",exclusive:!0,params:{min:e},test(t){return cw(t)||t.length>=this.resolve(e)}})}max(e,t){return t=t||bS.max,this.test({message:t,name:"max",exclusive:!0,params:{max:e},test(t){return cw(t)||t.length<=this.resolve(e)}})}ensure(){return this.default((()=>[])).transform(((e,t)=>this._typeCheck(e)?e:null==t?[]:[].concat(t)))}compact(e){let t=e?(t,n,r)=>!e(t,n,r):e=>!!e;return this.transform((e=>null!=e?e.filter(t):e))}describe(){let e=super.describe();return this.innerType&&(e.innerType=this.innerType.describe()),e}nullable(e=!0){return super.nullable(e)}defined(){return super.defined()}required(e){return super.required(e)}}kT.prototype=$T.prototype;class RT{constructor(e){this.type="lazy",this.__isYupSchema__=!0,this.__inputType=void 0,this.__outputType=void 0,this._resolve=(e,t={})=>{let n=this.builder(e,t);if(!QS(n))throw new TypeError("lazy() functions must return a valid schema");return n.resolve(t)},this.builder=e}resolve(e){return this._resolve(e.value,e)}cast(e,t){return this._resolve(e,t).cast(e,t)}validate(e,t,n){return this._resolve(e,t).validate(e,t,n)}validateSync(e,t){return this._resolve(e,t).validateSync(e,t)}validateAt(e,t,n){return this._resolve(t,n).validateAt(e,t,n)}validateSyncAt(e,t,n){return this._resolve(t,n).validateSyncAt(e,t,n)}describe(){return null}isValid(e,t){return this._resolve(e,t).isValid(e,t)}isValidSync(e,t){return this._resolve(e,t).isValidSync(e,t)}}function FT(e,t,n){if(!e||!QS(e.prototype))throw new TypeError("You must provide a yup schema constructor function");if("string"!=typeof t)throw new TypeError("A Method name must be provided");if("function"!=typeof n)throw new TypeError("Method function must be provided");e.prototype[t]=n}var zT=Object.freeze({__proto__:null,mixed:uw,bool:lw,boolean:lw,string:yw,number:vw,date:Aw,object:LT,array:kT,ref:function(e,t){return new ew(e,t)},lazy:function(e){return new RT(e)},reach:(e,t,n,r)=>rw(e,t,n,r).schema,isSchema:QS,addMethod:FT,setLocale:function(e){Object.keys(e).forEach((t=>{Object.keys(e[t]).forEach((n=>{ES[t][n]=e[t][n]}))}))},ValidationError:iA,BaseSchema:ow,MixedSchema:sw,BooleanSchema:dw,StringSchema:_w,NumberSchema:bw,DateSchema:xw,ObjectSchema:DT,ArraySchema:$T});const PT=V.default.button`
|
|
180
180
|
background-color: ${n.Colour.bg};
|
|
181
181
|
border: ${n.Border["width-010"]} ${n.Border.solid} ${n.Colour.border};
|
|
182
182
|
border-radius: 1rem;
|
|
@@ -303,7 +303,7 @@ function tC(e){return"[object Object]"===Object.prototype.toString.call(e)}Objec
|
|
|
303
303
|
height: auto;
|
|
304
304
|
`,wI=({id:r,lat:a,lng:o,address:s,staticMapPinColor:u={r:28,g:118,b:213},className:c,onClick:l,disabled:d})=>{const f=t.useRef(!1),[p,h]=t.useState(""),m=t.useRef([0,0]),g=t.useContext(i.ThemeContext);t.useEffect((()=>(window.addEventListener("resize",y),a&&o&&y(),()=>{window.removeEventListener("resize",y)})),[a,o]);const y=()=>{if(!a||!o)return;const e=window.matchMedia(`(max-width: ${n.Breakpoint["sm-max"]({theme:g})}px)`).matches;if(f.current!==e||m.current[0]!==a||m.current[1]!==o){f.current=e;const t=e?SI.mobile:SI.desktop,n=15,r=t.height+n;h(exports.LocationHelper.getStaticMapUrl(a,o,t.width,r,u)),m.current=[a,o]}};return a&&o?e.jsx(AI,{id:exports.TestHelper.generateId(r,"static-map"),"data-testid":exports.TestHelper.generateId(r,"static-map"),className:c,onClick:l,"aria-disabled":d,children:e.jsx(xI,{alt:s||"Location Map",src:p,onError:e=>{e.currentTarget.src="https://assets.life.gov.sg/web-frontend-engine/img/map/static_map_placeholder.png"}})}):null},TI=({id:t,message:n,className:r})=>n?e.jsx(MI,{type:"warning","data-testid":exports.TestHelper.generateId(t,"warning"),className:r,children:n}):null,MI=V.default(c.Alert)`
|
|
305
305
|
margin: -1rem 0rem 2rem;
|
|
306
|
-
`,OI=["required","length","min","max","matches","email","url","uuid","positive","negative","integer","lessThan","moreThan","when","filled","empty","equals","notEquals","includes","excludes","uinfin","equalsField","withinDays"];var CI;!function(e){const t=[],n={};e.buildSchema=(t,n)=>{const i={},[a,o]=r(t);return Object.keys(a).forEach((n=>{const{schema:r,validationRules:a}=t[n];i[n]=e.buildFieldSchema(r,a)})),LT().meta({yupId:n}).shape(i,o)};const r=e=>{const t=[],n={...e};return Object.entries(n).forEach((([e,{validationRules:r}])=>{const[a,o]=i(e,n,r);t.push(...o),n[e].validationRules=a})),[n,t]},i=(e,t,n)=>{const r=[],a=n?.filter((e=>!("when"in e)))||[];return n?.filter((e=>"when"in e)).forEach((n=>{const o={...n,when:n.when?{...n.when}:void 0};Object.keys(o.when).forEach((n=>{if(!t[n])return void console.warn(`field "${n}" was not found, when condition on "${e}" was not applied`);r.push([e,n]),o.when[n]={...o.when[n],yupSchema:t[n].schema.clone()};const[a,s]=i(e,t,o.when[n].then);o.when[n].then=a,r.push(...s)})),a.push(o)})),[a,r]};e.buildFieldSchema=(n,r)=>{const i=r.filter((e=>iS(OI,Object.keys(e)).length>0||iS(t,Object.keys(e)).length>0));return e.mapRules(n,i)},e.mapSchemaType=e=>{switch(e){case"string":return yw().typeError("Only string values are allowed");case"number":return vw().typeError("Only number values are allowed");case"boolean":return lw().strict().typeError("Only boolean values are allowed");case"array":return kT().typeError("Only array values are allowed");case"object":return LT().typeError("Only object values are allowed");default:return uw()}},e.mapRules=(n,r)=>(r.forEach((r=>{const i=Object.keys(r).filter((e=>OI.includes(e)))?.[0];switch(!0){case r.required:n=n.required(r.errorMessage||tm.COMMON.FIELD_REQUIRED);break;case!!r.email:case!!r.url:case!!r.uuid:case!!r.positive:case!!r.negative:case!!r.integer:try{n=n[i](r.errorMessage)}catch(e){console.warn(`error applying "${i}" condition to ${n.type} schema`)}break;case r.length>0:case!isNaN(r.min):case!isNaN(r.max):case!isNaN(r.lessThan):case!isNaN(r.moreThan):try{n=n[i](r[i],r.errorMessage)}catch(e){console.warn(`error applying "${i}" condition to ${n.type} schema`)}break;case!!r.matches:{const e=r.matches.match(/\/(.*)\/([a-z]+)?/);try{n=n.matches(new RegExp(e[1],e[2]),r.errorMessage)}catch(e){console.warn(`error applying "${i}" condition to ${n.type} schema`)}}break;case!!r.when:Object.keys(r.when).forEach((t=>{const i=r.when[t]?.yupSchema;if(!i)return void console.warn(`[mapRules] Unexpected: yupSchema missing for field "${t}" in when condition. `);const a=r.when[t].is,o=e.mapRules(n,r.when[t].then),s=r.when[t].otherwise&&e.mapRules(n,r.when[t].otherwise);n=Array.isArray(a)&&a.every((e=>"object"==typeof e))?n.when(t,(t=>{const n=e.mapRules(i.clone(),a);let r=!1;try{n.validateSync(t),r=!0}catch(e){}return r?o:s})):n.when(t,{is:a,then:o,otherwise:s})}))}const a=Object.keys(r).filter((e=>t.includes(e)))?.[0];a&&(n[a]?n=n[a](r[a],r.errorMessage):console.warn(`error applying "${a}" condition to ${n.type} schema`)),n&&(n=n.transform((e=>{if(null!==e&&""!==e&&("object"!=typeof e||0!==Object.keys(e).length))return e})))})),n),e.addCondition=(e,r,i,a,o=!1)=>{if(a){if(n[a]||(n[a]={}),n[a][r]&&!0!==o)return void console.warn(`the validation condition "${r}" is not added because it already exists!`);n[a][r]=i}else if(t.includes(r)&&!0!==o)return void console.warn(`the validation condition "${r}" is not added because it already exists!`);t.includes(r)||t.push(r),FT(zT[e],r,(function(e,t){return this.test({name:r,message:t,test:(t,o)=>{if(!a)return i(t,e,o);const s=o.options.from.length,u=o.options.from[s-1].schema.describe().meta.yupId;return n[u]?.[r]?.(t,e,o)}})}))}}(CI||(CI={}));var NI=sn,DI=Rr;var LI=function(e){return!0===e||!1===e||DI(e)&&"[object Boolean]"==NI(e)},II=VA;var kI=function(e,t){return II(e,t)},$I=sn,RI=Rr;var FI,zI=function(e){return"number"==typeof e||RI(e)&&"[object Number]"==$I(e)};!function(e){e.LOCAL_S_PREFIX="S",e.LOCAL_T_PREFIX="T",e.FOREIGN_F_PREFIX="F",e.FOREIGN_G_PREFIX="G",e.FOREIGN_M_PREFIX="M"}(FI||(FI={}));const PI=[2,7,6,5,4,3,2],jI=["J","Z","I","H","G","F","E","D","C","B","A"],ZI=["X","W","U","T","R","Q","P","N","M","L","K"],UI=["X","W","U","T","R","Q","P","N","J","L","K"];function BI(e){if("string"==typeof e){const t=function(e){return/^[STFGM]\d{7}[A-Z]$/.test(e)}(e),n=e.charAt(8)===function(e){let t=0;for(let n=0;n<7;++n)t+=Number(e.charAt(n+1))*PI[n];const n=e.charAt(0);n!==FI.LOCAL_T_PREFIX&&n!==FI.FOREIGN_G_PREFIX||(t+=4);n===FI.FOREIGN_M_PREFIX&&(t+=3);let r;r=n===FI.LOCAL_S_PREFIX||n===FI.LOCAL_T_PREFIX?jI[t%11]:n===FI.FOREIGN_M_PREFIX?UI[t%11]:ZI[t%11];return r}(e);return t&&n}return!1}CI.addCondition("string","uinfin",(e=>!!oE(e)||BI(e)));const VI=["LP","LL","FC","PF","RF","MQ","MM","NB","CC","CS","MB","FM","GS","GA","GB","DP","CP","NR","CM","CD","MD","HS","VH","CH","MH","CL","XL","CX","RP","TU","TC","FB","FN","PA","PB","SS","MC","SM"];CI.addCondition("string","uen",(e=>!!oE(e)||function(e){if(e.length<9||e.length>10)return!1;if(9===(e=e.toUpperCase()).length){if(e.match(/^\d{8}[A-Z]$/))return!0}else if(10===e.length){if(e.match(/^\d{9}[A-Z]$/))return!0;const t=String.raw`^((R|S|T)([\d]{2})(`+VI.join("|")+String.raw`)([\d]{4})([A-Z]))$`;if(e.match(t))return!0}return!1}(e)));const HI=e=>zI(e)?cE(e):oE(e)&&!LI(e);CI.addCondition("mixed","filled",(e=>!HI(e))),CI.addCondition("mixed","empty",(e=>HI(e))),CI.addCondition("mixed","equals",((e,t)=>!HI(e)&&kI(e,t))),CI.addCondition("mixed","notEquals",((e,t)=>!HI(e)&&!kI(e,t))),CI.addCondition("string","notMatches",((e,t)=>{if(HI(e))return!0;const n=t.match(/\/(.*)\/([a-z]+)?/);return!new RegExp(n[1],n[2]).test(e)})),CI.addCondition("string","noWhitespaceOnly",((e,t)=>!(!HI(e)&&t)||/\S/.test(e))),CI.addCondition("array","includes",((e,t)=>!e?.length||(Array.isArray(t)?t.filter((t=>e.includes(t))).length===t.length:e.includes(t)))),CI.addCondition("array","excludes",((e,t)=>!e?.length||(Array.isArray(t)?e.length&&0===t.filter((t=>e.includes(t))).length:!e.includes(t)))),CI.addCondition("mixed","equalsField",((e,t,n)=>{if("object"==typeof e){if(Array.isArray(e)&&Array.isArray(n.parent[`${t}`])){const r=[...e].sort(),i=[...n.parent[`${t}`]].sort();return kI(r,i)}return kI(e,n.parent[`${t}`])}return kI(e,n.parent[`${t}`])})),CI.addCondition("mixed","notEqualsField",((e,t,n)=>{if("object"==typeof e){if(Array.isArray(e)&&Array.isArray(n.parent[`${t}`])){const r=[...e].sort(),i=[...n.parent[`${t}`]].sort();return!kI(r,i)}return!kI(e,n.parent[`${t}`])}return!kI(e,n.parent[`${t}`])})),CI.addCondition("mixed","withinDays",((e,t)=>!!oE(e)||nm.checkWithinDays(e,t))),CI.addCondition("mixed","beyondDays",((e,t)=>!!oE(e)||nm.checkBeyondDays(e,t)));const GI=({children:t})=>e.jsx(dE,{children:e.jsx(Ss,{children:e.jsx(xs,{children:e.jsx(Ts,{children:e.jsx(bs,{children:e.jsx(Os,{children:t})})})})})}),YI=()=>{const{customComponents:e,setCustomComponents:n}=t.useContext(vs),r=t.useCallback((t=>e?.[t]),[e]);return{customComponents:e,getCustomComponent:r,setCustomComponents:n}},WI="undefined"!=typeof window?(e,n)=>{const r=t.useRef(n),i=t.useRef(0);return kI(n,r.current)||(r.current=n,i.current+=1),t.useLayoutEffect(e,[i.current])}:_s,qI=()=>{const{eventManagerRef:e}=t.useContext(Es),n=t.useCallback(((t,n,r,i,a)=>{if("function"==typeof r&&"function"!=typeof i){const[a,o,s,u]=[t,n,r,i];e.current?.addEventListener(`${o}:${a}`,s,u)}else if("function"==typeof i){const[o,s,u,c,l]=[t,n,r,i,a];e.current?.addEventListener(`${u}:${s}`,c,l)}}),[e]),r=t.useCallback(((t,n,r,i,a)=>{if("function"==typeof r&&"function"!=typeof i){const[a,o,s,u]=[t,n,r,i];e.current?.removeEventListener(`${o}:${a}`,s,u)}else if("function"==typeof i){const[o,s,u,c,l]=[t,n,r,i,a];e.current?.removeEventListener(`${u}:${s}`,c,l)}}),[e]);return{addFieldEventListener:n,dispatchFieldEvent:t.useCallback(((t,n,r,i)=>{if("string"!=typeof r){const[i,a,o]=[t,n,r];return e.current?.dispatchEvent(new CustomEvent(`${a}:${i}`,{cancelable:!0,detail:{id:a,...o}}))}{const[a,o,s,u]=[t,n,r,i];return e.current?.dispatchEvent(new CustomEvent(`${s}:${o}`,{cancelable:!0,detail:{id:s,...u}}))}}),[e]),removeFieldEventListener:r}};var KI=Mr,JI=wt;var XI=function(e,t,n){(void 0!==n&&!JI(e[t],n)||void 0===n&&!(t in e))&&KI(e,t,n)},QI=sn,ek=ua,tk=Rr,nk=Function.prototype,rk=Object.prototype,ik=nk.toString,ak=rk.hasOwnProperty,ok=ik.call(Object);var sk=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]},uk=kr,ck=Vi;var lk=XI,dk=Wi.exports,fk=uo,pk=qi,hk=So,mk=Vr,gk=Hr,yk=JE,_k=Gr.exports,vk=fn,bk=un,Ek=function(e){if(!tk(e)||"[object Object]"!=QI(e))return!1;var t=ek(e);if(null===t)return!0;var n=ak.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&ik.call(n)==ok},Sk=ui,Ak=sk,xk=function(e){return uk(e,ck(e))};var wk=function(e,t,n,r,i,a,o){var s=Ak(e,n),u=Ak(t,n),c=o.get(u);if(c)lk(e,n,c);else{var l=a?a(s,u,n+"",e,t,o):void 0,d=void 0===l;if(d){var f=gk(u),p=!f&&_k(u),h=!f&&!p&&Sk(u);l=u,f||p||h?gk(s)?l=s:yk(s)?l=pk(s):p?(d=!1,l=dk(u,!0)):h?(d=!1,l=fk(u,!0)):l=[]:Ek(u)||mk(u)?(l=s,mk(s)?l=xk(s):bk(s)&&!vk(s)||(l=hk(u))):d=!1}d&&(o.set(u,l),i(l,u,r,a,o),o.delete(u)),lk(e,n,l)}},Tk=Sr,Mk=XI,Ok=sA,Ck=wk,Nk=un,Dk=Vi,Lk=sk;var Ik=function e(t,n,r,i,a){t!==n&&Ok(n,(function(o,s){if(a||(a=new Tk),Nk(o))Ck(t,n,s,r,e,i,a);else{var u=i?i(Lk(t,s),o,s+"",t,n,a):void 0;void 0===u&&(u=o),Mk(t,s,u)}}),Dk)},kk=wt,$k=Mi,Rk=qr,Fk=un;var zk=function(e,t,n){if(!Fk(n))return!1;var r=typeof t;return!!("number"==r?$k(n)&&Rk(t,n.length):"string"==r&&t in n)&&kk(n[t],e)},Pk=WE,jk=zk;var Zk=function(e){return Pk((function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(a=e.length>3&&"function"==typeof a?(i--,a):void 0,o&&jk(n[0],n[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,a)}return t}))},Uk=Ik,Bk=Zk((function(e,t,n){Uk(e,t,n)})),Vk=Bk;const Hk=()=>{const{setFormSchema:e,formSchema:n}=t.useContext(As);return{setFormSchema:e,formSchema:n,overrideSchema:t.useCallback(((e,t)=>{if(oE(t)||"string"==typeof e)return e;let n={};if(Object.keys(e).forEach((e=>{const r=sE.getNestedValueByKey(t,e,{searchIn:["children"]});oE(r)||(n={...n,...r})})),!oE(n)){const t=ds(e),r=Vk(t,n);return sE.removeNil(r)}return e}),[])}},Gk=e=>{const n=xe(),{setFormValues:r,formValues:i,formValuesRef:a,registeredFields:o,setRegisteredFields:s}=t.useContext(ws),u=t.useCallback(((t,r=!1)=>{if("string"!=typeof t){if(Array.isArray(t)){if(r){const r=t.filter((e=>o.includes(e)));return e?.getValues(r)||n?.getValues(r)}return e?.getValues(t)||n?.getValues(t)}{const t=e?.getValues()||n?.getValues();if(r){const e={};return Object.entries(t).forEach((([t,n])=>{o.includes(t)&&(e[t]=n)})),e}return t}}if(!r||r&&o.includes(t))return e?.getValues(t)||n?.getValues(t)}),[n?.getValues,e?.getValues,o]);return{formValues:i,getField:e=>a.current[e],setFields:e=>{a.current={...a.current,...e},r((t=>({...t,...e})))},setField:(e,t)=>{a.current[e]=t,r((n=>({...n,[e]:t})))},resetFields:e=>{a.current={...e},r((()=>({...e})))},registeredFields:o,setRegisteredFields:s,getFormValues:u}},Yk=()=>{const{formValidationConfig:e,setFormValidationConfig:n}=t.useContext(lE);return{formValidationConfig:e,setFieldValidationConfig:(e,t,r=[])=>{n((n=>({...n,[e]:{schema:t,validationRules:r}})))},removeFieldValidationConfig:e=>n((t=>{const n={...t};return delete n[e],n}))}},Wk=()=>{const{submitHandler:e,setSubmitHandler:n,wrapInForm:r,setWrapInForm:i}=t.useContext(Ms);return{submitHandler:e,setSubmitHandler:n,wrapInForm:r,setWrapInForm:i}},qk=(e,n)=>{t.useEffect((()=>{const t=t=>{t.data.type===e&&n(t)};return window.addEventListener("message",t),()=>{window.removeEventListener("message",t)}}),[e,n])},Kk=e=>{const n=t.useRef();return t.useEffect((()=>{n.current=e}),[e]),n.current},Jk=()=>{const{formValidationConfig:e,warnings:n,setWarnings:r,yupId:i}=t.useContext(lE),[a,o]=t.useState(LT()),[s,u]=t.useState(LT()),c=t.useCallback((()=>{if(e){let t={},n={};Object.entries(e).forEach((([e,r])=>{if(!r.validationRules||0===r.validationRules.length)return void(t=sE.upsert(t,e,{schema:r.schema,validationRules:[]}));const i=r.validationRules.filter((({soft:e})=>e)),a=r.validationRules.filter((({soft:e})=>!e));i.length&&(n=sE.upsert(n,e,{schema:r.schema,validationRules:i})),a.length&&(t=sE.upsert(t,e,{schema:r.schema,validationRules:a}))})),u(CI.buildSchema(n,i)),o(CI.buildSchema(t,i))}}),[e,i]);t.useEffect((()=>{c()}),[c]);return{warnings:n,softValidationSchema:s,hardValidationSchema:a,rebuildValidationSchema:c,performSoftValidation:(e,t)=>{e.validate(t,{abortEarly:!1}).then((()=>{r({})})).catch((e=>{const t=e;if(oE(t))return;const n=t.inner.reduce(((e,t)=>(e[t.path]=t.message,e)),{});r(n)}))},addWarnings:e=>{r({...n,...e})},yupId:i}},Xk=()=>{const e=t.useContext(i.ThemeContext);return t.useCallback((()=>window.innerWidth<=n.Breakpoint["sm-max"]({theme:e})||window.innerWidth>window.innerHeight&&window.innerHeight<n.Breakpoint["sm-max"]({theme:e})),[e])},Qk=V.default.div`
|
|
306
|
+
`,OI=["required","length","min","max","matches","email","url","uuid","positive","negative","integer","lessThan","moreThan","when","filled","empty","equals","notEquals","includes","excludes","uinfin","equalsField","withinDays"];var CI;!function(e){const t=[],n={};e.buildSchema=(t,n)=>{const i={},[a,o]=r(t);return Object.keys(a).forEach((n=>{const{schema:r,validationRules:a}=t[n];i[n]=e.buildFieldSchema(r,a)})),LT().meta({yupId:n}).shape(i,o)};const r=e=>{const t=[],n={...e};return Object.entries(n).forEach((([e,{validationRules:r}])=>{const[a,o]=i(e,n,r);t.push(...o),n[e].validationRules=a})),[n,t]},i=(e,t,n)=>{const r=[],a=n?.filter((e=>!("when"in e)))||[];return n?.filter((e=>"when"in e)).forEach((n=>{const o={...n,when:n.when?{...n.when}:void 0};Object.keys(o.when).forEach((n=>{if(!t[n])return void console.warn(`field "${n}" was not found, when condition on "${e}" was not applied`);r.push([e,n]),o.when[n]={...o.when[n],yupSchema:t[n].schema.clone()};const[a,s]=i(e,t,o.when[n].then);o.when[n].then=a,r.push(...s)})),a.push(o)})),[a,r]};e.buildFieldSchema=(n,r)=>{const i=r.filter((e=>iS(OI,Object.keys(e)).length>0||iS(t,Object.keys(e)).length>0));return e.mapRules(n,i)},e.mapSchemaType=e=>{switch(e){case"string":return yw().typeError("Only string values are allowed");case"number":return vw().typeError("Only number values are allowed");case"boolean":return lw().strict().typeError("Only boolean values are allowed");case"array":return kT().typeError("Only array values are allowed");case"object":return LT().typeError("Only object values are allowed");default:return uw()}},e.mapRules=(n,r)=>(r.forEach((r=>{const i=Object.keys(r).filter((e=>OI.includes(e)))?.[0];switch(!0){case r.required:n=n.required(r.errorMessage||tm.COMMON.FIELD_REQUIRED);break;case!!r.email:case!!r.url:case!!r.uuid:case!!r.positive:case!!r.negative:case!!r.integer:try{n=n[i](r.errorMessage)}catch(e){console.warn(`error applying "${i}" condition to ${n.type} schema`)}break;case r.length>0:case!isNaN(r.min):case!isNaN(r.max):case!isNaN(r.lessThan):case!isNaN(r.moreThan):try{n=n[i](r[i],r.errorMessage)}catch(e){console.warn(`error applying "${i}" condition to ${n.type} schema`)}break;case!!r.matches:{const e=r.matches.match(/\/(.*)\/([a-z]+)?/);try{n=n.matches(new RegExp(e[1],e[2]),r.errorMessage)}catch(e){console.warn(`error applying "${i}" condition to ${n.type} schema`)}}break;case!!r.when:Object.keys(r.when).forEach((t=>{const i=r.when[t]?.yupSchema;if(!i)return void console.warn(`[mapRules] Unexpected: yupSchema missing for field "${t}" in when condition. `);const a=r.when[t].is,o=e.mapRules(n,r.when[t].then),s=r.when[t].otherwise&&e.mapRules(n,r.when[t].otherwise);n=Array.isArray(a)&&a.every((e=>"object"==typeof e))?n.when(t,(t=>{const n=e.mapRules(i.clone(),a);let r=!1;try{n.validateSync(t),r=!0}catch(e){}return r?o:s})):n.when(t,{is:a,then:o,otherwise:s})}))}const a=Object.keys(r).filter((e=>t.includes(e)))?.[0];a&&(n[a]?n=n[a](r[a],r.errorMessage):console.warn(`error applying "${a}" condition to ${n.type} schema`)),n&&(n=n.transform((e=>{if(null!==e&&""!==e&&("object"!=typeof e||0!==Object.keys(e).length))return e})))})),n),e.addCondition=(e,r,i,a,o=!1)=>{if(a){if(n[a]||(n[a]={}),n[a][r]&&!0!==o)return void console.warn(`the validation condition "${r}" is not added because it already exists!`);n[a][r]=i}else if(t.includes(r)&&!0!==o)return void console.warn(`the validation condition "${r}" is not added because it already exists!`);t.includes(r)||t.push(r),FT(zT[e],r,(function(e,t){return this.test({name:r,message:t,test:(t,o)=>{if(!a)return i(t,e,o);const s=o.options.from.length,u=o.options.from[s-1].schema.describe().meta.yupId;return n[u]?.[r]?.(t,e,o)}})}))}}(CI||(CI={}));var NI=sn,DI=Rr;var LI=function(e){return!0===e||!1===e||DI(e)&&"[object Boolean]"==NI(e)},II=VA;var kI=function(e,t){return II(e,t)},$I=sn,RI=Rr;var FI,zI=function(e){return"number"==typeof e||RI(e)&&"[object Number]"==$I(e)};!function(e){e.LOCAL_S_PREFIX="S",e.LOCAL_T_PREFIX="T",e.FOREIGN_F_PREFIX="F",e.FOREIGN_G_PREFIX="G",e.FOREIGN_M_PREFIX="M"}(FI||(FI={}));const PI=[2,7,6,5,4,3,2],jI=["J","Z","I","H","G","F","E","D","C","B","A"],ZI=["X","W","U","T","R","Q","P","N","M","L","K"],UI=["X","W","U","T","R","Q","P","N","J","L","K"];function BI(e){if("string"==typeof e){const t=function(e){return/^[STFGM]\d{7}[A-Z]$/.test(e)}(e),n=e.charAt(8)===function(e){let t=0;for(let n=0;n<7;++n)t+=Number(e.charAt(n+1))*PI[n];const n=e.charAt(0);n!==FI.LOCAL_T_PREFIX&&n!==FI.FOREIGN_G_PREFIX||(t+=4);n===FI.FOREIGN_M_PREFIX&&(t+=3);let r;r=n===FI.LOCAL_S_PREFIX||n===FI.LOCAL_T_PREFIX?jI[t%11]:n===FI.FOREIGN_M_PREFIX?UI[t%11]:ZI[t%11];return r}(e);return t&&n}return!1}CI.addCondition("string","uinfin",(e=>!!oE(e)||BI(e)));const VI=["LP","LL","FC","PF","RF","MQ","MM","NB","CC","CS","MB","FM","GS","GA","GB","DP","CP","NR","CM","CD","MD","HS","VH","CH","MH","CL","XL","CX","RP","TU","TC","FB","FN","PA","PB","SS","MC","SM"];CI.addCondition("string","uen",(e=>!!oE(e)||function(e){if(e.length<9||e.length>10)return!1;if(9===(e=e.toUpperCase()).length){if(e.match(/^\d{8}[A-Z]$/))return!0}else if(10===e.length){if(e.match(/^\d{9}[A-Z]$/))return!0;const t=String.raw`^((R|S|T)([\d]{2})(`+VI.join("|")+String.raw`)([\d]{4})([A-Z]))$`;if(e.match(t))return!0}return!1}(e)));const HI=e=>zI(e)?cE(e):oE(e)&&!LI(e);CI.addCondition("mixed","filled",(e=>!HI(e))),CI.addCondition("mixed","empty",(e=>HI(e))),CI.addCondition("mixed","equals",((e,t)=>!HI(e)&&kI(e,t))),CI.addCondition("mixed","notEquals",((e,t)=>!HI(e)&&!kI(e,t))),CI.addCondition("string","notMatches",((e,t)=>{if(HI(e))return!0;const n=t.match(/\/(.*)\/([a-z]+)?/);return!new RegExp(n[1],n[2]).test(e)})),CI.addCondition("string","noWhitespaceOnly",((e,t)=>!(!HI(e)&&t)||/\S/.test(e))),CI.addCondition("string","whitespace",((e,t)=>!(!HI(e)&&t&&("object"!=typeof t||LI(t.noLeadingOrTrailingWhitespace)))||("object"!=typeof t||t.noLeadingOrTrailingWhitespace?/^(?!\s+$)(?!\s).*(?<!\s)$/.test(e):/\S/.test(e)))),CI.addCondition("array","includes",((e,t)=>!e?.length||(Array.isArray(t)?t.filter((t=>e.includes(t))).length===t.length:e.includes(t)))),CI.addCondition("array","excludes",((e,t)=>!e?.length||(Array.isArray(t)?e.length&&0===t.filter((t=>e.includes(t))).length:!e.includes(t)))),CI.addCondition("mixed","equalsField",((e,t,n)=>{if("object"==typeof e){if(Array.isArray(e)&&Array.isArray(n.parent[`${t}`])){const r=[...e].sort(),i=[...n.parent[`${t}`]].sort();return kI(r,i)}return kI(e,n.parent[`${t}`])}return kI(e,n.parent[`${t}`])})),CI.addCondition("mixed","notEqualsField",((e,t,n)=>{if("object"==typeof e){if(Array.isArray(e)&&Array.isArray(n.parent[`${t}`])){const r=[...e].sort(),i=[...n.parent[`${t}`]].sort();return!kI(r,i)}return!kI(e,n.parent[`${t}`])}return!kI(e,n.parent[`${t}`])})),CI.addCondition("mixed","withinDays",((e,t)=>!!oE(e)||nm.checkWithinDays(e,t))),CI.addCondition("mixed","beyondDays",((e,t)=>!!oE(e)||nm.checkBeyondDays(e,t)));const GI=({children:t})=>e.jsx(dE,{children:e.jsx(Ss,{children:e.jsx(xs,{children:e.jsx(Ts,{children:e.jsx(bs,{children:e.jsx(Os,{children:t})})})})})}),YI=()=>{const{customComponents:e,setCustomComponents:n}=t.useContext(vs),r=t.useCallback((t=>e?.[t]),[e]);return{customComponents:e,getCustomComponent:r,setCustomComponents:n}},WI="undefined"!=typeof window?(e,n)=>{const r=t.useRef(n),i=t.useRef(0);return kI(n,r.current)||(r.current=n,i.current+=1),t.useLayoutEffect(e,[i.current])}:_s,qI=()=>{const{eventManagerRef:e}=t.useContext(Es),n=t.useCallback(((t,n,r,i,a)=>{if("function"==typeof r&&"function"!=typeof i){const[a,o,s,u]=[t,n,r,i];e.current?.addEventListener(`${o}:${a}`,s,u)}else if("function"==typeof i){const[o,s,u,c,l]=[t,n,r,i,a];e.current?.addEventListener(`${u}:${s}`,c,l)}}),[e]),r=t.useCallback(((t,n,r,i,a)=>{if("function"==typeof r&&"function"!=typeof i){const[a,o,s,u]=[t,n,r,i];e.current?.removeEventListener(`${o}:${a}`,s,u)}else if("function"==typeof i){const[o,s,u,c,l]=[t,n,r,i,a];e.current?.removeEventListener(`${u}:${s}`,c,l)}}),[e]);return{addFieldEventListener:n,dispatchFieldEvent:t.useCallback(((t,n,r,i)=>{if("string"!=typeof r){const[i,a,o]=[t,n,r];return e.current?.dispatchEvent(new CustomEvent(`${a}:${i}`,{cancelable:!0,detail:{id:a,...o}}))}{const[a,o,s,u]=[t,n,r,i];return e.current?.dispatchEvent(new CustomEvent(`${s}:${o}`,{cancelable:!0,detail:{id:s,...u}}))}}),[e]),removeFieldEventListener:r}};var KI=Mr,JI=wt;var XI=function(e,t,n){(void 0!==n&&!JI(e[t],n)||void 0===n&&!(t in e))&&KI(e,t,n)},QI=sn,ek=ua,tk=Rr,nk=Function.prototype,rk=Object.prototype,ik=nk.toString,ak=rk.hasOwnProperty,ok=ik.call(Object);var sk=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]},uk=kr,ck=Vi;var lk=XI,dk=Wi.exports,fk=uo,pk=qi,hk=So,mk=Vr,gk=Hr,yk=JE,_k=Gr.exports,vk=fn,bk=un,Ek=function(e){if(!tk(e)||"[object Object]"!=QI(e))return!1;var t=ek(e);if(null===t)return!0;var n=ak.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&ik.call(n)==ok},Sk=ui,Ak=sk,xk=function(e){return uk(e,ck(e))};var wk=function(e,t,n,r,i,a,o){var s=Ak(e,n),u=Ak(t,n),c=o.get(u);if(c)lk(e,n,c);else{var l=a?a(s,u,n+"",e,t,o):void 0,d=void 0===l;if(d){var f=gk(u),p=!f&&_k(u),h=!f&&!p&&Sk(u);l=u,f||p||h?gk(s)?l=s:yk(s)?l=pk(s):p?(d=!1,l=dk(u,!0)):h?(d=!1,l=fk(u,!0)):l=[]:Ek(u)||mk(u)?(l=s,mk(s)?l=xk(s):bk(s)&&!vk(s)||(l=hk(u))):d=!1}d&&(o.set(u,l),i(l,u,r,a,o),o.delete(u)),lk(e,n,l)}},Tk=Sr,Mk=XI,Ok=sA,Ck=wk,Nk=un,Dk=Vi,Lk=sk;var Ik=function e(t,n,r,i,a){t!==n&&Ok(n,(function(o,s){if(a||(a=new Tk),Nk(o))Ck(t,n,s,r,e,i,a);else{var u=i?i(Lk(t,s),o,s+"",t,n,a):void 0;void 0===u&&(u=o),Mk(t,s,u)}}),Dk)},kk=wt,$k=Mi,Rk=qr,Fk=un;var zk=function(e,t,n){if(!Fk(n))return!1;var r=typeof t;return!!("number"==r?$k(n)&&Rk(t,n.length):"string"==r&&t in n)&&kk(n[t],e)},Pk=WE,jk=zk;var Zk=function(e){return Pk((function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(a=e.length>3&&"function"==typeof a?(i--,a):void 0,o&&jk(n[0],n[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,a)}return t}))},Uk=Ik,Bk=Zk((function(e,t,n){Uk(e,t,n)})),Vk=Bk;const Hk=()=>{const{setFormSchema:e,formSchema:n}=t.useContext(As);return{setFormSchema:e,formSchema:n,overrideSchema:t.useCallback(((e,t)=>{if(oE(t)||"string"==typeof e)return e;let n={};if(Object.keys(e).forEach((e=>{const r=sE.getNestedValueByKey(t,e,{searchIn:["children"]});oE(r)||(n={...n,...r})})),!oE(n)){const t=ds(e),r=Vk(t,n);return sE.removeNil(r)}return e}),[])}},Gk=e=>{const n=xe(),{setFormValues:r,formValues:i,formValuesRef:a,registeredFields:o,setRegisteredFields:s}=t.useContext(ws),u=t.useCallback(((t,r=!1)=>{if("string"!=typeof t){if(Array.isArray(t)){if(r){const r=t.filter((e=>o.includes(e)));return e?.getValues(r)||n?.getValues(r)}return e?.getValues(t)||n?.getValues(t)}{const t=e?.getValues()||n?.getValues();if(r){const e={};return Object.entries(t).forEach((([t,n])=>{o.includes(t)&&(e[t]=n)})),e}return t}}if(!r||r&&o.includes(t))return e?.getValues(t)||n?.getValues(t)}),[n?.getValues,e?.getValues,o]);return{formValues:i,getField:e=>a.current[e],setFields:e=>{a.current={...a.current,...e},r((t=>({...t,...e})))},setField:(e,t)=>{a.current[e]=t,r((n=>({...n,[e]:t})))},resetFields:e=>{a.current={...e},r((()=>({...e})))},registeredFields:o,setRegisteredFields:s,getFormValues:u}},Yk=()=>{const{formValidationConfig:e,setFormValidationConfig:n}=t.useContext(lE);return{formValidationConfig:e,setFieldValidationConfig:(e,t,r=[])=>{n((n=>({...n,[e]:{schema:t,validationRules:r}})))},removeFieldValidationConfig:e=>n((t=>{const n={...t};return delete n[e],n}))}},Wk=()=>{const{submitHandler:e,setSubmitHandler:n,wrapInForm:r,setWrapInForm:i}=t.useContext(Ms);return{submitHandler:e,setSubmitHandler:n,wrapInForm:r,setWrapInForm:i}},qk=(e,n)=>{t.useEffect((()=>{const t=t=>{t.data.type===e&&n(t)};return window.addEventListener("message",t),()=>{window.removeEventListener("message",t)}}),[e,n])},Kk=e=>{const n=t.useRef();return t.useEffect((()=>{n.current=e}),[e]),n.current},Jk=()=>{const{formValidationConfig:e,warnings:n,setWarnings:r,yupId:i}=t.useContext(lE),[a,o]=t.useState(LT()),[s,u]=t.useState(LT()),c=t.useCallback((()=>{if(e){let t={},n={};Object.entries(e).forEach((([e,r])=>{if(!r.validationRules||0===r.validationRules.length)return void(t=sE.upsert(t,e,{schema:r.schema,validationRules:[]}));const i=r.validationRules.filter((({soft:e})=>e)),a=r.validationRules.filter((({soft:e})=>!e));i.length&&(n=sE.upsert(n,e,{schema:r.schema,validationRules:i})),a.length&&(t=sE.upsert(t,e,{schema:r.schema,validationRules:a}))})),u(CI.buildSchema(n,i)),o(CI.buildSchema(t,i))}}),[e,i]);t.useEffect((()=>{c()}),[c]);return{warnings:n,softValidationSchema:s,hardValidationSchema:a,rebuildValidationSchema:c,performSoftValidation:(e,t)=>{e.validate(t,{abortEarly:!1}).then((()=>{r({})})).catch((e=>{const t=e;if(oE(t))return;const n=t.inner.reduce(((e,t)=>(e[t.path]=t.message,e)),{});r(n)}))},addWarnings:e=>{r({...n,...e})},yupId:i}},Xk=()=>{const e=t.useContext(i.ThemeContext);return t.useCallback((()=>window.innerWidth<=n.Breakpoint["sm-max"]({theme:e})||window.innerWidth>window.innerHeight&&window.innerHeight<n.Breakpoint["sm-max"]({theme:e})),[e])},Qk=V.default.div`
|
|
307
307
|
padding: ${n.Spacing["spacing-32"]};
|
|
308
308
|
${n.MediaQuery.MaxWidth.sm} {
|
|
309
309
|
padding: ${n.Spacing["spacing-32"]} ${n.Spacing["spacing-20"]};
|
|
@@ -476,7 +476,7 @@ function tC(e){return"[object Object]"===Object.prototype.toString.call(e)}Objec
|
|
|
476
476
|
cursor: pointer;
|
|
477
477
|
`,gz=V.default(c.Alert)`
|
|
478
478
|
margin-top: ${n.Spacing["spacing-8"]};
|
|
479
|
-
`;var yz=Vr,_z=Hr,vz=qt?qt.isConcatSpreadable:void 0;var bz=sa,Ez=function(e){return _z(e)||yz(e)||!!(vz&&e&&e[vz])};var Sz=function e(t,n,r,i,a){var o=-1,s=t.length;for(r||(r=Ez),a||(a=[]);++o<s;){var u=t[o];n>0&&r(u)?n>1?e(u,n-1,r,i,a):bz(a,u):i||(a[a.length]=u)}return a};var Az=Na,xz=function(){},wz=Az&&1/yA(new Az([,-0]))[1]==1/0?function(e){return new Az(e)}:xz,Tz=gE,Mz=xE,Oz=wE,Cz=TE,Nz=wz,Dz=yA;var Lz=function(e,t,n){var r=-1,i=Mz,a=e.length,o=!0,s=[],u=s;if(n)o=!1,i=Oz;else if(a>=200){var c=t?null:Nz(e);if(c)return Dz(c);o=!1,i=Cz,u=new Tz}else u=t?[]:s;e:for(;++r<a;){var l=e[r],d=t?t(l):l;if(l=n||0!==l?l:0,o&&d==d){for(var f=u.length;f--;)if(u[f]===d)continue e;t&&u.push(d),s.push(l)}else i(u,d,n)||(u!==s&&u.push(d),s.push(l))}return s},Iz=z$,kz=Sz,$z=Lz;var Rz=function(e,t,n){var r=e.length;if(r<2)return r?$z(e[0]):[];for(var i=-1,a=Array(r);++i<r;)for(var o=e[i],s=-1;++s<r;)s!=i&&(a[i]=Iz(a[i]||o,e[s],t,n));return $z(kz(a,1),t,n)},Fz=Ki,zz=Rz,Pz=JE,jz=WE((function(e){return zz(Fz(e,Pz))}));const Zz=t.createContext({files:[],setFiles:()=>null,currentFileIds:[],setCurrentFileIds:()=>null}),Uz=({children:n})=>{const[r,i]=t.useState([]),[a,o]=t.useState([]),s=t.useMemo((()=>({files:r,setFiles:i,currentFileIds:a,setCurrentFileIds:o})),[r,a]);return e.jsx(Zz.Provider,{value:s,children:n})};var Bz,Vz;!function(e){e.findAvailableSlot=e=>{const t=e.reduce(((e,{slot:t})=>t>e?t:e),0),n=Math.max(t,e.length),r=Array(n).fill(0).map(((e,t)=>t)),i=e.map((({slot:e})=>e));return r.filter((e=>!i.includes(e)))[0]??n}}(Bz||(Bz={})),exports.EFileStatus=void 0,(Vz=exports.EFileStatus||(exports.EFileStatus={}))[Vz.INJECTED=-99]="INJECTED",Vz[Vz.INJECTING=-98]="INJECTING",Vz[Vz.TO_DELETE=-4]="TO_DELETE",Vz[Vz.ERROR_FORMAT=-3]="ERROR_FORMAT",Vz[Vz.ERROR_GENERIC=-2]="ERROR_GENERIC",Vz[Vz.ERROR_SIZE=-1]="ERROR_SIZE",Vz[Vz.NONE=0]="NONE",Vz[Vz.UPLOAD_READY=4]="UPLOAD_READY",Vz[Vz.UPLOADING=5]="UPLOADING",Vz[Vz.UPLOADED=6]="UPLOADED";const Hz=t.lazy((()=>Promise.resolve().then((function(){return require("./file-upload-manager.
|
|
479
|
+
`;var yz=Vr,_z=Hr,vz=qt?qt.isConcatSpreadable:void 0;var bz=sa,Ez=function(e){return _z(e)||yz(e)||!!(vz&&e&&e[vz])};var Sz=function e(t,n,r,i,a){var o=-1,s=t.length;for(r||(r=Ez),a||(a=[]);++o<s;){var u=t[o];n>0&&r(u)?n>1?e(u,n-1,r,i,a):bz(a,u):i||(a[a.length]=u)}return a};var Az=Na,xz=function(){},wz=Az&&1/yA(new Az([,-0]))[1]==1/0?function(e){return new Az(e)}:xz,Tz=gE,Mz=xE,Oz=wE,Cz=TE,Nz=wz,Dz=yA;var Lz=function(e,t,n){var r=-1,i=Mz,a=e.length,o=!0,s=[],u=s;if(n)o=!1,i=Oz;else if(a>=200){var c=t?null:Nz(e);if(c)return Dz(c);o=!1,i=Cz,u=new Tz}else u=t?[]:s;e:for(;++r<a;){var l=e[r],d=t?t(l):l;if(l=n||0!==l?l:0,o&&d==d){for(var f=u.length;f--;)if(u[f]===d)continue e;t&&u.push(d),s.push(l)}else i(u,d,n)||(u!==s&&u.push(d),s.push(l))}return s},Iz=z$,kz=Sz,$z=Lz;var Rz=function(e,t,n){var r=e.length;if(r<2)return r?$z(e[0]):[];for(var i=-1,a=Array(r);++i<r;)for(var o=e[i],s=-1;++s<r;)s!=i&&(a[i]=Iz(a[i]||o,e[s],t,n));return $z(kz(a,1),t,n)},Fz=Ki,zz=Rz,Pz=JE,jz=WE((function(e){return zz(Fz(e,Pz))}));const Zz=t.createContext({files:[],setFiles:()=>null,currentFileIds:[],setCurrentFileIds:()=>null}),Uz=({children:n})=>{const[r,i]=t.useState([]),[a,o]=t.useState([]),s=t.useMemo((()=>({files:r,setFiles:i,currentFileIds:a,setCurrentFileIds:o})),[r,a]);return e.jsx(Zz.Provider,{value:s,children:n})};var Bz,Vz;!function(e){e.findAvailableSlot=e=>{const t=e.reduce(((e,{slot:t})=>t>e?t:e),0),n=Math.max(t,e.length),r=Array(n).fill(0).map(((e,t)=>t)),i=e.map((({slot:e})=>e));return r.filter((e=>!i.includes(e)))[0]??n}}(Bz||(Bz={})),exports.EFileStatus=void 0,(Vz=exports.EFileStatus||(exports.EFileStatus={}))[Vz.INJECTED=-99]="INJECTED",Vz[Vz.INJECTING=-98]="INJECTING",Vz[Vz.TO_DELETE=-4]="TO_DELETE",Vz[Vz.ERROR_FORMAT=-3]="ERROR_FORMAT",Vz[Vz.ERROR_GENERIC=-2]="ERROR_GENERIC",Vz[Vz.ERROR_SIZE=-1]="ERROR_SIZE",Vz[Vz.NONE=0]="NONE",Vz[Vz.UPLOAD_READY=4]="UPLOAD_READY",Vz[Vz.UPLOADING=5]="UPLOADING",Vz[Vz.UPLOADED=6]="UPLOADED";const Hz=t.lazy((()=>Promise.resolve().then((function(){return require("./file-upload-manager.858f342f.js")})))),Gz=n=>{const{id:r,error:i,isDirty:a,isTouched:o,value:s,schema:{compressImages:u,description:c,hideThumbnail:l,label:d,uploadOnAddingFile:f,validation:p,warning:h,...m},warning:g}=n,{files:y,currentFileIds:_,setFiles:v}=t.useContext(Zz),b=t.useRef({}),E=t.useRef({}),S=t.useRef({}),A=t.useRef({}),{setFieldValidationConfig:x}=Yk(),{dispatchFieldEvent:w}=qI(),{clearErrors:T,setError:O}=xe(),[C,N]=t.useState(),D=t.useRef(y),L=t.useCallback(((e,t)=>{const n=[...t],i=n.length;e.forEach(((e,t)=>{!E.current.max||i+t<E.current.max?(n.push({...e,slot:Bz.findAvailableSlot(n)}),T(r)):O(r,{type:"max",message:E.current.errorMessage||tm.UPLOAD().MAX_FILES(E.current.max)})})),v(n)}),[T,r,O,v]);t.useEffect((()=>{D.current=y}),[y]),t.useEffect((()=>{w("mount",r)}),[w,r]),t.useEffect((()=>{const e=p?.find((e=>"required"in e)),t=p?.find((e=>"fileType"in e)),n=p?.find((e=>"maxSizeInKb"in e)),i=p?.find((e=>"upload"in e&&e.upload));b.current=t?.fileType?t:{},S.current=n?.maxSizeInKb>0?n:{},A.current=i||{};const a=p?.find((e=>"length"in e)),o=p?.find((e=>"max"in e));E.current=a?{max:a.length,errorMessage:a.errorMessage}:o?{max:o.max,errorMessage:o.errorMessage}:{},x(r,kT().of(LT().shape({dataURL:yw(),fileId:yw(),fileName:yw(),fileUrl:yw(),uploadResponse:LT()})).test("is-empty-array",e?.errorMessage||tm.UPLOAD().REQUIRED,(t=>!t||!e?.required||t.length>0)).test("max-size-in-kb",S.current.errorMessage||tm.UPLOAD().MAX_FILE_SIZE(S.current.maxSizeInKb),(e=>!(e&&Array.isArray(e)&&S.current.maxSizeInKb)||y.filter((e=>e.status===exports.EFileStatus.UPLOADED)).every((e=>{if("base64"===f.type&&e.dataURL)return exports.FileHelper.getFilesizeFromBase64(e.dataURL)<=1024*S.current.maxSizeInKb;if("multipart"===f.type){const t=e.uploadResponse?.data||e.uploadResponse;let n=e.rawFile?.size||t?.fileSize;return isNaN(n)&&(n=0),n<=1024*S.current.maxSizeInKb}})))).test("max-files",E.current.errorMessage||tm.UPLOAD().MAX_FILES(E.current.max),(e=>!(e&&Array.isArray(e)&&E.current.max)||e.length<=E.current.max)).test("no-interim-statuses",tm.UPLOAD().UPLOADING,(()=>{const e=new Set([exports.EFileStatus.INJECTED,exports.EFileStatus.INJECTING,exports.EFileStatus.NONE,exports.EFileStatus.UPLOAD_READY,exports.EFileStatus.UPLOADING]);return!D.current.some((t=>e.has(t.status)))})),p)}),[p,y.map((e=>e.status)).join(",")]),t.useEffect((()=>{if(!a&&!o){const e=Array.isArray(s)?s:[];if(!(jz(e.map((({fileId:e})=>e)),_).length>0))return;const t=[];e.forEach((({dataURL:e,fileId:n,fileName:r,fileUrl:i,uploadResponse:a})=>{t.push({addedFrom:"schema",dataURL:e,fileItem:{id:n},uploadResponse:a,fileUrl:i,rawFile:{name:r},slot:null,status:exports.EFileStatus.INJECTED})})),L(t,[])}}),[L,a,o,_,s]),t.useEffect((()=>{if(i?.message)try{const{message:e,fileErrors:t}=JSON.parse(i.message);t&&v(D.current.map((e=>{const n=t[e.fileItem.id];return n?{...e,fileItem:{...e.fileItem,errorMessage:n}}:e}))),e&&N(e)}catch(e){N(i.message)}else N(void 0)}),[i?.message,v]);const I=t=>t?e.jsx(mI,{children:t}):null;return e.jsxs(e.Fragment,{children:[e.jsx(t.Suspense,{fallback:null,children:e.jsx(Hz,{compressImages:!!u,fileTypeRule:b.current,hideThumbnail:l,id:r,maxFileSizeRule:S.current,upload:f,uploadRule:A.current,value:s})}),e.jsx(M.FileUpload,{...m,accept:b.current.fileType?.map((e=>`.${e}`)).join(","),description:I(c),errorMessage:I(C),fileItems:y.filter((({fileItem:e,status:t})=>!!e&&t!==exports.EFileStatus.INJECTED&&t!==exports.EFileStatus.INJECTING)).map((({fileItem:e})=>e)),id:r,maxFiles:E.current.max,onChange:e=>{L(e.map((e=>({addedFrom:"input",rawFile:e,slot:null,status:exports.EFileStatus.NONE}))),y)},onDelete:e=>{v(y.map((t=>t.fileItem.id!==e.id?t:{...t,status:exports.EFileStatus.TO_DELETE}))),T(r)},title:I(d),warning:I(g||h)})]})},Yz=t.createContext({images:[],setImages:()=>null,errorCount:0,setErrorCount:()=>null,currentFileIds:[],setCurrentFileIds:()=>null}),Wz=({children:n})=>{const[r,i]=t.useState([]),[a,o]=t.useState(0),[s,u]=t.useState([]);return e.jsx(Yz.Provider,{value:{images:r,setImages:i,errorCount:a,setErrorCount:o,currentFileIds:s,setCurrentFileIds:u},children:n})};var qz;!function(e){e.findAvailableSlot=e=>{const t=e.reduce(((e,{slot:t})=>t>e?t:e),0),n=Math.max(t,e.length),r=Array(n).fill(0).map(((e,t)=>t)),i=e.map((({slot:e})=>e));return r.filter((e=>!i.includes(e)))[0]??n}}(qz||(qz={}));const Kz=["jpg","gif","png","heic","heif","webp"];var Jz;exports.EImageStatus=void 0,(Jz=exports.EImageStatus||(exports.EImageStatus={}))[Jz.INJECTED=-99]="INJECTED",Jz[Jz.ERROR_CUSTOM_MUTED=-7]="ERROR_CUSTOM_MUTED",Jz[Jz.ERROR_EXCEED=-6]="ERROR_EXCEED",Jz[Jz.ERROR_CUSTOM=-5]="ERROR_CUSTOM",Jz[Jz.TO_DELETE=-4]="TO_DELETE",Jz[Jz.ERROR_FORMAT=-3]="ERROR_FORMAT",Jz[Jz.ERROR_GENERIC=-2]="ERROR_GENERIC",Jz[Jz.ERROR_SIZE=-1]="ERROR_SIZE",Jz[Jz.NONE=0]="NONE",Jz[Jz.TO_RECOMPRESS=1]="TO_RECOMPRESS",Jz[Jz.COMPRESSED=2]="COMPRESSED",Jz[Jz.RECOMPRESSED=2]="RECOMPRESSED",Jz[Jz.CONVERTED=2]="CONVERTED",Jz[Jz.EDITED=3]="EDITED",Jz[Jz.UPLOAD_READY=4]="UPLOAD_READY",Jz[Jz.UPLOADING=5]="UPLOADING",Jz[Jz.UPLOADED=6]="UPLOADED",Jz[Jz.PENDING=7]="PENDING";var Xz,Qz={exports:{}},eP={exports:{}},tP={};var nP,rP,iP,aP,oP,sP,uP,cP,lP,dP,fP,pP,hP,mP,gP={};
|
|
480
480
|
/** @license React v16.13.1
|
|
481
481
|
* react-is.development.js
|
|
482
482
|
*
|
|
@@ -982,7 +982,7 @@ object-assign
|
|
|
982
982
|
stroke: ${n.Colour["icon-primary"]};
|
|
983
983
|
stroke-width: 1;
|
|
984
984
|
}
|
|
985
|
-
`,kZ=n=>{const{accepts:r,activeFileIndex:i,capture:a,id:o="image-thumbnails",images:s,maxFiles:u,onClickThumbnail:c,onSelectFile:l,multiple:d}=n,f=t.useRef(null),p=async e=>{const t=Array.from(e.target.files||[]);t.length&&setTimeout((()=>{l(t)}),100)},h=()=>f?.current?.click();return e.jsxs(wZ,{id:exports.TestHelper.generateId(o),children:[s.map(((t,n)=>t.status===exports.EImageStatus.NONE?e.jsx(NZ,{children:[...Array(4)].map(((t,n)=>e.jsx(CZ,{},`dot-${n}`)))},n):t.status>exports.EImageStatus.NONE||t.status===exports.EImageStatus.ERROR_CUSTOM_MUTED?e.jsx(TZ,{id:exports.TestHelper.generateId(o,`item-${n+1}`),"data-testid":exports.TestHelper.generateId(o,`item-${n+1}`),src:t.thumbnailDataURL||t.dataURL||"https://assets.life.gov.sg/web-frontend-engine/img/icons/photo-placeholder-add.svg",type:"button","aria-label":`thumbnail of ${t.name}`,onClick:()=>c(n),children:e.jsx(DZ,{isSelected:i===n})},n):"reviewModal"===t.addedFrom||t.status<exports.EImageStatus.NONE?e.jsxs(TZ,{id:exports.TestHelper.generateId(o,`item-${n+1}`),"data-testid":exports.TestHelper.generateId(o,`item-${n+1}`),type:"button","aria-label":`error with ${t.name}`,onClick:()=>c(n),error:!0,children:[e.jsx(DZ,{isSelected:i===n}),e.jsx(MZ,{})]},n):void 0)),(s.filter((({status:e,addedFrom:t})=>e>=exports.EImageStatus.NONE||e===exports.EImageStatus.ERROR_CUSTOM_MUTED||"reviewModal"===t)).length<u||!u)&&e.jsxs(e.Fragment,{children:[e.jsx(LZ,{id:exports.TestHelper.generateId(o,"file-input"),"data-testid":exports.TestHelper.generateId(o,"file-input"),type:"file","aria-hidden":"true",tabIndex:-1,capture:a,ref:f,accept:r.map((e=>`.${e}`)).join(", "),onChange:p,multiple:d,value:""}),e.jsx(IZ,{type:"button",id:exports.TestHelper.generateId(o,"add-image-button"),"data-testid":exports.TestHelper.generateId(o,"add-image-button"),"aria-label":"add image",styleType:"secondary",onClick:h,children:e.jsx(k.PlusIcon,{})})]})]})},$Z=t.lazy((()=>Promise.resolve().then((function(){return require("./index.c8a96a82.js")})))),RZ=[{color:"#282828",label:"black"},{color:"#FFF",colorScheme:"light",label:"white"},{color:"#017cd3",label:"blue"},{color:"#fb0101",label:"red"},{color:"#22910c",label:"green"},{color:"#f8e821",label:"yellow"}],FZ=n=>{const{accepts:r,capture:i,className:a,compress:s,dimensions:u,id:c="image-review",maxFiles:l,maxSizeInKb:d,onExit:f,outputType:p,show:h,multiple:m,maxFilesErrorMessage:g,imageReviewModalStyles:y}=n,{images:_,setImages:v}=t.useContext(Yz),{dispatchFieldEvent:b,addFieldEventListener:E,removeFieldEventListener:S}=qI(),A=Kk(h),[x,w]=t.useState(_.length-1),[T,M]=t.useState(!1),[C,N]=t.useState(),D=!!_?.find((({status:e})=>e===exports.EImageStatus.NONE)),[L,I]=t.useState(RZ[0].color),[k,$]=t.useState(!1),R=t.useRef(null),F=!!_?.find((({addedFrom:e,status:t})=>"reviewModal"===e&&t<=exports.EImageStatus.NONE))||!_.length,z=t.useCallback((e=>{e.detail.removePendingImages&&v((e=>e.filter((({status:e})=>e===exports.EImageStatus.UPLOADED||e===exports.EImageStatus.ERROR_CUSTOM_MUTED)))),f()}),[f,v]),P=e=>{!l||e.length+_.filter((({status:e,addedFrom:t})=>e>=exports.EImageStatus.NONE||"reviewModal"===t)).length<=l?e.forEach((e=>{v((t=>{const n=qz.findAvailableSlot(t);return[...t,{id:rm(),file:e,name:e.name,dimensions:u,status:exports.EImageStatus.NONE,uploadProgress:0,addedFrom:"reviewModal",slot:n}]}))})):v((t=>{const n=qz.findAvailableSlot(t);return[...t,{id:rm(),file:e[0],name:e[0].name,dimensions:u,status:exports.EImageStatus.ERROR_EXCEED,uploadProgress:0,addedFrom:"reviewModal",slot:n}]}))},j=e=>{e&&(v((e=>e.map(((e,t)=>({...e,...t===x?{status:exports.EImageStatus.TO_DELETE}:{}}))))),w(Math.max(0,x-1))),N(null)},Z=t.useCallback((()=>{v((e=>e.filter((({status:e})=>e>=exports.EImageStatus.NONE||e===exports.EImageStatus.ERROR_CUSTOM_MUTED)).map((e=>{const t={...e};return e.drawingDataURL&&(t.dataURL=e.drawingDataURL),e.status<exports.EImageStatus.UPLOAD_READY&&e.status>exports.EImageStatus.NONE&&(t.status=exports.EImageStatus.UPLOAD_READY),t.drawingDataURL=void 0,t.drawing=void 0,t}))))}),[v]),U=()=>{!b("save-review-images",c,{images:_,retry:U})||(Z(),f())},B=()=>{M(!0),I(RZ[0].color)},V=async()=>{const{dataURL:e,drawing:t}=R.current?.export()||{},n=await exports.ImageHelper.dataUrlToImage(e),r=await exports.ImageHelper.resampleImage(n,{scale:96/n.width,type:exports.FileHelper.fileExtensionToMimeType(p)}),i=await exports.FileHelper.fileToDataUrl(r);v((n=>{const r=[...n];return r[x]={...r[x],thumbnailDataURL:i,drawingDataURL:e,drawing:t,status:s?exports.EImageStatus.TO_RECOMPRESS:exports.EImageStatus.EDITED},r})),M(!1),G()},H=()=>{G(),$(!0)},G=()=>{I(""),$(!1)};t.useEffect((()=>{const e={"trigger-save-review-images":Z,"dismiss-review-modal":z};return Object.entries(e).forEach((([e,t])=>{E(e,c,t)})),()=>{Object.entries(e).forEach((([e,t])=>{S(e,c,t)}))}}),[E,z,Z,c,S]),t.useEffect((()=>{w(_.length-1)}),[_.length]),t.useEffect((()=>{h?b("show-review-modal",c):A&&b("hide-review-modal",c)}),[h]);return e.jsx(o.Modal,{id:exports.TestHelper.generateId(c,void 0,h?"show":"hide"),className:a?`${a}-review`:void 0,show:h,children:e.jsx(iZ,{className:a?`${a}-review-modal-box`:void 0,imageReviewModalStyles:y,showCloseButton:!1,children:h?e.jsxs(e.Fragment,{children:[e.jsx(aZ,{className:a?`${a}-header`:void 0,$drawActive:T,children:T?e.jsxs(e.Fragment,{children:[e.jsx(cZ,{id:exports.TestHelper.generateId(c,"clear-drawing-button"),"data-testid":exports.TestHelper.generateId(c,"clear-drawing-button"),onClick:()=>N("clear-drawing"),children:"Clear"}),e.jsx(cZ,{id:exports.TestHelper.generateId(c,"save-drawing"),"data-testid":exports.TestHelper.generateId(c,"save-drawing"),onClick:V,children:"Save"})]}):e.jsxs(e.Fragment,{children:[e.jsx(oZ,{id:exports.TestHelper.generateId(c,"close-button"),"data-testid":exports.TestHelper.generateId(c,"close-button"),"aria-label":"exit review modal",onClick:()=>N("exit"),children:e.jsx(O.CrossIcon,{type:"cross"})}),e.jsx(sZ,{weight:"semibold",children:"Review photos"})]})}),e.jsxs(lZ,{children:[_.length>0&&e.jsx(yZ,{className:a?`${a}-editor`:void 0,children:e.jsx(t.Suspense,{fallback:null,children:e.jsx($Z,{baseImageDataURL:_[x]?.dataURL,drawing:_[x]?.drawing,color:T?L:void 0,erase:!!T&&k,ref:R,maxSizeInKb:d})})}),_.length>0&&e.jsx(dZ,{children:"Loading Preview..."}),!T&&_[x]?.status>=exports.EImageStatus.NONE&&e.jsxs(fZ,{children:[e.jsxs(pZ,{id:exports.TestHelper.generateId(c,"draw-button"),"data-testid":exports.TestHelper.generateId(c,"draw-button"),onClick:B,disabled:D,children:[e.jsx(mZ,{$disabled:D}),e.jsx(hZ,{weight:"semibold",$disabled:D,children:"Draw"})]}),e.jsxs(pZ,{id:exports.TestHelper.generateId(c,"delete-button"),"data-testid":exports.TestHelper.generateId(c,"delete-button"),onClick:()=>N("delete"),disabled:D,children:[e.jsx(gZ,{$disabled:D}),e.jsx(hZ,{weight:"semibold",$disabled:D,children:"Delete"})]})]}),_[x]?.status<exports.EImageStatus.NONE&&e.jsx(nZ,{id:`${c}-photo-error`,image:_[x],accepts:r,maxSizeInKb:d,onClickOk:()=>j(!0),maxFilesErrorMessage:g,maxFiles:l})]}),e.jsx(_Z,{className:a?`${a}-footer`:void 0,children:T?e.jsxs(e.Fragment,{children:[e.jsx(bZ,{id:exports.TestHelper.generateId(c,"eraser-button"),"data-testid":exports.TestHelper.generateId(c,"eraser-button"),"aria-label":"eraser",onClick:H,children:e.jsx(EZ,{$eraseMode:k})}),e.jsx(AZ,{children:RZ.map((({color:t,colorScheme:n,label:r},i)=>e.jsx(xZ,{id:exports.TestHelper.generateId(c,`palette-color-${i}`),"aria-label":`${r} brush`,$color:t,$colorScheme:n,onClick:()=>(e=>{G(),I(e)})(t),children:L===t&&e.jsx(SZ,{$colorScheme:n})},t)))})]}):e.jsxs(e.Fragment,{children:[e.jsx(kZ,{id:`${c}-image-thumbnails`,activeFileIndex:x,accepts:r,capture:i,maxFiles:l,images:_,onClickThumbnail:w,onSelectFile:P,multiple:m}),e.jsx(vZ,{id:exports.TestHelper.generateId(c,"save-button"),"data-testid":exports.TestHelper.generateId(c,"save-button"),onClick:U,disabled:F,children:"Save"})]})}),e.jsx(rZ,{images:_,show:C,onDecideClearDrawing:e=>{e&&R.current.clearDrawing(),N(null)},onDecideDelete:j,onDecideExit:e=>{e&&(v(_.filter((({addedFrom:e,status:t})=>t>=exports.EImageStatus.UPLOADED||t<exports.EImageStatus.NONE&&"dragInput"===e)).map((e=>({...e,drawingDataURL:void 0,drawing:void 0})))),f()),N(null)}})]}):e.jsx(e.Fragment,{})})})},zZ=t.lazy((()=>Promise.resolve().then((function(){return require("./index.dbac2c71.js")})))),PZ=n=>{const{schema:{buttonLabel:r,capture:i,className:a,compress:o,crop:s,description:u,dimensions:c={width:1e3,height:1e3},editImage:l,label:d,outputType:f="jpg",uploadOnAddingFile:p,validation:h,multiple:m,imageReviewModalStyles:g},id:y,isDirty:_,isTouched:v,value:b,warning:E,...S}=n,{images:A,setImages:x,currentFileIds:w}=t.useContext(Yz),T=Kk(A),[M,O]=t.useState([...Kz]),[C,N]=t.useState(0),[D,L]=t.useState(0),[I,k]=t.useState(!1),[$,R]=t.useState(!1),{setFieldValidationConfig:F}=Yk(),{dispatchFieldEvent:z}=qI(),P=Xk();t.useEffect((()=>{z("mount",y)}),[z,y]),t.useEffect((()=>{if(!_&&!v){const e=Array.isArray(b)?b:[];if(!(jz(e.map((({fileId:e})=>e)),w).length>0))return;const t=[];e.forEach((({fileId:e,fileName:n,dataURL:r,uploadResponse:i},a)=>{const o={id:e||rm(),file:{},name:n,dimensions:{width:10,height:10},dataURL:r,status:exports.EImageStatus.INJECTED,addedFrom:"schema",uploadProgress:100,slot:a,uploadResponse:i};t.push(o)})),x(t)}}),[_,v,w,x,b]),t.useEffect((()=>{const e=h?.find((e=>"required"in e)),t=h?.find((e=>"fileType"in e)),n=h?.find((e=>"maxSizeInKb"in e));t?.fileType&&t?.fileType!==M&&O(t?.fileType),n?.maxSizeInKb&&n?.maxSizeInKb!==D&&L(n?.maxSizeInKb);const r=h?.find((e=>"length"in e)),i=h?.find((e=>"max"in e));let a;r?a={maxFiles:r.length,errorMessage:r.errorMessage}:i&&(a={maxFiles:i.max,errorMessage:i.errorMessage}),a?.maxFiles&&C!==a.maxFiles&&N(a.maxFiles),F(y,kT().of(LT().shape({fileName:yw(),dataURL:yw()})).test("is-empty-array",e?.errorMessage||tm.UPLOAD("photo").REQUIRED,(t=>!t||!e?.required||t.length>0)).test("max-size-in-kb",n?.errorMessage||tm.UPLOAD("photo").MAX_FILE_SIZE(n?.maxSizeInKb),(e=>!(e&&Array.isArray(e)&&n?.maxSizeInKb)||e.every((e=>exports.FileHelper.getFilesizeFromBase64(e.dataURL)<=1024*n?.maxSizeInKb)))),h)}),[h]),t.useEffect((()=>{A.some((e=>e.status===exports.EImageStatus.NONE))||(A.some(((e,t)=>{const n=T?.[t];if(e.status!==n?.status||e.dataURL!==n.dataURL)switch(e.status){case exports.EImageStatus.COMPRESSED:case exports.EImageStatus.CONVERTED:if(l&&!$)return P()?R(!0):k(!0),!0}})),0===A.length&&R(!1))}),[A.map((e=>e.status)).join(","),A.map((e=>e.dataURL)).join(",")]);const j=(e=!1)=>{e?l&&(document.body.classList.remove("lifesg-ds-overlay-open"),R(!0)):x((e=>e.map((e=>e.status<exports.EImageStatus.UPLOAD_READY&&e.status>exports.EImageStatus.NONE?{...e,status:exports.EImageStatus.UPLOAD_READY}:e)))),k(!1)};return e.jsxs(e.Fragment,{children:[e.jsx(t.Suspense,{fallback:null,children:e.jsx(zZ,{accepts:M,compress:!!o,crop:!!s,dimensions:c,editImage:l,id:y,maxSizeInKb:D,outputType:f,upload:p,value:b})}),e.jsx(Wj,{id:y,capture:i,className:a,label:d,description:u,buttonLabel:r,accepts:M,maxFiles:C,maxSizeInKb:D,dimensions:c,errorMessage:S.error?.message,validation:h,multiple:m,warning:E}),e.jsx(JT,{id:`${y}-review-prompt`,title:"Review photos?",size:"large",show:I,description:"This lets you check if you've selected the correct photos, and draw on them to highlight the issue.",buttons:[{id:"ok",title:"Ok",onClick:()=>j(!0)},{id:"skip",title:"Skip",buttonStyle:"secondary",onClick:()=>j()}]}),(()=>{const t=h?.find((e=>"max"in e));return e.jsx(FZ,{accepts:M,dimensions:c,id:y,className:a,maxFiles:C,maxFilesErrorMessage:t?.errorMessage,maxSizeInKb:D,onExit:()=>R(!1),outputType:f,show:$,multiple:m,capture:i,imageReviewModalStyles:g})})()]})},jZ=i.css`
|
|
985
|
+
`,kZ=n=>{const{accepts:r,activeFileIndex:i,capture:a,id:o="image-thumbnails",images:s,maxFiles:u,onClickThumbnail:c,onSelectFile:l,multiple:d}=n,f=t.useRef(null),p=async e=>{const t=Array.from(e.target.files||[]);t.length&&setTimeout((()=>{l(t)}),100)},h=()=>f?.current?.click();return e.jsxs(wZ,{id:exports.TestHelper.generateId(o),children:[s.map(((t,n)=>t.status===exports.EImageStatus.NONE?e.jsx(NZ,{children:[...Array(4)].map(((t,n)=>e.jsx(CZ,{},`dot-${n}`)))},n):t.status>exports.EImageStatus.NONE||t.status===exports.EImageStatus.ERROR_CUSTOM_MUTED?e.jsx(TZ,{id:exports.TestHelper.generateId(o,`item-${n+1}`),"data-testid":exports.TestHelper.generateId(o,`item-${n+1}`),src:t.thumbnailDataURL||t.dataURL||"https://assets.life.gov.sg/web-frontend-engine/img/icons/photo-placeholder-add.svg",type:"button","aria-label":`thumbnail of ${t.name}`,onClick:()=>c(n),children:e.jsx(DZ,{isSelected:i===n})},n):"reviewModal"===t.addedFrom||t.status<exports.EImageStatus.NONE?e.jsxs(TZ,{id:exports.TestHelper.generateId(o,`item-${n+1}`),"data-testid":exports.TestHelper.generateId(o,`item-${n+1}`),type:"button","aria-label":`error with ${t.name}`,onClick:()=>c(n),error:!0,children:[e.jsx(DZ,{isSelected:i===n}),e.jsx(MZ,{})]},n):void 0)),(s.filter((({status:e,addedFrom:t})=>e>=exports.EImageStatus.NONE||e===exports.EImageStatus.ERROR_CUSTOM_MUTED||"reviewModal"===t)).length<u||!u)&&e.jsxs(e.Fragment,{children:[e.jsx(LZ,{id:exports.TestHelper.generateId(o,"file-input"),"data-testid":exports.TestHelper.generateId(o,"file-input"),type:"file","aria-hidden":"true",tabIndex:-1,capture:a,ref:f,accept:r.map((e=>`.${e}`)).join(", "),onChange:p,multiple:d,value:""}),e.jsx(IZ,{type:"button",id:exports.TestHelper.generateId(o,"add-image-button"),"data-testid":exports.TestHelper.generateId(o,"add-image-button"),"aria-label":"add image",styleType:"secondary",onClick:h,children:e.jsx(k.PlusIcon,{})})]})]})},$Z=t.lazy((()=>Promise.resolve().then((function(){return require("./index.3cfca5cf.js")})))),RZ=[{color:"#282828",label:"black"},{color:"#FFF",colorScheme:"light",label:"white"},{color:"#017cd3",label:"blue"},{color:"#fb0101",label:"red"},{color:"#22910c",label:"green"},{color:"#f8e821",label:"yellow"}],FZ=n=>{const{accepts:r,capture:i,className:a,compress:s,dimensions:u,id:c="image-review",maxFiles:l,maxSizeInKb:d,onExit:f,outputType:p,show:h,multiple:m,maxFilesErrorMessage:g,imageReviewModalStyles:y}=n,{images:_,setImages:v}=t.useContext(Yz),{dispatchFieldEvent:b,addFieldEventListener:E,removeFieldEventListener:S}=qI(),A=Kk(h),[x,w]=t.useState(_.length-1),[T,M]=t.useState(!1),[C,N]=t.useState(),D=!!_?.find((({status:e})=>e===exports.EImageStatus.NONE)),[L,I]=t.useState(RZ[0].color),[k,$]=t.useState(!1),R=t.useRef(null),F=!!_?.find((({addedFrom:e,status:t})=>"reviewModal"===e&&t<=exports.EImageStatus.NONE))||!_.length,z=t.useCallback((e=>{e.detail.removePendingImages&&v((e=>e.filter((({status:e})=>e===exports.EImageStatus.UPLOADED||e===exports.EImageStatus.ERROR_CUSTOM_MUTED)))),f()}),[f,v]),P=e=>{!l||e.length+_.filter((({status:e,addedFrom:t})=>e>=exports.EImageStatus.NONE||"reviewModal"===t)).length<=l?e.forEach((e=>{v((t=>{const n=qz.findAvailableSlot(t);return[...t,{id:rm(),file:e,name:e.name,dimensions:u,status:exports.EImageStatus.NONE,uploadProgress:0,addedFrom:"reviewModal",slot:n}]}))})):v((t=>{const n=qz.findAvailableSlot(t);return[...t,{id:rm(),file:e[0],name:e[0].name,dimensions:u,status:exports.EImageStatus.ERROR_EXCEED,uploadProgress:0,addedFrom:"reviewModal",slot:n}]}))},j=e=>{e&&(v((e=>e.map(((e,t)=>({...e,...t===x?{status:exports.EImageStatus.TO_DELETE}:{}}))))),w(Math.max(0,x-1))),N(null)},Z=t.useCallback((()=>{v((e=>e.filter((({status:e})=>e>=exports.EImageStatus.NONE||e===exports.EImageStatus.ERROR_CUSTOM_MUTED)).map((e=>{const t={...e};return e.drawingDataURL&&(t.dataURL=e.drawingDataURL),e.status<exports.EImageStatus.UPLOAD_READY&&e.status>exports.EImageStatus.NONE&&(t.status=exports.EImageStatus.UPLOAD_READY),t.drawingDataURL=void 0,t.drawing=void 0,t}))))}),[v]),U=()=>{!b("save-review-images",c,{images:_,retry:U})||(Z(),f())},B=()=>{M(!0),I(RZ[0].color)},V=async()=>{const{dataURL:e,drawing:t}=R.current?.export()||{},n=await exports.ImageHelper.dataUrlToImage(e),r=await exports.ImageHelper.resampleImage(n,{scale:96/n.width,type:exports.FileHelper.fileExtensionToMimeType(p)}),i=await exports.FileHelper.fileToDataUrl(r);v((n=>{const r=[...n];return r[x]={...r[x],thumbnailDataURL:i,drawingDataURL:e,drawing:t,status:s?exports.EImageStatus.TO_RECOMPRESS:exports.EImageStatus.EDITED},r})),M(!1),G()},H=()=>{G(),$(!0)},G=()=>{I(""),$(!1)};t.useEffect((()=>{const e={"trigger-save-review-images":Z,"dismiss-review-modal":z};return Object.entries(e).forEach((([e,t])=>{E(e,c,t)})),()=>{Object.entries(e).forEach((([e,t])=>{S(e,c,t)}))}}),[E,z,Z,c,S]),t.useEffect((()=>{w(_.length-1)}),[_.length]),t.useEffect((()=>{h?b("show-review-modal",c):A&&b("hide-review-modal",c)}),[h]);return e.jsx(o.Modal,{id:exports.TestHelper.generateId(c,void 0,h?"show":"hide"),className:a?`${a}-review`:void 0,show:h,children:e.jsx(iZ,{className:a?`${a}-review-modal-box`:void 0,imageReviewModalStyles:y,showCloseButton:!1,children:h?e.jsxs(e.Fragment,{children:[e.jsx(aZ,{className:a?`${a}-header`:void 0,$drawActive:T,children:T?e.jsxs(e.Fragment,{children:[e.jsx(cZ,{id:exports.TestHelper.generateId(c,"clear-drawing-button"),"data-testid":exports.TestHelper.generateId(c,"clear-drawing-button"),onClick:()=>N("clear-drawing"),children:"Clear"}),e.jsx(cZ,{id:exports.TestHelper.generateId(c,"save-drawing"),"data-testid":exports.TestHelper.generateId(c,"save-drawing"),onClick:V,children:"Save"})]}):e.jsxs(e.Fragment,{children:[e.jsx(oZ,{id:exports.TestHelper.generateId(c,"close-button"),"data-testid":exports.TestHelper.generateId(c,"close-button"),"aria-label":"exit review modal",onClick:()=>N("exit"),children:e.jsx(O.CrossIcon,{type:"cross"})}),e.jsx(sZ,{weight:"semibold",children:"Review photos"})]})}),e.jsxs(lZ,{children:[_.length>0&&e.jsx(yZ,{className:a?`${a}-editor`:void 0,children:e.jsx(t.Suspense,{fallback:null,children:e.jsx($Z,{baseImageDataURL:_[x]?.dataURL,drawing:_[x]?.drawing,color:T?L:void 0,erase:!!T&&k,ref:R,maxSizeInKb:d})})}),_.length>0&&e.jsx(dZ,{children:"Loading Preview..."}),!T&&_[x]?.status>=exports.EImageStatus.NONE&&e.jsxs(fZ,{children:[e.jsxs(pZ,{id:exports.TestHelper.generateId(c,"draw-button"),"data-testid":exports.TestHelper.generateId(c,"draw-button"),onClick:B,disabled:D,children:[e.jsx(mZ,{$disabled:D}),e.jsx(hZ,{weight:"semibold",$disabled:D,children:"Draw"})]}),e.jsxs(pZ,{id:exports.TestHelper.generateId(c,"delete-button"),"data-testid":exports.TestHelper.generateId(c,"delete-button"),onClick:()=>N("delete"),disabled:D,children:[e.jsx(gZ,{$disabled:D}),e.jsx(hZ,{weight:"semibold",$disabled:D,children:"Delete"})]})]}),_[x]?.status<exports.EImageStatus.NONE&&e.jsx(nZ,{id:`${c}-photo-error`,image:_[x],accepts:r,maxSizeInKb:d,onClickOk:()=>j(!0),maxFilesErrorMessage:g,maxFiles:l})]}),e.jsx(_Z,{className:a?`${a}-footer`:void 0,children:T?e.jsxs(e.Fragment,{children:[e.jsx(bZ,{id:exports.TestHelper.generateId(c,"eraser-button"),"data-testid":exports.TestHelper.generateId(c,"eraser-button"),"aria-label":"eraser",onClick:H,children:e.jsx(EZ,{$eraseMode:k})}),e.jsx(AZ,{children:RZ.map((({color:t,colorScheme:n,label:r},i)=>e.jsx(xZ,{id:exports.TestHelper.generateId(c,`palette-color-${i}`),"aria-label":`${r} brush`,$color:t,$colorScheme:n,onClick:()=>(e=>{G(),I(e)})(t),children:L===t&&e.jsx(SZ,{$colorScheme:n})},t)))})]}):e.jsxs(e.Fragment,{children:[e.jsx(kZ,{id:`${c}-image-thumbnails`,activeFileIndex:x,accepts:r,capture:i,maxFiles:l,images:_,onClickThumbnail:w,onSelectFile:P,multiple:m}),e.jsx(vZ,{id:exports.TestHelper.generateId(c,"save-button"),"data-testid":exports.TestHelper.generateId(c,"save-button"),onClick:U,disabled:F,children:"Save"})]})}),e.jsx(rZ,{images:_,show:C,onDecideClearDrawing:e=>{e&&R.current.clearDrawing(),N(null)},onDecideDelete:j,onDecideExit:e=>{e&&(v(_.filter((({addedFrom:e,status:t})=>t>=exports.EImageStatus.UPLOADED||t<exports.EImageStatus.NONE&&"dragInput"===e)).map((e=>({...e,drawingDataURL:void 0,drawing:void 0})))),f()),N(null)}})]}):e.jsx(e.Fragment,{})})})},zZ=t.lazy((()=>Promise.resolve().then((function(){return require("./index.ade37699.js")})))),PZ=n=>{const{schema:{buttonLabel:r,capture:i,className:a,compress:o,crop:s,description:u,dimensions:c={width:1e3,height:1e3},editImage:l,label:d,outputType:f="jpg",uploadOnAddingFile:p,validation:h,multiple:m,imageReviewModalStyles:g},id:y,isDirty:_,isTouched:v,value:b,warning:E,...S}=n,{images:A,setImages:x,currentFileIds:w}=t.useContext(Yz),T=Kk(A),[M,O]=t.useState([...Kz]),[C,N]=t.useState(0),[D,L]=t.useState(0),[I,k]=t.useState(!1),[$,R]=t.useState(!1),{setFieldValidationConfig:F}=Yk(),{dispatchFieldEvent:z}=qI(),P=Xk();t.useEffect((()=>{z("mount",y)}),[z,y]),t.useEffect((()=>{if(!_&&!v){const e=Array.isArray(b)?b:[];if(!(jz(e.map((({fileId:e})=>e)),w).length>0))return;const t=[];e.forEach((({fileId:e,fileName:n,dataURL:r,uploadResponse:i},a)=>{const o={id:e||rm(),file:{},name:n,dimensions:{width:10,height:10},dataURL:r,status:exports.EImageStatus.INJECTED,addedFrom:"schema",uploadProgress:100,slot:a,uploadResponse:i};t.push(o)})),x(t)}}),[_,v,w,x,b]),t.useEffect((()=>{const e=h?.find((e=>"required"in e)),t=h?.find((e=>"fileType"in e)),n=h?.find((e=>"maxSizeInKb"in e));t?.fileType&&t?.fileType!==M&&O(t?.fileType),n?.maxSizeInKb&&n?.maxSizeInKb!==D&&L(n?.maxSizeInKb);const r=h?.find((e=>"length"in e)),i=h?.find((e=>"max"in e));let a;r?a={maxFiles:r.length,errorMessage:r.errorMessage}:i&&(a={maxFiles:i.max,errorMessage:i.errorMessage}),a?.maxFiles&&C!==a.maxFiles&&N(a.maxFiles),F(y,kT().of(LT().shape({fileName:yw(),dataURL:yw()})).test("is-empty-array",e?.errorMessage||tm.UPLOAD("photo").REQUIRED,(t=>!t||!e?.required||t.length>0)).test("max-size-in-kb",n?.errorMessage||tm.UPLOAD("photo").MAX_FILE_SIZE(n?.maxSizeInKb),(e=>!(e&&Array.isArray(e)&&n?.maxSizeInKb)||e.every((e=>exports.FileHelper.getFilesizeFromBase64(e.dataURL)<=1024*n?.maxSizeInKb)))),h)}),[h]),t.useEffect((()=>{A.some((e=>e.status===exports.EImageStatus.NONE))||(A.some(((e,t)=>{const n=T?.[t];if(e.status!==n?.status||e.dataURL!==n.dataURL)switch(e.status){case exports.EImageStatus.COMPRESSED:case exports.EImageStatus.CONVERTED:if(l&&!$)return P()?R(!0):k(!0),!0}})),0===A.length&&R(!1))}),[A.map((e=>e.status)).join(","),A.map((e=>e.dataURL)).join(",")]);const j=(e=!1)=>{e?l&&(document.body.classList.remove("lifesg-ds-overlay-open"),R(!0)):x((e=>e.map((e=>e.status<exports.EImageStatus.UPLOAD_READY&&e.status>exports.EImageStatus.NONE?{...e,status:exports.EImageStatus.UPLOAD_READY}:e)))),k(!1)};return e.jsxs(e.Fragment,{children:[e.jsx(t.Suspense,{fallback:null,children:e.jsx(zZ,{accepts:M,compress:!!o,crop:!!s,dimensions:c,editImage:l,id:y,maxSizeInKb:D,outputType:f,upload:p,value:b})}),e.jsx(Wj,{id:y,capture:i,className:a,label:d,description:u,buttonLabel:r,accepts:M,maxFiles:C,maxSizeInKb:D,dimensions:c,errorMessage:S.error?.message,validation:h,multiple:m,warning:E}),e.jsx(JT,{id:`${y}-review-prompt`,title:"Review photos?",size:"large",show:I,description:"This lets you check if you've selected the correct photos, and draw on them to highlight the issue.",buttons:[{id:"ok",title:"Ok",onClick:()=>j(!0)},{id:"skip",title:"Skip",buttonStyle:"secondary",onClick:()=>j()}]}),(()=>{const t=h?.find((e=>"max"in e));return e.jsx(FZ,{accepts:M,dimensions:c,id:y,className:a,maxFiles:C,maxFilesErrorMessage:t?.errorMessage,maxSizeInKb:D,onExit:()=>R(!1),outputType:f,show:$,multiple:m,capture:i,imageReviewModalStyles:g})})()]})},jZ=i.css`
|
|
986
986
|
border: ${n.Border["width-010"]} ${n.Border.solid} ${n.Colour["border-focus"]};
|
|
987
987
|
box-shadow: none;
|
|
988
988
|
`,ZZ=i.css`
|
|
@@ -1061,7 +1061,7 @@ object-assign
|
|
|
1061
1061
|
${e=>i.css`
|
|
1062
1062
|
margin-left: ${e.$readOnly?n.Spacing["spacing-4"]:n.Spacing["spacing-12"]};
|
|
1063
1063
|
`}
|
|
1064
|
-
`,GZ=t=>{const{id:n,"data-testid":r,className:i,disabled:a,readOnly:o,onFocus:s,value:u,placeholder:c,error:l}=t;return e.jsxs(BZ,{id:n,"data-testid":r,type:"button",className:i,disabled:a,$readOnly:o,$error:l,onFocus:s,onClick:e=>{a||e.currentTarget.focus()},tabIndex:a?-1:0,"aria-disabled":a||void 0,"aria-haspopup":"dialog","aria-readonly":o,children:[c&&!u?e.jsx(VZ,{$placeholder:!0,$disabled:a,children:c}):e.jsx(VZ,{$disabled:a,children:u}),e.jsx(HZ,{$disabled:a,$readOnly:o,"aria-hidden":"true",children:e.jsx(R.PinFillIcon,{})})]})},YZ=t=>{const{id:n,label:r,className:i,locationInputPlaceholder:a="",onFocus:o,value:s,errorMessage:u,disabled:c,readOnly:l}=t;return e.jsx(x.Form.CustomField,{id:exports.TestHelper.generateId(n,"location-input"),"data-testid":exports.TestHelper.generateId(n,"location-input"),label:r,errorMessage:u,children:e.jsx(GZ,{id:exports.TestHelper.generateId(n,"location-input-base"),"data-testid":exports.TestHelper.generateId(n,"location-input-base"),disabled:c,readOnly:l,placeholder:a,onFocus:o,value:s,error:!!u,className:i})})},WZ=t.lazy((()=>Promise.resolve().then((function(){return require("./location-modal.
|
|
1064
|
+
`,GZ=t=>{const{id:n,"data-testid":r,className:i,disabled:a,readOnly:o,onFocus:s,value:u,placeholder:c,error:l}=t;return e.jsxs(BZ,{id:n,"data-testid":r,type:"button",className:i,disabled:a,$readOnly:o,$error:l,onFocus:s,onClick:e=>{a||e.currentTarget.focus()},tabIndex:a?-1:0,"aria-disabled":a||void 0,"aria-haspopup":"dialog","aria-readonly":o,children:[c&&!u?e.jsx(VZ,{$placeholder:!0,$disabled:a,children:c}):e.jsx(VZ,{$disabled:a,children:u}),e.jsx(HZ,{$disabled:a,$readOnly:o,"aria-hidden":"true",children:e.jsx(R.PinFillIcon,{})})]})},YZ=t=>{const{id:n,label:r,className:i,locationInputPlaceholder:a="",onFocus:o,value:s,errorMessage:u,disabled:c,readOnly:l}=t;return e.jsx(x.Form.CustomField,{id:exports.TestHelper.generateId(n,"location-input"),"data-testid":exports.TestHelper.generateId(n,"location-input"),label:r,errorMessage:u,children:e.jsx(GZ,{id:exports.TestHelper.generateId(n,"location-input-base"),"data-testid":exports.TestHelper.generateId(n,"location-input-base"),disabled:c,readOnly:l,placeholder:a,onFocus:o,value:s,error:!!u,className:i})})},WZ=t.lazy((()=>Promise.resolve().then((function(){return require("./location-modal.ff0cd21c.js")}))));class qZ extends Error{code;message;constructor(e){super(),Object.assign(this,e)}}const KZ=V.default(r.Typography.BodyMD)`
|
|
1065
1065
|
cursor: ${e=>e.disabled?"not-allowed":"pointer"};
|
|
1066
1066
|
`,JZ=V.default(z.RadioButton)`
|
|
1067
1067
|
margin-right: ${n.Spacing["spacing-4"]};
|
|
@@ -1114,4 +1114,4 @@ object-assign
|
|
|
1114
1114
|
`,hU=V.default.div`
|
|
1115
1115
|
flex: 1;
|
|
1116
1116
|
`,mU=t=>{const{sectionSchema:{children:n,layoutType:r,customOptions:i={gridType:"v2"}},...a}=t;switch(r){case"grid":return(()=>{const t="v3"===i.gridType?fU:pU,r="v3"===i.gridType?"grid":"flex";return e.jsx(l.Layout.Section,{children:e.jsx(t,{type:r,children:e.jsx(dU,{...a,children:n})})})})();case"contain":return e.jsx(l.Layout.Content,{children:e.jsx(hU,{children:e.jsx(dU,{...a,children:n})})});default:return e.jsx(dU,{...a,children:n})}},gU=()=>{const{formSchema:{sections:t,overrides:n},overrideSchema:r}=Hk();return e.jsx(e.Fragment,{children:(()=>{const i=r(t,n);return i?Object.entries(i).map((([t,n],r)=>e.jsx(mU,{id:t,sectionSchema:n},`section-${r}`))):e.jsxs(e.Fragment,{children:["Unable to render Frontend Engine schema, make sure schema is declared within ",e.jsx("code",{children:"sections"}),"."]})})()})},yU=t.forwardRef(((n,r)=>{const{data:i,className:a=null,components:o,onSubmit:s,onSubmitError:u,wrapInForm:c=!0}=n,{className:l=null,defaultValues:d,id:f,stripUnknown:p,revalidationMode:h="onChange",validationMode:m="onTouched"}=i||{},{addFieldEventListener:g,dispatchFieldEvent:y,removeFieldEventListener:_}=qI(),{setCustomComponents:v}=YI(),{setSubmitHandler:b,setWrapInForm:E}=Wk(),{addWarnings:S,performSoftValidation:A,softValidationSchema:x,hardValidationSchema:w,rebuildValidationSchema:T,yupId:M}=Jk(),O=function(e={}){const t=U.default.useRef(void 0),n=U.default.useRef(void 0),[r,i]=U.default.useState({isDirty:!1,isValidating:!1,isLoading:Be(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:Be(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={..._t(e),formState:r});const a=t.current.control;return a._options=e,De({subject:a._subjects.state,next:e=>{Oe(e,a._proxyFormState,a._updateFormState,!0)&&i({...a._formState})}}),U.default.useEffect((()=>a._disableForm(e.disabled)),[a,e.disabled]),U.default.useEffect((()=>{if(a._proxyFormState.isDirty){const e=a._getDirty();e!==r.isDirty&&a._subjects.state.next({isDirty:e})}}),[a,r.isDirty]),U.default.useEffect((()=>{e.values&&!at(e.values,n.current)?(a._reset(e.values,a._options.resetOptions),n.current=e.values,i((e=>({...e})))):a._resetDefaultValues()}),[e.values,a]),U.default.useEffect((()=>{e.errors&&a._setErrors(e.errors)}),[e.errors,a]),U.default.useEffect((()=>{a._state.mount||(a._updateValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()})),U.default.useEffect((()=>{e.shouldUnregister&&a._subjects.values.next({values:a._getWatch()})}),[e.shouldUnregister,a]),t.current.formState=Te(r,a),t.current}({mode:m,reValidateMode:h,defaultValues:d,resolver:async(e,t,n)=>(A(x,e),await function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),function(r,i,a){try{return Promise.resolve(function(o,s){try{var u=(t.context&&"development"===process.env.NODE_ENV&&console.warn("You should not used the yup options context. Please, use the 'useForm' context object instead"),Promise.resolve(e["sync"===n.mode?"validateSync":"validate"](r,Object.assign({abortEarly:!1},t,{context:i}))).then((function(e){return a.shouldUseNativeValidation&&bt({},a),{values:n.rawValues?r:e,errors:{}}})))}catch(e){return s(e)}return u&&u.then?u.then(void 0,s):u}(0,(function(e){if(!e.inner)throw e;return{values:{},errors:Et((t=e,n=!a.shouldUseNativeValidation&&"all"===a.criteriaMode,(t.inner||[]).reduce((function(e,t){if(e[t.path]||(e[t.path]={message:t.message,type:t.type}),n){var r=e[t.path].types,i=r&&r[t.type];e[t.path]=Fe(t.path,n,e,t.type,i?[].concat(i,t.message):t.message)}return e}),{})),a)};var t,n})))}catch(e){return Promise.reject(e)}}}(w)(e,t,n))}),{setFormSchema:C}=Hk(),{reset:N,handleSubmit:D,getValues:L,setValue:I,setError:k,trigger:$,formState:R,clearErrors:F}=O,{resetFields:z,setFields:P,getFormValues:j,registeredFields:Z}=Gk(O),B=t.useRef(Z),{checkIsFormValid:V}=((e,n)=>{const{data:r,onChange:i,onValueChange:a}=e,{stripUnknown:o}=r||{},{hardValidationSchema:s}=Jk(),{formValidationConfig:u}=Yk(),{watch:c,getValues:l,formState:d,clearErrors:f}=n,{setFields:p,setField:h,getFormValues:m}=Gk(n),[g,y]=t.useState({}),[_,v]=t.useState(!1),b=Kk(u),E=Kk(s),S=t.useRef(void 0),A=t.useRef(void 0),x=t.useCallback(((e=!1)=>{if(!e)try{return s.validateSync(l()),!0}catch(e){return!1}return(async()=>{try{return await s.validate(l()),!0}catch(e){return!1}})()}),[l,s]),w=t.useRef((async()=>{}));return w.current=async()=>{const e=m(void 0,o),t=await x(!0);a&&Object.keys(u||{}).length&&(A.current===t&&kI(S.current,e)||a(e,t)),S.current=e,A.current=t},t.useEffect((()=>{const e=c(((e,{name:t})=>{t?h(t,e[t]):p(e)}));return()=>e.unsubscribe()}),[]),t.useEffect((()=>{if(i&&Object.keys(u||{}).length){const e=c((async()=>{const e=await x(!0);i(m(void 0,o),e)}));return x(!0).then((e=>i(m(void 0,o),e))),()=>e.unsubscribe()}}),[x,i,c,u]),t.useEffect((()=>{const e=c((async()=>{await w.current()}));return()=>e.unsubscribe()}),[c]),t.useEffect((()=>{if(b){const e=e=>Object.entries(e).map((([e,{validationRules:t}])=>[e,t])),t=e(b),n=e(u);kI(t,n)||v(!0)}}),[u]),t.useEffect((()=>{_&&E!==s&&w.current().then((()=>v(!1)))}),[_,s]),t.useEffect((()=>{const e=d.errors;if(e&&!oE(e)){const e=c((e=>{const t=Object.fromEntries(Object.entries(d.errors).filter((([e,t])=>"api"===t.type)));t&&!oE(t)&&Object.keys(t).forEach((t=>{g[t]!==e[t]&&f(t)})),y(e)}));return()=>e.unsubscribe()}}),[d,c]),{checkIsFormValid:x}})(n,O);t.useImperativeHandle(r,(()=>({addFieldEventListener:g,addCustomValidation:H,dispatchFieldEvent:y,getValues:e=>j(e,p),isDirty:R.isDirty,isValid:V,validate:$,removeFieldEventListener:_,reset:(e,t)=>{N(e,t),z("function"==typeof e?e(O.getValues())??d:e??d)},setErrors:W,clearErrors:F,setWarnings:q,setValue:I,submit:D(G,Y)})));const H=(e,t,n,r=!1)=>{CI.addCondition(e,t,n,M,r),T()},G=t.useCallback((()=>{s?.(j(void 0,p))}),[j,s,p]),Y=t.useCallback((e=>{setTimeout((()=>u?.(e)))}),[u]),W=e=>{Object.entries(e).forEach((([e,t])=>{B.current.includes(e)&&(Array.isArray(t)?k(e,{type:"api",message:t[0]}):k(e,"object"==typeof t?{type:"api",message:JSON.stringify(t)}:{type:"api",message:t}))}))},q=e=>{const t={};Object.entries(e).forEach((([e,n])=>{B.current.includes(e)&&(t[e]=n)})),S(t)};t.useEffect((()=>{P(L())}),[]),_s((()=>{N(ds(d))}),[d]),ys((()=>{C(i)}),[i||{}]),t.useEffect((()=>{v(o)}),[o]),t.useEffect((()=>{b((()=>D(G,Y)))}),[G,Y]),t.useEffect((()=>{E(c)}),[c]),t.useEffect((()=>{B.current=Z}),[Z]);const K=f?`frontend-engine-${f}`:"frontend-engine",J=[a,l].join(" ").trim(),X=c?"form":"div";return i?e.jsx(we,{...O,children:e.jsx(X,{id:K,"data-testid":f?exports.TestHelper.generateId(f,"frontend-engine"):K,className:J,noValidate:!0,onSubmit:D(G,Y),ref:r,children:e.jsx(gU,{})})}):e.jsxs(e.Fragment,{children:["Missing ",e.jsx("code",{children:"data"})," prop, unable to render Frontend Engine."]})})),_U=t.forwardRef(((t,n)=>e.jsx(GI,{children:e.jsx(yU,{...t,ref:n})})));exports.AxiosApiClient=sl,exports.Description=qT,exports.ERROR_MESSAGES=tm,exports.FileUploadContext=Zz,exports.FrontendEngine=_U,exports.GeolocationPositionErrorWrapper=qZ,exports.ImageContext=Yz,exports.OneMapError=EI,exports.OneMapService=vI,exports.Prompt=JT,exports.Sanitize=mI,exports.commonjsGlobal=St,exports.generateRandomId=rm,exports.lodash=gI,exports.useFieldEvent=qI,exports.useFormContext=xe,exports.useFrontendEngineComponent=()=>{const{addFieldEventListener:e,dispatchFieldEvent:t,removeFieldEventListener:n}=qI(),r=xe(),{setFieldValidationConfig:i,removeFieldValidationConfig:a}=Yk();return{event:{addFieldEventListener:e,dispatchFieldEvent:t,removeFieldEventListener:n},formContext:r,validation:{setValidation:i,removeValidation:a}}},exports.usePrevious=Kk,exports.useWindowHelper=Xk;
|
|
1117
|
-
//# sourceMappingURL=index.
|
|
1117
|
+
//# sourceMappingURL=index.7db1a25b.js.map
|