1(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports):typeof define==`function`&&define.amd?define([`exports`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.Validator={}))})(this,function(exports){var t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,s=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),c=(e,t,a,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=i(t),l=0,u=c.length,d;l<u;l++)d=c[l],!o.call(e,d)&&d!==a&&n(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(s=r(t,d))||s.enumerable});return e},l=(e,r,i)=>(i=e==null?{}:t(a(e)),c(r||!e||!e.__esModule?n(i,`default`,{value:e,enumerable:!0}):i,e)),u=class{is(e){return e.classList.contains(`js-date-a11ydate`)||e.classList.contains(`accessibility-date-element`)}getElement(e){let t=e.id.split(`-`);return t.pop(),document.getElementById(t.join(`-`))}getValue(e){let t=e[0].id,n=[this.getSubValue(t,`day`),this.getSubValue(t,`month`),this.getSubValue(t,`year`)];return n.filter(e=>!!e).length==3?[`${n[2]}-${n[1]}-${n[0]}`]:[]}getSubValue(e,t){return document.getElementById(`${e}-${t}`)?.value}},d=class{is(e){return e.classList.contains(`js-file`)}getValue(e){let t=e[0],n=new CustomEvent(`govisUploaderGetAllFiles`,{detail:{files:[]}});return t.dispatchEvent(n),n.detail.files||[]}},ee=class{is(e){return[`radio`,`checkbox`].includes(e.type)}getValue(e){return e.filter(e=>e.checked).map(e=>e.value)}},f=class{is(e){return e instanceof HTMLSelectElement}getValue(e){return Array.from(e[0].options).filter(e=>e.selected&&e.value).map(e=>e.value)}},p=class{is(e){return!0}getValue(e){let t=this.trim(e[0]);return t.length?[t]:[]}trim(e){let t=e?.value||``;return typeof t==`string`&&this.canTrimElement(e)?t:t.trim()}isTextElement(e){let t=e.tagName.toUpperCase();return t===`INPUT`&&e.type!==`hidden`||t===`TEXTAREA`}canTrimElement(e){return this.isTextElement(e)&&!e.hasAttribute(`readonly`)&&!e.hasAttribute(`disabled`)&&!e.classList.contains(`js-component-disabletrim`)}},te=class extends p{is(e){return e.type==`number`&&e.validity!==void 0}getValue(e){return e[0].validity.badInput?[`NaN`]:super.getValue(e)}},m=class{is(e){return e.classList.contains(`js-signature-pad`)}getValue(e){let t=e[0],n=new CustomEvent(`govisFormHasSignature`,{detail:{hasSignature:!1}});return t.closest(`[id="${t.id}-group"]`).dispatchEvent(n),n.detail.hasSignature?[`1`]:[]}},h=class{handlers;constructor(){this.handlers=[new m,new u,new d,new ee,new f,new te,new p]}getElement(e){let t=this.findElement(e);return t&&this.resolveElement(t)}resolveElement(e){let t=this.getHandler(e);return t.getElement?t.getElement(e):e}findElement(e){return e?e.closest(`[name]`)||e.querySelector(`[name]`):null}getValues(e){return this.getHandler(e[0]).getValue(e)||[]}getHandler(e){return this.handlers.find(t=>t.is(e))}},ne=class{form;elementResolver;constructor(e){this.form=e,this.elementResolver=new h}getForm(){return this.form}getValues(e){return this.elementResolver.getValues(e)}getAllElements(){let e=Array.from(this.form.querySelectorAll(`[name]:not([type="submit"], [type="reset"], [type="image"], [disabled])`)),t=new Map;for(let n of e)if(this.canValidateField(n)){let e=n.getAttribute(`name`);t.has(e)||t.set(e,[]),t.get(e).push(n)}return t}getValidatorField(e){let t=e.dataset.validatorErrorElementSelector;return t?this.querySelector(t):e}getElementsByName(e){return Array.from(this.form.querySelectorAll(`[name="${e}"]`))}querySelector(e){return this.form.querySelector(e)}querySelectorAll(e){return Array.from(this.form.querySelectorAll(e))}getMessage(e,t){let n=e.dataset;return n[`msg${t}`]||n.msg}getSubmitElement(){return this.form.querySelector(`[type="submit"]`)}getElement(e){let t=e.target,n=this.isElement(t)&&this.elementResolver.getElement(t);return this.canValidateField(n)&&n}checkable(e){return[`radio`,`checkbox`].includes(e.type)}isFocusOutDisabled(e){return[`js-validation-focusout-disabled`,`js-file`].some(t=>e.classList.contains(t))}closestSafely(e,t){let n=null;try{n=e.closest(t)}catch{console.warn(`Invalid selector ${t}`,e)}return n}getElementId(e,t){let n=e.id;if(n&&this.checkable(e)&&t!=`matrix`){let e=n.split(`-`);e.length>=3&&(n=[e[0],e[1],e[2]].join(`-`))}return n}focusFirst(e){for(let t=0;t<e.length;t++){let n=this.getValidatorField(this.querySelector(`[name="${e[t]}"]`));if(n&&this.isElementVisible(n)){n.focus();break}}}isElementVisible(e){if(!document.body.contains(e)||e.offsetParent===null)return!1;let t=window.getComputedStyle(e);
1if(t.visibility===`hidden`||t.visibility===`collapse`||e.closest(`details:not([open])`))return!1;let n=e.getBoundingClientRect();return n.width>0||n.height>0}canValidateField(e){return e&&!e?.classList?.contains(`ignore`)}isElement(e){return e instanceof Element}},re=class{wrapper;labels;constructor(e,t){this.wrapper=e,this.labels=t}resolveLabel(e,t){return(this.labels[e?.getAttribute(`name`)]||this.getDomLabel(e,t)||``).trim()}getDomLabel(e,t){let n=this.wrapper.getWrapper(e),r=n&&this.getDomElement(n,t);return r&&this.getLabelProcessedText(r)||this.getDataDomLabel(e)}getDomElement(e,t){return e.querySelector(`[for="${t}"]`)||e.querySelector(`[id="${t}-title"]`)}getDataDomLabel(e){return e.closest(`[data-validator-label]`)?.dataset?.validatorLabel||``}getLabelProcessedText(e){let t=e.cloneNode(!0);return t.querySelectorAll(`[aria-hidden="true"]`).forEach(e=>e.remove()),t.textContent}},g=class{domHelper;constructor(e){this.domHelper=e}getWrapper(e,t){let n=this.domHelper.getElementId(e),r=this.getSelectors(n,t),i=null;for(let t=0;t<r.length&&(i=this.domHelper.closestSafely(e,r[t]),!i);t++);return i}hasInvalidElement(e){return[...this.getWrapperClass(e)].reverse().some(t=>{let n=t.replace(`js-component-wrapper-`,`#`);return e.querySelector(`[id="${n}"]`)?.getAttribute(`aria-invalid`)==`true`})}getWrapperClass(e){return e?.className.split(/\s+/).filter(e=>e.startsWith(`js-component-wrapper-`))||[]}getSelectors(e,t){return[`[id="${t||e}-group"]`,`.js-component-wrapper-${e}`]}},_=class{stateStyler;domHelper;constructor(e,t){this.stateStyler=e,this.domHelper=t}show(e,t,n){let r=this.getOrCreate(e,n);r.innerHTML=t,r.style.removeProperty(`display`),this.stateStyler.setInvalid(r)}hide(e,t){let n=this.getError(e,t);n&&(n.innerHTML=``,this.stateStyler.setValid(n),n.style.display=`none`)}getOrCreate(e,t){let n=this.getError(e,t);return n||(n=this.create(this.domHelper.getElementId(e,t)),this.insert(e,n)),n}getError(e,t){let n=this.domHelper.getElementId(e,t);return this.domHelper.querySelector(`[id="${this.getId(n)}"]`)||this.domHelper.querySelector(`[id="${this.getId(e.id)}"]`)}insert(e,t){let n=`errorPlacement`in e.dataset&&this.domHelper.querySelector(e.dataset.errorPlacement)||e;n&&n.parentNode&&n.parentNode.insertBefore(t,n.nextSibling)}create(e){let t=document.createElement(`label`);return t.classList.add(`ignore`,`error`),t.setAttribute(`for`,e),t.id=this.getId(e),t}getId(e){return`${e}-error`}},ie=class{options;constructor(e){this.options={...e}}setValid(e){this.update(e,this.options.validClass,this.options.invalidClass)}setInvalid(e){this.update(e,this.options.invalidClass,this.options.validClass)}update(e,t,n){if(this.canUpdate(e)){let r=e.classList;r.add(t),r.remove(n)}}canUpdate(e){return e}},v={validClass:`valid`,invalidClass:`error`},ae=class{domHelper;stateStyler;wrapper;error;constructor(e,t,n={}){this.domHelper=e,this.wrapper=t,this.stateStyler=new ie({...v,...n}),this.error=new _(this.stateStyler,this.domHelper)}updateField(e,t,n,r){let i=this.domHelper.getValidatorField(e);t?(this.setValid(i),this.error.hide(i,r)):(this.setInvalid(i),this.error.show(i,n,r))}setValid(e){e.setAttribute(`aria-invalid`,`false`),this.stateStyler.setValid(e);let t=this.wrapper.getWrapper(e);t&&(this.wrapper.hasInvalidElement(t)?this.stateStyler.setInvalid(t):this.stateStyler.setValid(t))}setInvalid(e){e.setAttribute(`aria-invalid`,`true`),this.stateStyler.setInvalid(e),this.stateStyler.setInvalid(this.wrapper.getWrapper(e))}},y=class{delay;timers=new Map;constructor(e){this.delay=e??300}execute(e,t){this.clearTimer(e);let n=setTimeout(()=>{t(e),this.timers.delete(e)},this.delay);this.timers.set(e,n)}clearTimer(e){let t=this.timers.get(e);t&&(clearTimeout(t),this.timers.delete(e))}clearAllTimers(){this.timers.forEach(e=>clearTimeout(e)),this.timers.clear()}destroy(){this.clearAllTimers()}},oe=class{formState;domHelper;messageResolver;ruleCoordinator;lastActive=null;constructor(e,t,n,r){this.formState=e,this.domHelper=t,this.messageResolver=n,this.ruleCoordinator=r}attachListeners(e){this.domHelper.getForm().addEventListener(`focusin`,e=>{let t=this.domHelper.getElement(e);t?.name&&(this.lastActive=t)},{signal:e})}async validateAll(e){this.formState.clearAll();let t=[];for(let[n,r]of e){let e=await this.validate(n,r);
1e!==null&&!e.isValid&&t.push({element:r[0],response:e})}return this.domHelper.focusFirst(this.getInvalidNames(t)),t}async validate(e,t,n){this.formState.clear(e);let r=this.ruleCoordinator.getDirectRules(t[0]),i=await this.checkRules(e,t,r,n);return this.lastActive=t[0],i??{isValid:!0}}getValues(e,t){let n=[];try{n=Array.isArray(t)?t:this.domHelper.getValues(e)}catch{console.warn([`getValue`,e,t])}return n}async checkRules(e,t,n,r){let i=null,a=this.getValues(t,r);for(let r of n)try{let n=await this.checkRule(e,t,a,r);if(!n.isValid){i=n;break}}catch(e){console.warn([`rule`,r,t]),console.warn(e)}return n.length&&this.formState.update(e,i===null),i}async checkRule(e,t,n,r){let{ElementRuleClass:i,ruleConfig:a}=r,o=new i,s=await o.validate({config:a,elements:t,values:n,domHelper:this.domHelper}),c=``;return s||(c=this.getMessage(t[0],n,r,o)),{isValid:s,context:{type:a.type,ruleName:this.getRuleName(r),name:e,message:c}}}getMessage(e,t,n,r){let i=this.getRuleName(n),a=n.ruleConfig,o=this.ruleCoordinator.getRuleDataAttribute(i),s=r.getMessageParams&&r.getMessageParams(a,t,e)||[],c=r.getMessageKey&&r.getMessageKey(a,e)||``;return this.messageResolver.resolve(e,i,o,s,c)}getRuleName(e){return e.definition.name}getInvalidNames(e){let t=e.map(({response:e})=>e?.context?.name),n=this.lastActive?.name;return n&&t.includes(n)&&t.unshift(n),t}destroy(){this.lastActive=null,this.ruleCoordinator.destroy()}},b=class{connected;constructor(e,t){let n=t.reduce((e,t)=>(e[t.name]=t,e),{});this.connected={},this.createConnectedRules(e,n)}getConnected(e){return this.connected[e]||{}}createConnectedRules(e,t){for(let n in e){let r=e[n];for(let e in t)e in r&&t[e].updateConnectedRules(this.connected,n,r[e])}}},se=class{ruleRegistry;ruleResolver;rules;connectedRules;constructor(e,t,n){this.ruleRegistry=e,this.ruleResolver=t,this.rules=n,this.connectedRules=new b(this.rules,e.getAllConnected())}addRule(e,t,n){this.rules[e]??={},this.rules[e][t]=n}removeRule(e,t){delete this.rules[e]?.[t]}hasRuleByName(e,t){return!!this.getRuleByName(e,t)}getRuleByName(e,t){let n=this.getDirectRules(t[0]);for(let t of n)if(this.ruleRegistry.getRuleDefinition(t.ElementRuleClass).name==e)return t;return null}getDirectRules(e){let t=[],n=this.ruleRegistry.getAll();for(let r=0;r<n.length;r++){let i=n[r],a=this.ruleRegistry.getRuleDefinition(i),o=this.ruleResolver.resolve(e,a,this.rules);o!==null&&t.push({ElementRuleClass:i,definition:a,ruleConfig:o})}return t}getConnectedRules(e){let t=[],n=this.connectedRules.getConnected(e);for(let e in n){let r=n[e],i=[];for(let e in r){let t=this.ruleRegistry.get(e);i.push({ElementRuleClass:t,definition:this.ruleRegistry.getRuleDefinition(t),ruleConfig:r[e]})}t.push({name:e,ruleArray:i})}return t}getRuleDataAttribute(e){return this.ruleResolver.getRuleDataAttribute(e)}destroy(){this.ruleRegistry.destroy()}},x=class{static ruleDefinition={name:`zip`,getElementRule:function(e){let t=e.dataset;return t.govisZipCountryElementId||t.govisZipCountryCode}};async validate({values:e,elements:t}){let n=t[0],r=this.getCodes(n);return!e.length||!r.length||this.isValid(e[0],r)}isValid(e,t){let n=this.getRegExArray(t);return!n.length||n.some(t=>t.test(e))}getRegExArray(e){return e.filter(e=>this.getByCode(e).hasOwnProperty(`regExp`)).map(e=>RegExp(`^(`+this.getByCode(e).regExp+`)$`))}getByCode(e){if(e){let t=this._data;for(let n in t)if(t.hasOwnProperty(n)){if(t[n].country.hasOwnProperty(e))return{inputType:n,regExp:t[n].country[e]};{let r=t[n].countries;for(let t=0;t<r.length;t++)if(r[t].countries.includes(e))return{inputType:n,regExp:r[t].value}}}}return{}}getCountry(e){let t=e.dataset.govisZipCountryElementId;return t?e.closest(`form`).querySelector(`[id="${t}"]`):null}getCountryOptions(e){return e instanceof HTMLSelectElement?Array.from(e.options).filter(e=>e.selected):Array.from(e.querySelectorAll(`ul :checked`))}getCodes(e){let t=this.getCountry(e);return t?this.getCodesByCountry(t):[e.dataset.govisZipCountryCode||`CH`]}getCodesByCountry(e){return this.getCountryOptions(e).filter(e=>e.dataset.govisZipCountryCode).map(e=>e.dataset.govisZipCountryCode)}_data={number:{countries:[{countries:[`FO`,`GN`,`IS`,`LS`,`MG`,`OM`,`PG`,`TJ`],value:`\\d{3}`},{countries:`AF.AL.AU.AT.BD.BE.BG.CV.CY.DK.ET.GE.GL.GW.HU.SJ.LR.LI.MZ.NZ.NE.NO.PY.PH.SI.ZA.SJ.TN.VE.MK`.split(`.`),value:`\\d{4}`},{countries:`DZ.AS.AG.BT.BA.KH.CR.HR.DO.EG.EE.FI.FR.GF.DE.GP.GT.HN.ID.IQ.IT.JO.KE.KR.KW.LA.MY.MV.MQ.YT.MX.FM.MC.MN.MA.MM.NP.NC.NI.MP.PK.PE.RE.PM.SN.ES.LK.SD.TZ.TH.TR.UA.UY.VI.EH.ZM.RS.ME`.split(`.`),value:`\\d{5}
1`},{countries:[`BY`,`CN`,`CO`,`EC`,`IN`,`KZ`,`KG`,`NG`,`RO`,`RU`,`SG`,`TM`,`UZ`,`VN`],value:`\\d{6}`},{countries:[`CL`,`IL`],value:`\\d{7}`}],country:{CH:`(?!948[5-9]|949[0-8])[1-9]\\d{3}`,AM:`(\\d{4})|(\\d{6})`,BH:`\\d{3}\\d?`,MH:`((969)[6-7][0-9])`,WS:`(96799)`,GU:`((969)[1-3][0-2])`,SM:`(4789\\d)`,VA:`(00120)`,CX:`(6798)`,CC:`(6799)`,NF:`(2899)`,PW:`(96939|96940)`,WF:`((986)\\d{2})`,PF:`((987)\\d{2})`,LI:`(948[5-9])|(949[0-8])`}},text:{countries:[{countries:[`PR`,`US`],value:`[0-9]{5}(?:-[0-9]{4})?`}],country:{VC:`(VC)(\\d{4})`,PN:`(PCR9 1ZZ)`,MD:`(?:MD)[\\-]?(\\d{4})`,CA:`(?!.*[DFIOQU])[A-VXY][0-9][A-Z] +?[0-9][A-Z][0-9]`,MS:`(?:MSR )?(\\d{4})`,BB:`(?:BB)?(\\d{5})`,SK:`(\\d{3} \\d{2})|\\d{5}`,KY:`[K][Y][0-9]{1}[-]([0-9]){4}`,AR:`([A-Z]\\d{4}[A-Z]{3})|([A-Z]\\d{4})`,SA:`\\d{5}([\\-]\\d{4})?`,TW:`(\\d{3}[-]\\d{2})|(\\d{3})`,GR:`(\\d{3}) \\d{2}|\\d{5}`,CU:`(?:CP)?(\\d{5})`,LB:`\\d{4}( \\d{4})?`,IR:`\\d{5}[\\-]?\\d{5}`,BR:`[0-9]{5}-[0-9]{3}`,GG:`(GY)([0-9][0-9A-HJKPS-UW]?|[A-HK-Y][0-9][0-9ABEHMNPRV-Y]?) [0-9][ABD-HJLNP-UW-Z]{2}`,FK:`(FIQQ 1ZZ)`,JM:`(JM)[A-Z]{3}\\d{2}`,SZ:`([A-Z]\\d{3})`,SV:`((CP) \\d{4})`,LT:`((?:LT)[\\-])?(\\d{5})`,JP:`(\\d{3}-\\d{4})`,GI:`(GX11 1AA)`,TC:`(TKCA 1ZZ)`,MT:`[A-Z]{3} [0-9]{4}|[A-Z]{2}[0-9]{2}|[A-Z]{2} [0-9]{2}|[A-Z]{3}[0-9]{4}|[A-Z]{3}[0-9]{2}|[A-Z]{3} [0-9]{2}`,MU:`([0-9A-Z]\\d{4})`,HT:`(?:HT)(\\d{4})`,AZ:`(AZ) (\\d{4})`,PS:`(\\d{3}-\\d{3})`,BN:`[A-Z]{2}\\d{4}`,VG:`(VG11)[0-6][0]`,LU:`((?:L)[\\-])?(\\d{4})`,LV:`[L]{1}[V]{1}[-]([0-9]){4}`,PL:`[0-9]{2}[-]([0-9]){3}`,AD:`(?:AD)?(\\d{3})`,NL:`[0-9]{4} [A-Z]{2}|[0-9]{4}[A-Z]{2}`,JE:`JE[0-9]{1}[\\s]([\\d][A-Z]{2})`,CZ:`[0-9]{3} [0-9]{2}|[0-9]{5}`,IM:`(IM)([0-9][0-9A-HJKPS-UW]?|[A-HK-Y][0-9][0-9ABEHMNPRV-Y]?) [0-9][ABD-HJLNP-UW-Z]{2}`,SE:`(\\d{3} \\d{2})`,GB:`([Gg][Ii][Rr] 0[Aa]{2})|((([A-Za-z][0-9]{1,2})|(([A-Za-z][A-Ha-hJ-Yj-y][0-9]{1,2})|(([A-Za-z][0-9][A-Za-z])|([A-Za-z][A-Ha-hJ-Yj-y][0-9]?[A-Za-z])))) [0-9][A-Za-z]{2})`,BM:`[A-Z]{2} \\d{2}`,PT:`\\d{4}((-)\\d{3})`}}}},ce=class extends x{setup(e,t){this.attachListeners(e,t),e.querySelectorAll(`input[data-govis-zip-country-code]`).forEach(e=>{this.updateInputType(e,[e.dataset.govisZipCountryCode])})}attachListeners(e,t){e.querySelectorAll(`[data-govis-zip-country-element-id]`).forEach(e=>{let n=this.getCountry(e);n&&(n.addEventListener(`change`,async()=>{await t.isValid(e),this.onContryChange(e)}),this.onContryChange(e))})}onContryChange(e){let t=this.getCountry(e),n=this.getCodesByCountry(t);this.updateInputType(e,n)}updateInputType(e,t){let n=e.getAttribute(`type`);if(![`checkbox`,`radio`].includes(n)){let r={};for(let e=0;e<t.length;e++){let n=this.getByCode(t[e]).inputType;n&&(r[n]=1)}let i=this.getNewInputType(r);n!==i&&e.setAttribute(`type`,i)}}getNewInputType(e){let t=`text`;return!e.hasOwnProperty(`text`)&&e.hasOwnProperty(`number`)&&(t=`number`),t}},le=class{state=new Map;update(e,t){let n=this.state.get(e)??{isValid:!1};n.isValid=t,this.state.set(e,n)}isDirty(e){return this.state.has(e)}clear(e){this.state.delete(e)}clearAll(){this.state.clear()}isFormValid(){return!Object.values(this.state).some(e=>!e.isValid)}isValid(e){return!this.state.has(e)||this.state.get(e).isValid}},S=class{resolve(e,t,n){let r=this.getConfig(e,n);return[this.getConfigRule(e,t,r),this.getDataRule(e,t),this.getElementRule(e,t,r),this.getClassRule(e,t)].find(e=>e!==null)??null}getRuleDataAttribute(e){return e.charAt(0).toUpperCase()+e.substring(1).toLowerCase()}getConfig(e,t){let n=e?.getAttribute(`name`);return{...globalThis?.govisUploader?.[n]?.validation||{},...t?.[n]||{}}}getConfigRule(e,t,n){let r=t.name;return n?.[r]?n[r]:null}getElementRule(e,t,n){return t.getElementRule&&t.getElementRule(e,n)||null}getDataRule(e,t){let n=e.getAttribute(`data-${t.name.toLowerCase()}`);return n?this.getRule(n):null}getClassRule(e,t){let n=t.className||``;return n&&e.classList.contains(n)?this.getRule(!0):null}getRule(e){return{value:e}}},C=class e{static instances=new WeakMap;uiUpdater;domHelper;state;debouncer;abortController;validationCoordinator;ruleCoordinator;ruleRegistery;messageResolver;options;constructor(e,t,n,r,i){this.abortController=new AbortController,this.debouncer=new y(i.keyUpdebounceDelay),this.domHelper=e,this.uiUpdater=t,this.state=new le,this.options=i,this.ruleRegistery=n,this.ruleCoordinator=new se(this.ruleRegistery,new S,i.rules),this.messageResolver=r,this.validationCoordinator=new oe(this.state,this.domHelper,this.messageResolver,this.ruleCoordinator),e.getForm().setAttribute(`novalidate`,`novalidate`),this.attachListeners(i.autoSubmit||!1),new ce().setup(this.domHelper,this)}static create(t,n,r,i,a){let o=t.getForm(),s=e.get(o);s||(s=new e(t,n,r,i,a),e.instances.set(o,s));let c=new CustomEvent(`govisValidationInited`);return o.dispatchEvent(c),s}static get(t){return e.instances.has(t)?e.instances.get(t):null}hasRule(e,t){let n=this.domHelper.getElementsByName(e);return this.ruleCoordinator.hasRuleByName(t,n)}getRuleConfig(e,t){let n=this.domHelper.getElementsByName(e);return this.ruleCoordinator.getRuleByName(t,n)?.ruleConfig}
1registerRules(e,t){e.forEach(e=>{this.ruleRegistery.register(e)}),this.messageResolver.register(t||{})}addRule(e,t,n){this.ruleCoordinator.addRule(e,t,n)}removeRule(e,t){this.ruleCoordinator.removeRule(e,t);let n=this.domHelper.getElementsByName(e);n.length&&this.uiUpdater.setValid(n[0])}getRules(e){return this.ruleCoordinator.getDirectRules(e).reduce((e,{definition:t,ruleConfig:n})=>(e[t.name]=n.value,e),{})}async isValid(e,t){return await this.validate(e?.getAttribute(`name`),t)}async isValidRule(e,t){return await this.validate(e?.getAttribute(`name`),t)}attachListeners(e){let t=this.abortController.signal;this.validationCoordinator.attachListeners(t),this.attachElementListeners(t),this.attachFormListeners(t,e)}attachElementListeners(e){this.setFocusOutListener(e);let t=this.domHelper.getForm();t.addEventListener(`keyup`,async e=>{let t=this.domHelper.getElement(e);t&&!this.isOmitEvent(t,e)&&this.isDirty(t)&&await this.revalidate(t)},{signal:e}),t.addEventListener(`click`,async e=>{let t=this.domHelper.getElement(e);await this.revalidate(t)},{signal:e})}setFocusOutListener(e){let t=this.domHelper.getForm();this.domHelper.isFocusOutDisabled(t)||t.addEventListener(`focusout`,async e=>{let t=this.domHelper.getElement(e);t&&this.canReValidateOnFocusOut(t)&&this.validate(t?.getAttribute(`name`))},{signal:e})}attachFormListeners(e,t){let n=this.domHelper.getForm();n.addEventListener(`submit`,async e=>{e.preventDefault();let r=this.domHelper.getSubmitElement();r.setAttribute(`disabled`,`disabled`);let i=await this.isFormValid();if(i){if(this.options.submitHandler)return r.removeAttribute(`disabled`),this.options.submitHandler(e);t&&HTMLFormElement.prototype.submit.call(n)}if((!i||!t)&&r.removeAttribute(`disabled`),i){let e=new CustomEvent(`govisFormSubmit`);n.dispatchEvent(e)}},{signal:e})}isOmitEvent=(e,t)=>new Set([`Shift`,`Control`,`Alt`,`CapsLock`,`End`,`Home`,`ArrowLeft`,`ArrowUp`,`ArrowRight`,`ArrowDown`,`Insert`,`NumLock`]).has(t.key)||t.key===`Tab`&&e?.value===``;async revalidate(e){e&&this.isDirty(e)&&await this.validate(e?.getAttribute(`name`))}async validateConnected(e){let t=this.ruleCoordinator.getConnectedRules(e);for(let e=0;e<t.length;e++){let{name:n,ruleArray:r}=t[e],i=this.domHelper.getElementsByName(n);if(i.length&&(await this.validationCoordinator.validate(n,i)).isValid){let e=await this.validationCoordinator.checkRules(n,i,r);this.update(i[0],e)}}}async validate(e,t){if(e){let n=this.domHelper.getElementsByName(e);n.length&&this.clearErrors(n[0]);let r=await this.validationCoordinator.validate(e,n,t);return this.update(n[0],r),await this.validateConnected(e),r}return{isValid:!0}}isDirty(e){let t=e?.getAttribute(`name`);return t&&this.state.isDirty(t)}async isFormValid(){this.debouncer.clearAllTimers();let e=this.domHelper.getAllElements();
1e.values().forEach(e=>{this.clearErrors(e[0])});let t=await this.validationCoordinator.validateAll(e);return t.forEach(({element:e,response:t})=>{this.update(e,t)}),!t.length}canReValidateOnFocusOut(e){return!this.domHelper.isFocusOutDisabled(e)&&(this.isDirty(e)||this.domHelper.getValues([e]).length||this.ruleCoordinator.hasRuleByName(`required`,[e]))}update(e,t){if(this.isDirty(e)){let n=t?.context;this.uiUpdater.updateField(e,t?t.isValid:!0,n?.message,n?.type)}}updateErrorMessage(e,t,n,r){this.uiUpdater.updateField(e,t,n,r)}clearErrors(e){this.isDirty(e)&&this.uiUpdater.updateField(e,!0,``)}destroy(){this.debouncer.destroy(),this.abortController.abort(),this.validationCoordinator.destroy()}},ue=class{rules;constructor(e=[]){this.rules=new Map,e.forEach(e=>this.register(e))}getRuleDefinition(e){return e.ruleDefinition}register(e){let t=this.getRuleDefinition(e).name;this.rules.set(t,e)}unregister(e){this.rules.delete(e)}get(e){return this.rules.get(e)}isConnected(e){let t=this.get(e);return!t||this.isConnectedRule(t)}getAll(){return Array.from(this.rules.values())}getAllConnected(){return this.getAll().filter(e=>this.isConnectedRule(e)).map(e=>this.getRuleDefinition(e))}isConnectedRule(e){return!!this.getRuleDefinition(e)?.updateConnectedRules}destroy(){this.rules.clear()}},w=class{static ruleDefinition={name:`regex`};async validate({config:e,values:t}){return!t.length||this.isValid(e.value,t[0])}isValid(e,t){return(typeof e==`string`?new RegExp(e):e).test(t)}},de=class extends w{static ruleDefinition={name:`emailList`};async validate(e){return await super.validate({...e,config:{value:/^((")?(?:[^\."])(?:(?:[\.])?(?:[\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\w\-!#$%&'*+\/=?^_`{|}~]))*\1@(\w[\-\w\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]*\.){1,5}([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]){2,15}[,;]?)+$/}})}},T=class{static ruleDefinition={name:`housenumber`};async validate({config:e,values:t}){let n=t[0];return!t.length||n.length<=12}},fe=class{static ruleDefinition={name:`intltelinput`};async validate({values:e,elements:t}){return!e.length||!globalThis.intlTelInput||globalThis.intlTelInput.getInstance(t[0]).isValidNumber()}},E=class{static ruleDefinition={name:`abstractCompareRule`};async validate({config:e,values:t,elements:n}){let r=this.getLimit(n[0],e),i=this.resolveType(e.type,n[0]),a=this.getCompareValues(t,r,i);return a.length!=2||this.compare(a[0],a[1],i)}getCompareValues(e,t,n){return(e.length?[this.castValue(e[0],n),this.castValue(t,n)]:[]).filter(e=>e!==null)}castValue(e,t){if([`range`,`number`].includes(t)){let t=Number(e);return isNaN(t)?null:t}return e}compare(e,t,n){return!1}getLimit(e,t){return``}resolveType(e,t){return e||t.type||``}getMessageType(e,t){let n=this.resolveType(e,t);return[`date`,`time`].includes(n)?n.charAt(0).toUpperCase()+n.substring(1).toLowerCase():``}format(e,t,n){if(this.resolveType(e.type,n)==`date`){let[e,n,r]=t.split(`-`).map(Number);return new Date(e,n-1,r).toLocaleDateString()}return t}getMessageParams(e,t,n){return[this.format(e,this.getLimit(n,e),n)]}},D=class extends E{static ruleDefinition={name:`max`,getElementRule:(e,t)=>{let n=[`dateYearsInFuture`,`dateYearsInPast`,`maxAge`,`minAge`].some(e=>t.hasOwnProperty(e))?``:e.getAttribute(`max`);return n?{value:n}:null}};getLimit(e,t){return e.getAttribute(`max`)||t.value}compare(e,t,n){return e<=t}getMessageKey(e,t){return`max${this.getMessageType(e.type,t)}`}},O=class extends E{static ruleDefinition={name:`min`,getElementRule:(e,t)=>{let n=[`dateYearsInFuture`,`dateYearsInPast`,`maxAge`,`minAge`,`maxDate`,`minDate`].some(e=>t.hasOwnProperty(e))?``:e.getAttribute(`min`);return n?{value:n}:null}};getLimit(e,t){return e.getAttribute(`min`)||t.value}compare(e,t,n){return e>=t}getMessageKey(e,t){return`min${this.getMessageType(e.type,t)}`}},k=class{static ruleDefinition={name:`postnumber`};async validate({config:e,values:t}){let n=t[0];return!t.length||n>=1&&/^([0-9]+){0,5}$/.test(n)}},pe=class{static ruleDefinition={name:`required`,className:`required`,getElementRule:e=>e.hasAttribute(`required`)};async validate({values:e}){return e.length>0}},me=class{static ruleDefinition={name:`editorrequired`};async validate({elements:e}){return globalThis.CKEDITOR.instances[e[0].id].updateElement(),!!e[0].value}},A=class{static ruleDefinition={name:`maprequired`,getElementRule:function(e){let t=this.getElements(e);return t.length?{value:JSON.stringify(t)}:null},getElements(e){let t=e.classList.contains(`maprequired`)?e.querySelectorAll(`[name]`):[];return Array.from(t).map(e=>({name:e.getAttribute(`name`)}))}};async validate({elements:e,config:t}){let n=e[0].closest(`form`);return this.getFields(t).some(({name:e})=>{let t=n.querySelector(`[name="${e}"]`);return t&&!!t.value})}getFields(e){let t=[];try{t=JSON.parse(e.value)||[]}catch(e){console.warn(e)}return t}getMessageKey(){return`mapRequired`}};function he(){return[me,A,pe]}var ge={128:`â¬`,130:`â`,131:`Æ`,132:`â`,133:`â¦`,134:`â `,135:`â¡`,136:`Ë`,137:`â°`,138:`Å `,139:`â¹`,140:`Å`,142:`Ž`,145:`â`,146:`â`,147:`â`,148:`â`,149:`â¢`,150:`â`,151:`â`,152:`Ë`,153:`â¢`,154:`Å¡`,155:`âº`,156:`Å`,158:`ž`,159:`Ÿ`},_e={};for(let[e,t]of Object.entries(ge))_e[t]=Number.parseInt(e);function ve(e,t=`utf-8`){switch(t.toLowerCase()){case`utf-8`:case`utf8`:return globalThis.TextDecoder===void 0?ye(e):new globalThis.TextDecoder(`utf-8`).decode(e);case`utf-16le`:return be(e);case`ascii`:return xe(e);case`latin1`:case`iso-8859-1`:return Se(e);case`windows-1252`:return Ce(e);default:throw RangeError(`Encoding '${t}' not supported`)}}function ye(e){let t=``,n=0;for(;n<e.length;){let r=e[n++];if(r<128)t+=String.fromCharCode(r);else if(r<224){let i=e[n++]&63;t+=String.fromCharCode((r&31)<<6|i)}else if(r<240){let i=e[n++]&63,a=e[n++]&63;t+=String.fromCharCode((r&15)<<12|i<<6|a)}else{let i=e[n++]&63,a=e[n++]&63,o=e[n++]&63,s=(r&7)<<18|i<<12|a<<6|o;s-=65536,t+=String.fromCharCode(55296+(s>>10&1023),56320+(s&1023))}}return t}function be(e){let t=``;for(let n=0;n<e.length;n+=2)t+=String.fromCharCode(e[n]|e[n+1]<<8);return t}function xe(e){return String.fromCharCode(...e.map(e=>e&127))}function Se(e){return String.fromCharCode(...e)}function Ce(e){let t=``;for(let n of e)n>=128&&n<=159&&ge[n]?t+=ge[n]:t+=String.fromCharCode(n);return t}function j(e){return new DataView(e.buffer,e.byteOffset)}let we={len:1,get(e,t){return j(e).getUint8(t)},put(e,t,n){return j(e).setUint8(t,n),t+1}},M={len:2,get(e,t){return j(e).getUint16(t,!0)},put(e,t,n){return j(e).setUint16(t,n,!0),t+2}},N={len:2,get(e,t){return j(e).getUint16(t)},put(e,t,n){return j(e).setUint16(t,n),t+2}},P={len:4,get(e,t){return j(e).getUint32(t,!0)},put(e,t,n){return j(e).setUint32(t,n,!0),t+4}},Te={len:4,get(e,t){return j(e).getUint32(t)},put(e,t,n){return j(e).setUint32(t,n),t+4}},Ee={len:4,get(e,t){return j(e).getInt32(t)},put(e,t,n){return j(e).setInt32(t,n),t+4}},De={len:8,get(e,t){return j(e).getBigUint64(t,!0)},put(e,t,n){return j(e).setBigUint64(t,n,!0),t+8}};var F=class{constructor(e,t){this.len=e,this.encoding=t}get(e,t=0){let n=e.subarray(t,t+this.len);return ve(n,this.encoding)}}
1,I=class extends Error{constructor(){super(`End-Of-Stream`),this.name=`EndOfStreamError`}},Oe=class extends Error{constructor(e=`The operation was aborted`){super(e),this.name=`AbortError`}},ke=class{constructor(){this.endOfStream=!1,this.interrupted=!1,this.peekQueue=[]}async peek(e,t=!1){let n=await this.read(e,t);return this.peekQueue.push(e.subarray(0,n)),n}async read(e,t=!1){if(e.length===0)return 0;let n=this.readFromPeekBuffer(e);if(this.endOfStream||(n+=await this.readRemainderFromStream(e.subarray(n),t)),n===0&&!t)throw new I;return n}readFromPeekBuffer(e){let t=e.length,n=0;for(;this.peekQueue.length>0&&t>0;){let r=this.peekQueue.pop();if(!r)throw Error(`peekData should be defined`);let i=Math.min(r.length,t);e.set(r.subarray(0,i),n),n+=i,t-=i,i<r.length&&this.peekQueue.push(r.subarray(i))}return n}async readRemainderFromStream(e,t){let n=0;for(;n<e.length&&!this.endOfStream;){if(this.interrupted)throw new Oe;let r=await this.readFromStream(e.subarray(n),t);if(r===0)break;n+=r}if(!t&&n<e.length)throw new I;return n}},Ae=class extends ke{constructor(e){super(),this.reader=e}async abort(){return this.close()}async close(){this.reader.releaseLock()}},je=class extends Ae{async readFromStream(e,t){if(e.length===0)return 0;let n=await this.reader.read(new Uint8Array(e.length),{min:t?void 0:e.length});return n.done&&(this.endOfStream=n.done),n.value?(e.set(n.value),n.value.length):0}},Me=class extends ke{constructor(e){super(),this.reader=e,this.buffer=null}writeChunk(e,t){let n=Math.min(t.length,e.length);return e.set(t.subarray(0,n)),n<t.length?this.buffer=t.subarray(n):this.buffer=null,n}async readFromStream(e,t){if(e.length===0)return 0;let n=0;for(this.buffer&&(n+=this.writeChunk(e,this.buffer));n<e.length&&!this.endOfStream;){let t=await this.reader.read();if(t.done){this.endOfStream=!0;break}t.value&&(n+=this.writeChunk(e.subarray(n),t.value))}if(!t&&n===0&&this.endOfStream)throw new I;return n}abort(){return this.interrupted=!0,this.reader.cancel()}async close(){await this.abort(),this.reader.releaseLock()}};function Ne(e){try{let t=e.getReader({mode:`byob`});return t instanceof ReadableStreamDefaultReader?new Me(t):new je(t)}catch(t){if(t instanceof TypeError)return new Me(e.getReader());throw t}}var Pe=class{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){let n=new Uint8Array(e.len);if(await this.readBuffer(n,{position:t})<e.len)throw new I;return e.get(n,0)}async peekToken(e,t=this.position){let n=new Uint8Array(e.len);if(await this.peekBuffer(n,{position:t})<e.len)throw new I;return e.get(n,0)}async readNumber(e){if(await this.readBuffer(this.numBuffer,{length:e.len})<e.len)throw new I;return e.get(this.numBuffer,0)}async peekNumber(e){if(await this.peekBuffer(this.numBuffer,{length:e.len})<e.len)throw new I;return e.get(this.numBuffer,0)}async ignore(e){if(e<0)throw RangeError(`ignore length must be ⥠0 bytes`);if(this.fileInfo.size!==void 0){let 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(!this.supportsRandomAccess()&&t&&t.position!==void 0&&t.position<this.position)throw Error("`options.position` must be equal or greater than `tokenizer.position`");return{mayBeLess:!1,offset:0,length:e.length,position:this.position,...t}}abort(){return Promise.resolve()}},Fe=256e3,Ie=class extends Pe{constructor(e,t){super(t),this.streamReader=e,this.fileInfo=t?.fileInfo??{}}async readBuffer(e,t){let 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 Error("`options.position` must be equal or greater than `tokenizer.position`");if(n.length===0)return 0;let i=await this.streamReader.read(e.subarray(0,n.length),n.mayBeLess);if(this.position+=i,(!t||!t.mayBeLess)&&i<n.length)throw new I;return i}async peekBuffer(e,t){let n=this.normalizeOptions(e,t),r=0;if(n.position){let t=n.position-this.position;if(t>0){let i=new Uint8Array(n.length+t);return r=await this.peekBuffer(i,{mayBeLess:n.mayBeLess}),e.set(i.subarray(t)),r-t}if(t<0)throw Error(`Cannot peek from a negative offset in a stream`)}if(n.length>0){try{r=await this.streamReader.peek(e.subarray(0,n.length),n.mayBeLess)}catch(e){if(t?.mayBeLess&&e instanceof I)return 0;throw e}if(!n.mayBeLess&&r<n.length)throw new I}return r}async ignore(e){if(e<0)throw RangeError(`ignore length must be ⥠0 bytes`);let t=Math.min(Fe,e),n=new Uint8Array(t),r=0;for(;r<e;){let 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()}async close(){return this.streamReader.close()}supportsRandomAccess(){return!1}},Le=class extends Pe{constructor(e,t){super(t),this.uint8Array=e,this.fileInfo={...t?.fileInfo??{},size:e.length}}async readBuffer(e,t){t?.position&&(this.position=t.position);let n=await this.peekBuffer(e,t);return this.position+=n,n}async peekBuffer(e,t){let n=this.normalizeOptions(e,t),r=Math.min(this.uint8Array.length-n.position,n.length);if(!n.mayBeLess&&r<n.length)throw new I;return e.set(this.uint8Array.subarray(n.position,n.position+r)),r}close(){return super.close()}supportsRandomAccess(){return!0}setPosition(e){this.position=e}},Re=class extends Pe{constructor(e,t){super(t),this.blob=e,this.fileInfo={...t?.fileInfo??{},size:e.size,mimeType:e.type}}async readBuffer(e,t){t?.position&&(this.position=t.position);let n=await this.peekBuffer(e,t);return this.position+=n,n}async peekBuffer(e,t){let n=this.normalizeOptions(e,t),r=Math.min(this.blob.size-n.position,n.length);if(!n.mayBeLess&&r<n.length)throw new I;let i=await this.blob.slice(n.position,n.position+r).arrayBuffer();return e.set(new Uint8Array(i)),r}close(){return super.close()}supportsRandomAccess(){return!0}setPosition(e){this.position=e}};function ze(e,t){let n=Ne(e),r=t??{},i=r.onClose;return r.onClose=async()=>
vendor: 4,586 bytes, line 1
1{if(await n.close(),i)return i()},new Ie(n,r)}function Be(e,t){return new Le(e,t)}function Ve(e,t){return new Re(e,t)}var He=s(((exports,t)=>{var n=1e3,r=n*60,i=r*60,a=i*24,o=a*7,s=a*365.25;t.exports=function(e,t){t||={};var n=typeof e;if(n===`string`&&e.length>0)return c(e);if(n===`number`&&isFinite(e))return t.long?u(e):l(e);throw Error(`val is not a non-empty string or a valid number. val=`+JSON.stringify(e))};function c(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var c=parseFloat(t[1]);switch((t[2]||`ms`).toLowerCase()){case`years`:case`year`:case`yrs`:case`yr`:case`y`:return c*s;case`weeks`:case`week`:case`w`:return c*o;case`days`:case`day`:case`d`:return c*a;case`hours`:case`hour`:case`hrs`:case`hr`:case`h`:return c*i;case`minutes`:case`minute`:case`mins`:case`min`:case`m`:return c*r;case`seconds`:case`second`:case`secs`:case`sec`:case`s`:return c*n;case`milliseconds`:case`millisecond`:case`msecs`:case`msec`:case`ms`:return c;default:return}}}}function l(e){var t=Math.abs(e);return t>=a?Math.round(e/a)+`d`:t>=i?Math.round(e/i)+`h`:t>=r?Math.round(e/r)+`m`:t>=n?Math.round(e/n)+`s`:e+`ms`}function u(e){var t=Math.abs(e);return t>=a?d(e,t,a,`day`):t>=i?d(e,t,i,`hour`):t>=r?d(e,t,r,`minute`):t>=n?d(e,t,n,`second`):e+` ms`}function d(e,t,n,r){var i=t>=n*1.5;return Math.round(e/n)+` `+r+(i?`s`:``)}})),Ue=s(((exports,t)=>{function n(e){n.debug=n,n.default=n,n.coerce=c,n.disable=o,n.enable=i,n.enabled=s,n.humanize=He(),n.destroy=l,Object.keys(e).forEach(t=>{n[t]=e[t]}),n.names=[],n.skips=[],n.formatters={};function t(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return n.colors[Math.abs(t)%n.colors.length]}n.selectColor=t;function n(e){let t,i=null,a,o;function s(...e){if(!s.enabled)return;let r=s,i=Number(new Date);r.diff=i-(t||i),r.prev=t,r.curr=i,t=i,e[0]=n.coerce(e[0]),typeof e[0]!=`string`&&e.unshift(`%O`);let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(t,i)=>{if(t===`%%`)return`%`;a++;let o=n.formatters[i];if(typeof o==`function`){let n=e[a];t=o.call(r,n),e.splice(a,1),a--}return t}),n.formatArgs.call(r,e),(r.log||n.log).apply(r,e)}return s.namespace=e,s.useColors=n.useColors(),s.color=n.selectColor(e),s.extend=r,s.destroy=n.destroy,Object.defineProperty(s,`enabled`,{enumerable:!0,configurable:!1,get:()=>i===null?(a!==n.namespaces&&(a=n.namespaces,o=n.enabled(e)),o):i,set:e=>{i=e}}),typeof n.init==`function`&&n.init(s),s}function r(e,t){let r=n(this.namespace+(t===void 0?`:`:t)+e);return r.log=this.log,r}function i(e){n.save(e),n.namespaces=e,n.names=[],n.skips=[];let t=(typeof e==`string`?e:``).trim().replace(/\s+/g,`,`).split(`,`).filter(Boolean);for(let e of t)e[0]===`-`?n.skips.push(e.slice(1)):n.names.push(e)}function a(e,t){let n=0,r=0,i=-1,a=0;for(;n<e.length;)if(r<t.length&&(t[r]===e[n]||t[r]===`*`))t[r]===`*`?(i=r,a=n,r++):(n++,r++);else if(i!==-1)r=i+1,a++,n=a;else return!1;for(;r<t.length&&t[r]===`*`;)r++;return r===t.length}function o(){let e=[...n.names,...n.skips.map(e=>`-`+e)].join(`,`);return n.enable(``),e}function s(e){for(let t of n.skips)if(a(e,t))return!1;for(let t of n.names)if(a(e,t))return!0;return!1}function c(e){return e instanceof Error?e.stack||e.message:e}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}t.exports=n})),We=l(s(((exports,t)=>{exports.formatArgs=r,exports.save=i,exports.load=a,exports.useColors=n,exports.storage=o(),exports.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),exports.colors=`#0000CC.#0000FF.#0033CC.#0033FF.#0066CC.#0066FF.#0099CC.#0099FF.#00CC00.#00CC33.#00CC66.#00CC99.#00CCCC.#00CCFF.#3300CC.#3300FF.#3333CC.#3333FF.#3366CC.#3366FF.#3399CC.#3399FF.#33CC00.#33CC33.#33CC66.#33CC99.#33CCCC.#33CCFF.#6600CC.#6600FF.#6633CC.#6633FF.#66CC00.#66CC33.#9900CC.#9900FF.#9933CC.#9933FF.#99CC00.#99CC33.#CC0000.#CC0033.#CC0066.#CC0099.#CC00CC.#CC00FF.#CC3300.#CC3333.#CC3366.#CC3399.#CC33CC.#CC33FF.#CC6600.#CC6633.#CC9900.#CC9933.#CCCC00.#CCCC33.#FF0000.#FF0033.#FF0066.#FF0099.#FF00CC.#FF00FF.#FF3300.#FF3333.#FF3366.#FF3399.#FF33CC.#FF33FF.#FF6600.#FF6633.#FF9900.#FF9933.#FFCC00.#FFCC33`.split(`.`);function n(){if(typeof window<`u`&&window.process&&(window.process.type===`renderer`||window.process.__nwjs))return!0;
1if(typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<`u`&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<`u`&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<`u`&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(e){if(e[0]=(this.useColors?`%c`:``)+this.namespace+(this.useColors?` %c`:` `)+e[0]+(this.useColors?`%c `:` `)+`+`+t.exports.humanize(this.diff),!this.useColors)return;let n=`color: `+this.color;e.splice(1,0,n,`color: inherit`);let r=0,i=0;e[0].replace(/%[a-zA-Z%]/g,e=>{e!==`%%`&&(r++,e===`%c`&&(i=r))}),e.splice(i,0,n)}exports.log=console.debug||console.log||(()=>{});function i(t){try{t?exports.storage.setItem(`debug`,t):exports.storage.removeItem(`debug`)}catch{}}function a(){let t;try{t=exports.storage.getItem(`debug`)||exports.storage.getItem(`DEBUG`)}catch{}return!t&&typeof process<`u`&&`env`in process&&(t=process.env.DEBUG),t}function o(){try{return localStorage}catch{}}t.exports=Ue()(exports);var{formatters:s}=t.exports;s.j=function(e){try{return JSON.stringify(e)}catch(e){return`[UnexpectedJSONParseError]: `+e.message}}}))());let L={LocalFileHeader:67324752,DataDescriptor:134695760,CentralFileHeader:33639248,EndOfCentralDirectory:101010256},Ge={get(e){return{signature:P.get(e,0),compressedSize:P.get(e,8),uncompressedSize:P.get(e,12)}},len:16},Ke={get(e){let t=M.get(e,6);return{signature:P.get(e,0),minVersion:M.get(e,4),dataDescriptor:!!(t&8),compressedMethod:M.get(e,8),compressedSize:P.get(e,18),uncompressedSize:P.get(e,22),filenameLength:M.get(e,26),extraFieldLength:M.get(e,28),filename:null}},len:30},qe={get(e){return{signature:P.get(e,0),nrOfThisDisk:M.get(e,4),nrOfThisDiskWithTheStart:M.get(e,6),nrOfEntriesOnThisDisk:M.get(e,8),nrOfEntriesOfSize:M.get(e,10),sizeOfCd:P.get(e,12),offsetOfStartOfCd:P.get(e,16),zipFileCommentLength:M.get(e,20)}},len:22},Je={get(e){let t=M.get(e,8);return{signature:P.get(e,0),minVersion:M.get(e,6),dataDescriptor:!!(t&8),compressedMethod:M.get(e,10),compressedSize:P.get(e,20),uncompressedSize:P.get(e,24),filenameLength:M.get(e,28),extraFieldLength:M.get(e,30),fileCommentLength:M.get(e,32),relativeOffsetOfLocalHeader:P.get(e,42),filename:null}},len:46};function Ye(e){let t=new Uint8Array(P.len);return P.put(t,0,e),t}var R=(0,We.default)(`tokenizer:inflate`),Xe=256*1024,Ze=Ye(L.DataDescriptor),z=Ye(L.EndOfCentralDirectory),Qe=class e{constructor(e){this.tokenizer=e,this.syncBuffer=new Uint8Array(Xe)}async isZip(){return await this.peekSignature()===L.LocalFileHeader}peekSignature(){return this.tokenizer.peekToken(P)}async findEndOfCentralDirectoryLocator(){let e=this.tokenizer,t=Math.min(16*1024,e.fileInfo.size),n=this.syncBuffer.subarray(0,t);await this.tokenizer.readBuffer(n,{position:e.fileInfo.size-t});for(let r=n.length-4;r>=0;r--)if(n[r]===z[0]&&n[r+1]===z[1]&&n[r+2]===z[2]&&n[r+3]===z[3])return e.fileInfo.size-t+r;return-1}async readCentralDirectory(){if(!this.tokenizer.supportsRandomAccess()){R(`Cannot reading central-directory without random-read support`);return}R(`Reading central-directory...`);let e=this.tokenizer.position,t=await this.findEndOfCentralDirectoryLocator();if(t>0){R(`Central-directory 32-bit signature found`);let n=await this.tokenizer.readToken(qe,t),r=[];this.tokenizer.setPosition(n.offsetOfStartOfCd);for(let e=0;e<n.nrOfEntriesOfSize;++e){let t=await this.tokenizer.readToken(Je);if(t.signature!==L.CentralFileHeader)throw Error(`Expected Central-File-Header signature`);t.filename=await this.tokenizer.readToken(new F(t.filenameLength,`utf-8`)),await this.tokenizer.ignore(t.extraFieldLength),await this.tokenizer.ignore(t.fileCommentLength),r.push(t),R(`Add central-directory file-entry: n=${e+1}/${r.length}: filename=${r[e].filename}`)}return this.tokenizer.setPosition(e),r}this.tokenizer.setPosition(e)}async unzip(e){let t=await this.readCentralDirectory();if(t)return this.iterateOverCentralDirectory(t,e);let n=!1;do{let t=await this.readLocalFileHeader();if(!t)break;let r=e(t);n=!!r.stop;let i;if(await this.tokenizer.ignore(t.extraFieldLength),t.dataDescriptor&&t.compressedSize===0){let e=[],n=Xe;R(`Compressed-file-size unknown, scanning for next data-descriptor-signature....`);let i=-1;for(;i<0&&n===Xe;){n=await this.tokenizer.peekBuffer(this.syncBuffer,{mayBeLess:!0}),i=$e(this.syncBuffer.subarray(0,n),Ze);let t=i>=0?i:n;if(r.handler){let n=new Uint8Array(t);await this.tokenizer.readBuffer(n),e.push(n)}else await this.tokenizer.ignore(t)}
1R(`Found data-descriptor-signature at pos=${this.tokenizer.position}`),r.handler&&await this.inflate(t,et(e),r.handler)}else r.handler?(R(`Reading compressed-file-data: ${t.compressedSize} bytes`),i=new Uint8Array(t.compressedSize),await this.tokenizer.readBuffer(i),await this.inflate(t,i,r.handler)):(R(`Ignoring compressed-file-data: ${t.compressedSize} bytes`),await this.tokenizer.ignore(t.compressedSize));if(R(`Reading data-descriptor at pos=${this.tokenizer.position}`),t.dataDescriptor&&(await this.tokenizer.readToken(Ge)).signature!==134695760)throw Error(`Expected data-descriptor-signature at position ${this.tokenizer.position-Ge.len}`)}while(!n)}async iterateOverCentralDirectory(e,t){for(let n of e){let e=t(n);if(e.handler){this.tokenizer.setPosition(n.relativeOffsetOfLocalHeader);let t=await this.readLocalFileHeader();if(t){await this.tokenizer.ignore(t.extraFieldLength);let r=new Uint8Array(n.compressedSize);await this.tokenizer.readBuffer(r),await this.inflate(t,r,e.handler)}}if(e.stop)break}}async inflate(t,n,r){if(t.compressedMethod===0)return r(n);if(t.compressedMethod!==8)throw Error(`Unsupported ZIP compression method: ${t.compressedMethod}`);R(`Decompress filename=${t.filename}
1, compressed-size=${n.length}`);let i=await e.decompressDeflateRaw(n);return r(i)}static async decompressDeflateRaw(e){let t=new ReadableStream({start(t){t.enqueue(e),t.close()}}),n=new DecompressionStream(`deflate-raw`),r=t.pipeThrough(n);try{let e=await new Response(r).arrayBuffer();return new Uint8Array(e)}catch(e){let t=e instanceof Error?`Failed to deflate ZIP entry: ${e.message}`:`Unknown decompression error in ZIP entry`;throw TypeError(t)}}async readLocalFileHeader(){let e=await this.tokenizer.peekToken(P);if(e===L.LocalFileHeader){let e=await this.tokenizer.readToken(Ke);return e.filename=await this.tokenizer.readToken(new F(e.filenameLength,`utf-8`)),e}if(e===L.CentralFileHeader)return!1;throw e===3759263696?Error(`Encrypted ZIP`):Error(`Unexpected signature`)}};function $e(e,t){let n=e.length,r=t.length;if(r>n)return-1;for(let i=0;i<=n-r;i++){let n=!0;for(let a=0;a<r;a++)if(e[i+a]!==t[a]){n=!1;break}if(n)return i}return-1}function et(e){let t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}var tt=class{constructor(e){this.tokenizer=e}inflate(){let e=this.tokenizer;return new ReadableStream({async pull(t){let n=new Uint8Array(1024),r=await e.readBuffer(n,{mayBeLess:!0});if(r===0){t.close();return}t.enqueue(n.subarray(0,r))}}).pipeThrough(new DecompressionStream(`gzip`))}};new globalThis.TextDecoder(`utf8`),new globalThis.TextEncoder,Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function nt(e){let{byteLength:t}=e;if(t===6)return e.getUint16(0)*2**32+e.getUint32(2);if(t===5)return e.getUint8(0)*2**32+e.getUint32(1);if(t===4)return e.getUint32(0);if(t===3)return e.getUint8(0)*2**16+e.getUint16(1);if(t===2)return e.getUint16(0);if(t===1)return e.getUint8(0)}function rt(e,t){if(t===`utf-16le`){let t=[];for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t.push(r&255,r>>8&255)}return t}if(t===`utf-16be`){let t=[];for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t.push(r>>8&255,r&255)}return t}return[...e].map(e=>e.charCodeAt(0))}function it(e,t=0){let n=Number.parseInt(new F(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}let at={get:(e,t)=>e[t+3]&127|e[t+2]<<7|e[t+1]<<14|e[t]<<21,len:4},B=4100;var ot=B-2,V=1024*1024,st=1024,ct=2**31-1,H=16*1024*1024,U=V,lt=V,ut=H,dt=1,ft=100,pt=H,mt=64,ht=U,gt=256,_t=512,vt=H,yt=512,bt=512,xt=256,St=U,Ct=U,wt=U,Tt=H,Et=new Set([`Unexpected signature`,`Encrypted ZIP`,`Expected Central-File-Header signature`]),Dt=[`ZIP entry count exceeds `,`Unsupported ZIP compression method:`,`ZIP entry compressed data exceeds `,`ZIP entry decompressed data exceeds `,`Expected data-descriptor-signature at position `],Ot=new Set([`Z_BUF_ERROR`,`Z_DATA_ERROR`,`ERR_INVALID_STATE`]),W=class extends Error{};function kt(e){let t=e?.streamReader;if(t?.constructor?.name!==`WebStreamByobReader`)return e;let{reader:n}=t,r=async()=>{await n.cancel(),n.releaseLock()};return t.close=r,t.abort=async()=>{t.interrupted=!0,await r()},e}function At(e,t,n){if(!Number.isFinite(e)||e<0||e>t)throw new W(`${n} has invalid size ${e} (maximum ${t} bytes)`);return e}async function G(e,t,{maximumLength:n=H,reason:r=`skip`}={}){let i=At(t,n,r);await e.ignore(i)}async function jt(e,t,n,{maximumLength:r=t.length,reason:i=`read`}={}){let a=n?.length??t.length,o=At(a,r,i);return e.readBuffer(t,{...n,length:o})}async function Mt(e,{maximumLength:t=V}={}){let n=new ReadableStream({start(t){t.enqueue(e),t.close()}}).pipeThrough(new DecompressionStream(`deflate-raw`)).getReader(),r=[],i=0;try{for(;;){let{done:e,value:a}=await n.read();if(e)break;if(i+=a.length,i>t)throw await n.cancel(),Error(`ZIP entry decompressed data exceeds ${t} bytes`);r.push(a)}}finally{n.releaseLock()}let a=new Uint8Array(i),o=0;for(let e of r)a.set(e,o),o+=e.length;return a}var Nt=134695760,K=16,Pt=K-1;function Ft(e,t){if(e.length<K)return-1;let n=e.length-K;for(let r=0;r<=n;r++)if(P.get(e,r)===Nt&&P.get(e,r+8)===t+r)return r;return-1}function It(e){return(e.codePointAt(0)&32)!=0}function Lt(e,t){let n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}async function Rt(e,{shouldBuffer:t,maximumLength:n=V}={}){let{syncBuffer:r}=e,{length:i}=r,a=[],o=0;for(;;){let s=await e.tokenizer.peekBuffer(r,{mayBeLess:!0}),c=Ft(r.subarray(0,s),o),l=c>=0?0:s===i?Math.min(Pt,s-1):0,u=c>=0?c:s-l;if(u===0)break;if(o+=u,o>n)throw Error(`ZIP entry compressed data exceeds ${n} bytes`);if(t){let t=new Uint8Array(u);await e.tokenizer.readBuffer(t),a.push(t)}else await e.tokenizer.ignore(u);if(c>=0)break}if(J(e.tokenizer)||(e.knownSizeDescriptorScannedBytes+=o),t)return Lt(a,o)}function zt(e,t){return J(e.tokenizer)?Math.max(0,H-(e.tokenizer.position-t)):Math.max(0,V-e.knownSizeDescriptorScannedBytes)}async function Bt(e,t,{shouldBuffer:n,maximumDescriptorLength:r=V}={}){if(t.dataDescriptor&&t.compressedSize===0)return Rt(e,{shouldBuffer:n,maximumLength:r});if(!n){await G(e.tokenizer,t.compressedSize,{maximumLength:J(e.tokenizer)?V:e.tokenizer.fileInfo.size,reason:`ZIP entry compressed data`});return}let i=Jt(e.tokenizer);if(!Number.isFinite(t.compressedSize)||t.compressedSize<0||t.compressedSize>i)throw Error(`ZIP entry compressed data exceeds ${i} bytes`);let a=new Uint8Array(t.compressedSize);return await e.tokenizer.readBuffer(a),a}Qe.prototype.inflate=async function(e,t,n){if(e.compressedMethod===0)return n(t);if(e.compressedMethod!==8)throw Error(`Unsupported ZIP compression method: ${e.compressedMethod}`);let r=await Mt(t,{maximumLength:V});return n(r)},Qe.prototype.unzip=async function(e){let t=!1,n=0,r=this.tokenizer.position;this.knownSizeDescriptorScannedBytes=0;do{if(Y(this.tokenizer,r,H))throw new W(`ZIP stream probing exceeds ${H} bytes`);let i=await this.readLocalFileHeader();if(!i)break;if(n++,n>st)throw Error(`ZIP entry count exceeds ${st}`);let a=e(i);t=!!a.stop,await this.tokenizer.ignore(i.extraFieldLength);let o=await Bt(this,i,{shouldBuffer:!!a.handler,maximumDescriptorLength:Math.min(V,zt(this,r))});if(a.handler&&await this.inflate(i,o,a.handler),i.dataDescriptor){let e=new Uint8Array(K);if(await this.tokenizer.readBuffer(e),P.get(e,0)!==Nt)throw Error(`Expected data-descriptor-signature at position ${this.tokenizer.position-e.length}`)}if(Y(this.tokenizer,r,H))throw new W(`ZIP stream probing exceeds ${H} bytes`)}while(!t)};
1function Vt(e,t){let n=e.getReader(),r=0,i=!1,a=!1,o=async e=>{i||a||(a=!0,await n.cancel(e))};return new ReadableStream({async pull(e){if(r>=t){e.close(),await o();return}let{done:a,value:s}=await n.read();if(a||!s){i=!0,e.close();return}let c=t-r;if(s.length>c){e.enqueue(s.subarray(0,c)),r+=c,e.close(),await o();return}e.enqueue(s),r+=s.length},async cancel(e){await o(e)}})}async function Ht(e,t){return new tn(t).fromStream(e)}function Ut(e){switch(e=e.toLowerCase(),e){case`application/epub+zip`:return{ext:`epub`,mime:e};case`application/vnd.oasis.opendocument.text`:return{ext:`odt`,mime:e};case`application/vnd.oasis.opendocument.text-template`:return{ext:`ott`,mime:e};case`application/vnd.oasis.opendocument.spreadsheet`:return{ext:`ods`,mime:e};case`application/vnd.oasis.opendocument.spreadsheet-template`:return{ext:`ots`,mime:e};case`application/vnd.oasis.opendocument.presentation`:return{ext:`odp`,mime:e};case`application/vnd.oasis.opendocument.presentation-template`:return{ext:`otp`,mime:e};case`application/vnd.oasis.opendocument.graphics`:return{ext:`odg`,mime:e};case`application/vnd.oasis.opendocument.graphics-template`:return{ext:`otg`,mime:e};case`application/vnd.openxmlformats-officedocument.presentationml.slideshow`:return{ext:`ppsx`,mime:e};case`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`:return{ext:`xlsx`,mime:e};case`application/vnd.ms-excel.sheet.macroenabled`:return{ext:`xlsm`,mime:`application/vnd.ms-excel.sheet.macroenabled.12`};case`application/vnd.openxmlformats-officedocument.spreadsheetml.template`:return{ext:`xltx`,mime:e};case`application/vnd.ms-excel.template.macroenabled`:return{ext:`xltm`,mime:`application/vnd.ms-excel.template.macroenabled.12`};case`application/vnd.ms-powerpoint.slideshow.macroenabled`:return{ext:`ppsm`,mime:`application/vnd.ms-powerpoint.slideshow.macroenabled.12`};case`application/vnd.openxmlformats-officedocument.wordprocessingml.document`:return{ext:`docx`,mime:e};case`application/vnd.ms-word.document.macroenabled`:return{ext:`docm`,mime:`application/vnd.ms-word.document.macroenabled.12`};case`application/vnd.openxmlformats-officedocument.wordprocessingml.template`:return{ext:`dotx`,mime:e};case`application/vnd.ms-word.template.macroenabledtemplate`:return{ext:`dotm`,mime:`application/vnd.ms-word.template.macroenabled.12`};case`application/vnd.openxmlformats-officedocument.presentationml.template`:return{ext:`potx`,mime:e};case`application/vnd.ms-powerpoint.template.macroenabled`:return{ext:`potm`,mime:`application/vnd.ms-powerpoint.template.macroenabled.12`};case`application/vnd.openxmlformats-officedocument.presentationml.presentation`:return{ext:`pptx`,mime:e};case`application/vnd.ms-powerpoint.presentation.macroenabled`:return{ext:`pptm`,mime:`application/vnd.ms-powerpoint.presentation.macroenabled.12`};case`application/vnd.ms-visio.drawing`:return{ext:`vsdx`,mime:`application/vnd.visio`};case`application/vnd.ms-package.3dmanufacturing-3dmodel+xml`:return{ext:`3mf`,mime:`model/3mf`};default:}}function q(e,t,n){n={offset:0,...n};for(let[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}function Wt(e){return Number.isFinite(e)?Math.max(1,Math.trunc(e)):B}function Gt(e,t,n){return n===void 0?e.read(t):(n.throwIfAborted(),new Promise((r,i)=>{let a=()=>{n.removeEventListener(`abort`,o)},o=()=>{let t=n.reason;a(),(async()=>{try{await e.cancel(t)}catch{}})(),i(t)};n.addEventListener(`abort`,o,{once:!0}),(async()=>{try{let n=await e.read(t);a(),r(n)}catch(e){a(),i(e)}})()}))}function Kt(e){return Number.isFinite(e)?Math.max(0,Math.min(ot,Math.trunc(e))):0}function qt(e){return Number.isFinite(e)?Math.max(0,e):2**53-1}function J(e){let t=e.fileInfo.size;return!Number.isFinite(t)||t===2**53-1}function Y(e,t,n){return J(e)&&e.position-t>n}function Jt(e){let t=e.fileInfo.size,n=Number.isFinite(t)?Math.max(0,t-e.position):2**53-1;return Math.min(n,ct)}function Yt(e){if(e instanceof I||e instanceof W)return!0;if(!(e instanceof Error))return!1;if(Et.has(e.message)||Ot.has(e.code))return!0;for(let t of Dt)if(e.message.startsWith(t))return!0;return!1}
1function Xt(e,t=V){let n=[e.compressedSize,e.uncompressedSize];for(let e of n)if(!Number.isFinite(e)||e<0||e>t)return!1;return!0}function Zt(){return{hasContentTypesEntry:!1,hasParsedContentTypesEntry:!1,isParsingContentTypes:!1,hasUnparseableContentTypes:!1,hasWordDirectory:!1,hasPresentationDirectory:!1,hasSpreadsheetDirectory:!1,hasThreeDimensionalModelEntry:!1}}function Qt(e,t){t.startsWith(`word/`)&&(e.hasWordDirectory=!0),t.startsWith(`ppt/`)&&(e.hasPresentationDirectory=!0),t.startsWith(`xl/`)&&(e.hasSpreadsheetDirectory=!0),t.startsWith(`3D/`)&&t.endsWith(`.model`)&&(e.hasThreeDimensionalModelEntry=!0)}function $t(e){if(!(!e.hasContentTypesEntry||e.hasUnparseableContentTypes||e.isParsingContentTypes||e.hasParsedContentTypesEntry)){if(e.hasWordDirectory)return{ext:`docx`,mime:`application/vnd.openxmlformats-officedocument.wordprocessingml.document`};if(e.hasPresentationDirectory)return{ext:`pptx`,mime:`application/vnd.openxmlformats-officedocument.presentationml.presentation`};if(e.hasSpreadsheetDirectory)return{ext:`xlsx`,mime:`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`};if(e.hasThreeDimensionalModelEntry)return{ext:`3mf`,mime:`model/3mf`}}}function en(e){let t=e.indexOf(`.main+xml"`);if(t===-1){let t=`application/vnd.ms-package.3dmanufacturing-3dmodel+xml`;return e.includes(`ContentType="${t}"`)?t:void 0}let n=e.slice(0,t),r=n.lastIndexOf(`"`);return n.slice(r+1)}var tn=class e{constructor(e){let t=Kt(e?.mpegOffsetTolerance);this.options={...e,mpegOffsetTolerance:t},this.detectors=[...this.options.customDetectors??[],{id:`core`,detect:this.detectConfident},{id:`core.imprecise`,detect:this.detectImprecise}],this.tokenizerOptions={abortSignal:this.options.signal},this.gzipProbeDepth=0}getTokenizerOptions(){return{...this.tokenizerOptions}}createTokenizerFromWebStream(e){return kt(ze(e,this.getTokenizerOptions()))}async parseTokenizer(e,t=0){this.detectionReentryCount=t;let n=e.position;for(let t of this.detectors){let r;try{r=await t.detect(e)}catch(e){if(e instanceof I||e instanceof W)return;throw e}if(r)return r;if(n!==e.position)return}}async fromTokenizer(e){try{return await this.parseTokenizer(e)}finally{await e.close()}}async fromBuffer(e){if(!(e instanceof Uint8Array||e instanceof ArrayBuffer))throw TypeError(`Expected the \`input\` argument to be of type \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof e}\``);let t=e instanceof Uint8Array?e:new Uint8Array(e);if(t?.length>1)return this.fromTokenizer(Be(t,this.getTokenizerOptions()))}async fromBlob(e){this.options.signal?.throwIfAborted();let t=Ve(e,this.getTokenizerOptions());return this.fromTokenizer(t)}async fromStream(e){this.options.signal?.throwIfAborted();let t=this.createTokenizerFromWebStream(e);return this.fromTokenizer(t)}async toDetectionStream(e,t){let n=Wt(t?.sampleSize??4100),r,i,a=e.getReader({mode:`byob`});try{let{value:e,done:t}=await Gt(a,new Uint8Array(n),this.options.signal);
1if(i=e,!t&&e)try{r=await this.fromBuffer(e.subarray(0,n))}catch(e){if(!(e instanceof I))throw e;r=void 0}i=e}finally{a.releaseLock()}let o=new TransformStream({async start(e){e.enqueue(i)},transform(e,t){t.enqueue(e)}}),s=e.pipeThrough(o);return s.fileType=r,s}async detectGzip(t){if(this.gzipProbeDepth>=dt)return{ext:`gz`,mime:`application/gzip`};let n=new tt(t),r=Vt(n.inflate(),ut),i=J(t),a,o,s,c;if(i){let t=new AbortController;a=setTimeout(()=>{t.abort(new DOMException(`Operation timed out after ${ft} ms`,`TimeoutError`))},ft),o=this.options.signal===void 0?t.signal:AbortSignal.any([this.options.signal,t.signal]),s=new e({...this.options,signal:o}),s.gzipProbeDepth=this.gzipProbeDepth+1}else this.gzipProbeDepth++;try{c=await(s??this).fromStream(r)}catch(e){if(e?.name===`AbortError`&&o?.reason?.name!==`TimeoutError`)throw e}finally{clearTimeout(a),i||this.gzipProbeDepth--}return c?.ext===`tar`?{ext:`tar.gz`,mime:`application/gzip`}:{ext:`gz`,mime:`application/gzip`}}check(e,t){return q(this.buffer,e,t)}checkString(e,t){return this.check(rt(e,t?.encoding),t)}detectConfident=async e=>{if(this.buffer=new Uint8Array(B),e.fileInfo.size===void 0&&(e.fileInfo.size=2**53-1),this.tokenizer=e,J(e)&&(await e.peekBuffer(this.buffer,{length:3,mayBeLess:!0}),this.check([31,139,8])))return this.detectGzip(e);if(await e.peekBuffer(this.buffer,{length:32,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.detectionReentryCount>=xt?void 0:(this.detectionReentryCount++,await this.tokenizer.ignore(3),this.detectConfident(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 this.detectGzip(e);if(this.check([66,90,104]))return{ext:`bz2`,mime:`application/x-bzip2`};if(this.checkString(`ID3`)){await G(e,6,{maximumLength:6,reason:`ID3 header prefix`});let t=await e.readToken(at),n=J(e);if(!Number.isFinite(t)||t<0||n&&(t>pt||e.position+t>pt))return;if(e.position+t>e.fileInfo.size)return n?void 0:{ext:`mp3`,mime:`audio/mpeg`};try{await G(e,t,{maximumLength:n?pt:e.fileInfo.size,reason:`ID3 payload`})}catch(e){if(e instanceof I)return;throw e}return this.detectionReentryCount>=xt?void 0:(this.detectionReentryCount++,this.parseTokenizer(e,this.detectionReentryCount))}if(this.checkString(`MP+`))return{ext:`mpc`,mime:`audio/x-musepack`};if((this.buffer[0]===67||this.buffer[0]===70)&&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(`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])){let t,n=Zt();try{await new Qe(e).unzip(e=>{Qt(n,e.filename);let r=e.filename===`[Content_Types].xml`,i=$t(n);if(!r&&i)return t=i,{stop:!0};switch(e.filename){case`META-INF/mozilla.rsa`:return t={ext:`xpi`,mime:`application/x-xpinstall`},{stop:!0};case`META-INF/MANIFEST.MF`:return t={ext:`jar`,mime:`application/java-archive`},{stop:!0};case`mimetype`:return Xt(e,lt)?{async handler(e){let n=new TextDecoder(`utf-8`).decode(e).trim();t=Ut(n)},stop:!0}:{};
1case`[Content_Types].xml`:return n.hasContentTypesEntry=!0,Xt(e,lt)?(n.isParsingContentTypes=!0,{async handler(e){let r=new TextDecoder(`utf-8`).decode(e),i=en(r);i&&(t=Ut(i)),n.hasParsedContentTypesEntry=!0,n.isParsingContentTypes=!1},stop:!0}):(n.hasUnparseableContentTypes=!0,{});default:return/classes\d*\.dex/.test(e.filename)?(t={ext:`apk`,mime:`application/vnd.android.package-archive`},{stop:!0}):{}}})}catch(e){if(!Yt(e))throw e;n.isParsingContentTypes&&(n.isParsingContentTypes=!1,n.hasUnparseableContentTypes=!0)}return t??$t(n)??{ext:`zip`,mime:`application/zip`}}if(this.checkString(`OggS`)){await e.ignore(28);let t=new Uint8Array(8);return await e.readBuffer(t),q(t,[79,112,117,115,72,101,97,100])?{ext:`opus`,mime:`audio/ogg; codecs=opus`}:q(t,[128,116,104,101,111,114,97])?{ext:`ogv`,mime:`video/ogg`}:q(t,[1,118,105,100,101,111,0])?{ext:`ogm`,mime:`video/ogg`}:q(t,[127,70,76,65,67])?{ext:`oga`,mime:`audio/ogg`}:q(t,[83,112,101,101,120,32,32])?{ext:`spx`,mime:`audio/ogg`}:q(t,[1,118,111,114,98,105,115])?{ext:`ogg`,mime:`audio/ogg`}:{ext:`ogx`,mime:`application/ogg`}}if(this.check([80,75])&&(this.buffer[2]===3||this.buffer[2]===5||this.buffer[2]===7)&&(this.buffer[3]===4||this.buffer[3]===6||this.buffer[3]===8))return{ext:`zip`,mime:`application/zip`};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/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`))return{ext:`pdf`,mime:`application/pdf`};if(this.check([0,97,115,109]))return{ext:`wasm`,mime:`application/wasm`};if(this.check([73,73])){let e=await this.readTiffHeader(!1);if(e)return e}if(this.check([77,77])){let e=await this.readTiffHeader(!0);if(e)return e}if(this.checkString(`MAC `))return{ext:`ape`,mime:`audio/ape`};if(this.check([26,69,223,163])){async function t(){let t=await e.peekNumber(we),n=128,r=0;for(;(t&n)===0&&n!==0;)++r,n>>=1;let i=new Uint8Array(r+1);return await jt(e,i,void 0,{maximumLength:i.length,reason:`EBML field`}),i}async function n(){let e=await t(),n=await t();n[0]^=128>>n.length-1;let r=Math.min(6,n.length),i=new DataView(e.buffer),a=new DataView(n.buffer,n.length-r,r);return{id:nt(i),len:nt(a)}}async function r(t){let r=0;for(;t>0;){if(r++,r>gt||Y(e,a,H))return;let i=e.position,o=await n();if(o.id===17026){if(o.len>mt)return;let t=At(o.len,mt,`EBML DocType`);return(await e.readToken(new F(t))).replaceAll(/\00.*$/g,``)}if(J(e)&&(!Number.isFinite(o.len)||o.len<0||o.len>ht)||(await G(e,o.len,{maximumLength:J(e)?ht:e.fileInfo.size,reason:`EBML payload`}),--t,e.position<=i))return}}let i=await n(),a=e.position;switch(await r(i.len)){case`webm`:return{ext:`webm`,mime:`video/webm`};case`matroska`:return{ext:`mkv`,mime:`video/matroska`};default:return}}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`)||this.checkString(`PARE`))return{ext:`parquet`,mime:`application/vnd.apache.parquet`};if(this.checkString(`ttcf`))return{ext:`ttc`,mime:`font/collection`};if(this.check([254,237,250,206])||this.check([254,237,250,207])||this.check([206,250,237,254])||this.check([207,250,237,254]))return{ext:`macho`,mime:`application/x-mach-binary`};if(this.check([4,34,77,24]))return{ext:`lz4`,mime:`application/x-lz4`};if(this.checkString(`regf`))return{ext:`dat`,mime:`application/x-ft-windows-registry-hive`};if(this.checkString(`$FL2`)||this.checkString(`$FL3`))return{ext:`sav`,mime:`application/x-spss-sav`};
1if(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])){let e=Te.get(this.buffer,4),t=N.get(this.buffer,6);if(e>0&&e<=30)return{ext:`macho`,mime:`application/x-mach-binary`};if(t>30)return{ext:`class`,mime:`application/java-vm`}}if(this.checkString(`.RMF`))return{ext:`rm`,mime:`application/vnd.rn-realmedia`};if(this.checkString(`DRACO`))return{ext:`drc`,mime:`application/vnd.google.draco`};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])&&(this.buffer[6]===0||this.buffer[6]===1))return{ext:`rar`,mime:`application/x-rar-compressed`};if(this.checkString(`solid `))return{ext:`stl`,mime:`model/stl`};if(this.checkString(`AC`)){let e=new F(4,`latin1`).get(this.buffer,2);if(e.match(`^d*`)&&e>=1e3&&e<=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>`))return await e.ignore(8),await e.readToken(new F(13,`ascii`))===`debian-binary`?{ext:`deb`,mime:`application/x-deb`}:{ext:`ar`,mime:`application/x-unix-archive`};if(this.checkString(`WEBVTT`)&&[` 2`,`\r`,` `,` `,`\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])){let t={ext:`png`,mime:`image/png`},n={ext:`apng`,mime:`image/apng`};await e.ignore(8);async function r(){return{length:await e.readToken(Ee),type:await e.readToken(new F(4,`latin1`))}}let i=J(e),a=e.position,o=0,s=!1;do{if(o++,o>_t||Y(e,a,vt))break;let c=e.position,l=await r();if(l.length<0)return;if(l.type===`IHDR`){if(l.length!==13)return;s=!0}switch(l.type){case`IDAT`:return t;case`acTL`:return n;default:if(!s&&l.type!==`CgBI`)return;if(i&&l.length>St)return s&&It(l.type)?t:void 0;try{await G(e,l.length+4,{maximumLength:i?St+4:e.fileInfo.size,reason:`PNG chunk payload`})}catch(e){if(!i&&(e instanceof W||e instanceof I))return t;throw e}}if(e.position<=c)break}while(e.position+8<e.fileInfo.size);return t}if(this.check([65,82,82,79,87,49,0,0]))return{ext:`arrow`,mime:`application/vnd.apache.arrow.file`};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.checkString(`ftyp`,{offset:4})&&this.buffer[8]&96){let e=new F(4,`latin1`).get(this.buffer,8).replace(`\0`,` `).trim();switch(e){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 e.startsWith(`3g`)?e.startsWith(`3g2`)?{ext:`3g2`,mime:`video/3gpp2`}:{ext:`3gp`,mime:`video/3gpp`}:{ext:`mp4`,mime:`video/mp4`}}}if(this.checkString(`REGEDIT4\r 3`))return{ext:`reg`,mime:`application/x-ms-regedit`};
3if(this.check([82,73,70,70])){if(this.checkString(`WEBP`,{offset:8}))return{ext:`webp`,mime:`image/webp`};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.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])){let t=!1;try{async function n(){let t=new Uint8Array(16);return await jt(e,t,void 0,{maximumLength:t.length,reason:`ASF header GUID`}),{id:t,size:Number(await e.readToken(De))}}await G(e,30,{maximumLength:30,reason:`ASF header prelude`});let r=J(e),i=e.position,a=0;for(;e.position+24<e.fileInfo.size&&(a++,!(a>yt||Y(e,i,H)));){let i=e.position,a=await n(),o=a.size-24;if(!Number.isFinite(o)||o<0){t=!0;break}if(q(a.id,[145,7,220,183,183,169,207,17,142,230,0,192,12,32,83,101])){let t=new Uint8Array(16);if(o-=await jt(e,t,void 0,{maximumLength:t.length,reason:`ASF stream type GUID`}),q(t,[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(q(t,[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}if(r&&o>Ct){t=!0;break}if(await G(e,o,{maximumLength:r?Ct:e.fileInfo.size,reason:`ASF header payload`}),e.position<=i){t=!0;break}}}catch(n){if(n instanceof I||n instanceof W)J(e)&&(t=!0);else throw n}return t?void 0:{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]))switch(await e.ignore(20),await e.readToken(new F(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.checkString(`<?xml `,{offset:2,encoding:`utf-16be`})?{ext:`xml`,mime:`application/xml`}:void 0;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){let e=new DataView(this.buffer.buffer).getUint32(12,!0);if(e>12&&this.buffer.length>=e+16)try{let t=new TextDecoder().decode(this.buffer.subarray(16,e+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})||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(this.check([255,255,0,0,7,0,0,0,4,0,0,0,1,0,1,0])||this.check([0,0,255,255,0,0,0,7,0,0,0,4,0,1,0,1]))return{ext:`jmp`,mime:`application/x-jmp-data`};if(await e.peekBuffer(this.buffer,{length:Math.min(512,e.fileInfo.size),mayBeLess:!0}),this.checkString(`ustar`,{offset:257})&&(this.checkString(`\0`,{offset:262})||this.checkString(` `,{offset:262}))||this.check([0,0,0,0,0,0],{offset:257})&&it(this.buffer))return{ext:`tar`,mime:`application/x-tar`};if(this.check([255,254])){let e=`utf-16le`;return this.checkString(`<?xml `,{offset:2,encoding:e})?{ext:`xml`,mime:`application/xml`}:this.check([255,14],{offset:2})&&this.checkString(`SketchUp Model`,{offset:4,encoding:e})?{ext:`skp`,mime:`application/vnd.sketchup.skp`}:this.checkString(`Windows Registry Editor Version 5.00\r 4`,{offset:2,encoding:e})?{ext:`reg`,mime:`application/x-ms-regedit`}:void 0}if(this.checkString(`-----BEGIN PGP MESSAGE-----`))return{ext:`pgp`,mime:`application/pgp-encrypted`}};detectImprecise=async e=>{this.buffer=new Uint8Array(B);let t=qt(e.fileInfo.size);if(await e.peekBuffer(this.buffer,{length:Math.min(8,t),mayBeLess:!0}),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`};
4if(this.check([0,0,2,0]))return{ext:`cur`,mime:`image/x-icon`};if(await e.peekBuffer(this.buffer,{length:Math.min(2+this.options.mpegOffsetTolerance,t),mayBeLess:!0}),this.buffer.length>=2+this.options.mpegOffsetTolerance)for(let e=0;e<=this.options.mpegOffsetTolerance;++e){let t=this.scanMpeg(e);if(t)return t}};async readTiffTag(e){let t=await this.tokenizer.readToken(e?N:M);switch(await 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`};default:}}async readTiffIFD(e){let t=await this.tokenizer.readToken(e?N:M);if(!(t>bt)&&!(J(this.tokenizer)&&2+t*12>Tt))for(let n=0;n<t;++n){let t=await this.readTiffTag(e);if(t)return t}}async readTiffHeader(e){let t={ext:`tif`,mime:`image/tiff`},n=(e?N:M).get(this.buffer,2),r=(e?Te:P).get(this.buffer,4);if(n===42){if(r>=6){if(this.checkString(`CR`,{offset:8}))return{ext:`cr2`,mime:`image/x-canon-cr2`};if(r>=8){let t=(e?N:M).get(this.buffer,8),n=(e?N:M).get(this.buffer,10);if(t===28&&n===254||t===31&&n===11)return{ext:`nef`,mime:`image/x-nikon-nef`}}}if(J(this.tokenizer)&&r>wt)return t;let n=J(this.tokenizer)?Tt:this.tokenizer.fileInfo.size;try{await G(this.tokenizer,r,{maximumLength:n,reason:`TIFF IFD offset`})}catch(e){if(e instanceof I)return;throw e}let i;try{i=await this.readTiffIFD(e)}catch(e){if(e instanceof I)return;throw e}return i??t}if(n===43)return t}scanMpeg(e){if(this.check([255,224],{offset:e,mask:[255,224]})){if(this.check([16],{offset:e+1,mask:[22]}))return this.check([8],{offset:e+1,mask:[8]}),{ext:`aac`,mime:`audio/aac`};if(this.check([2],{offset:e+1,mask:[6]}))return{ext:`mp3`,mime:`audio/mpeg`};if(this.check([4],{offset:e+1,mask:[6]}))return{ext:`mp2`,mime:`audio/mpeg`};if(this.check([6],{offset:e+1,mask:[6]}))return{ext:`mp1`,mime:`audio/mpeg`}}}},nn=s(((exports,t)=>{t.exports={}})),rn=l(s((exports=>{(function(e){e.parser=function(e,t){return new n(e,t)},e.SAXParser=n,e.SAXStream=u,e.createStream=c,e.MAX_BUFFER_LENGTH=64*1024;var t=[`comment`,`sgmlDecl`,`textNode`,`tagName`,`doctype`,`procInstName`,`procInstBody`,`entity`,`attribName`,`attribValue`,`cdata`,`script`];e.EVENTS=[`text`,`processinginstruction`,`sgmldeclaration`,`doctype`,`comment`,`opentagstart`,`attribute`,`opentag`,`closetag`,`opencdata`,`cdata`,`closecdata`,`error`,`end`,`ready`,`script`,`opennamespace`,`closenamespace`];function n(t,r){if(!(this instanceof n))return new n(t,r);var a=this;i(a),a.q=a.c=``,a.bufferCheckPosition=e.MAX_BUFFER_LENGTH,a.encoding=null,a.opt=r||{},a.opt.lowercase=a.opt.lowercase||a.opt.lowercasetags,a.looseCase=a.opt.lowercase?`toLowerCase`:`toUpperCase`,a.opt.maxEntityCount=a.opt.maxEntityCount||512,a.opt.maxEntityDepth=a.opt.maxEntityDepth||4,a.entityCount=a.entityDepth=0,a.tags=[],a.closed=a.closedRoot=a.sawRoot=!1,a.tag=a.error=null,a.strict=!!t,a.noscript=!!(t||a.opt.noscript),a.state=y.BEGIN,a.strictEntities=a.opt.strictEntities,a.ENTITIES=a.strictEntities?Object.create(e.XML_ENTITIES):Object.create(e.ENTITIES),a.attribList=[],a.opt.xmlns&&(a.ns=Object.create(te)),a.opt.unquotedAttributeValues===void 0&&(a.opt.unquotedAttributeValues=!t),a.trackPosition=a.opt.position!==!1,a.trackPosition&&(a.position=a.line=a.column=0),b(a,`onready`)}Object.create||(Object.create=function(e){function t(){}return t.prototype=e,new t}),Object.keys||(Object.keys=function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t});function r(n){for(var r=Math.max(e.MAX_BUFFER_LENGTH,10),i=0,a=0,o=t.length;a<o;a++){var s=n[t[a]].length;if(s>r)switch(t[a]){case`textNode`:C(n);break;case`cdata`:S(n,`oncdata`,n.cdata),n.cdata=``;break;case`script`:S(n,`onscript`,n.script),n.script=``;break;default:w(n,`Max buffer length exceeded: `+t[a])}i=Math.max(i,s)}n.bufferCheckPosition=e.MAX_BUFFER_LENGTH-i+n.position}function i(e){for(var n=0,r=t.length;n<r;n++)e[t[n]]=``}function a(e){C(e),e.cdata!==``&&(S(e,`oncdata`,e.cdata),e.cdata=``),e.script!==``&&(S(e,`onscript`,e.script),e.script=``)}n.prototype={end:function(){de(this)},write:he,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){a(this)}};var o;try{o=nn().Stream}catch{o=function(){}}o||=function(){};var s=e.EVENTS.filter(function(e){return e!==`error`&&e!==`end`});function c(e,t){return new u(e,t)}function l(e,t){if(e.length>=2){if(e[0]===255&&e[1]===254)return`utf-16le`;if(e[0]===254&&e[1]===255)return`utf-16be`}return e.length>=3&&e[0]===239&&e[1]===187&&e[2]===191?`utf8`:e.length>=4?e[0]===60&&e[1]===0&&e[2]===63&&e[3]===0?`utf-16le`:e[0]===0&&e[1]===60&&e[2]===0&&e[3]===63?`utf-16be`:`utf8`:t?`utf8`:null}function u(e,t){if(!(this instanceof u))return new u(e,t);o.apply(this),this._parser=new n(e,t),this.writable=!0,this.readable=!0;var r=this;this._parser.onend=function(){r.emit(`end`)},this._parser.onerror=function(e){r.emit(`error`,e),r._parser.error=null}
vendor: 18,449 bytes, lines 4-15
4,this._decoder=null,this._decoderBuffer=null,s.forEach(function(e){Object.defineProperty(r,`on`+e,{get:function(){return r._parser[`on`+e]},set:function(t){if(!t)return r.removeAllListeners(e),r._parser[`on`+e]=t,t;r.on(e,t)},enumerable:!0,configurable:!1})})}u.prototype=Object.create(o.prototype,{constructor:{value:u}}),u.prototype._decodeBuffer=function(e,t){if(this._decoderBuffer&&=(e=Buffer.concat([this._decoderBuffer,e]),null),!this._decoder){var n=l(e,t);if(!n)return this._decoderBuffer=e,``;this._parser.encoding=n,this._decoder=new TextDecoder(n)}return this._decoder.decode(e,{stream:!t})},u.prototype.write=function(e){if(typeof Buffer==`function`&&typeof Buffer.isBuffer==`function`&&Buffer.isBuffer(e))e=this._decodeBuffer(e,!1);else if(this._decoderBuffer){var t=this._decodeBuffer(Buffer.alloc(0),!0);t&&(this._parser.write(t),this.emit(`data`,t))}return this._parser.write(e.toString()),this.emit(`data`,e),!0},u.prototype.end=function(e){if(e&&e.length&&this.write(e),this._decoderBuffer){var t=this._decodeBuffer(Buffer.alloc(0),!0);t&&(this._parser.write(t),this.emit(`data`,t))}else if(this._decoder){var n=this._decoder.decode();n&&(this._parser.write(n),this.emit(`data`,n))}return this._parser.end(),!0},u.prototype.on=function(e,t){var n=this;return!n._parser[`on`+e]&&s.indexOf(e)!==-1&&(n._parser[`on`+e]=function(){var t=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);t.splice(0,0,e),n.emit.apply(n,t)}),o.prototype.on.call(n,e,t)};var d=`[CDATA[`,ee=`DOCTYPE`,f=`http://www.w3.org/XML/1998/namespace`,p=`http://www.w3.org/2000/xmlns/`,te={xml:f,xmlns:p},m=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,h=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,ne=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,re=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function g(e){return e===` `||e===` 5`||e===`\r`||e===` `}function _(e){return e===`"`||e===`'`}function ie(e){return e===`>`||g(e)}function v(e,t){return e.test(t)}function ae(e,t){return!v(e,t)}var y=0;for(var oe in e.STATE={BEGIN:y++,BEGIN_WHITESPACE:y++,TEXT:y++,TEXT_ENTITY:y++,OPEN_WAKA:y++,SGML_DECL:y++,SGML_DECL_QUOTED:y++,DOCTYPE:y++,DOCTYPE_QUOTED:y++,DOCTYPE_DTD:y++,DOCTYPE_DTD_QUOTED:y++,COMMENT_STARTING:y++,COMMENT:y++,COMMENT_ENDING:y++,COMMENT_ENDED:y++,CDATA:y++,CDATA_ENDING:y++,CDATA_ENDING_2:y++,PROC_INST:y++,PROC_INST_BODY:y++,PROC_INST_ENDING:y++,OPEN_TAG:y++,OPEN_TAG_SLASH:y++,ATTRIB:y++,ATTRIB_NAME:y++,ATTRIB_NAME_SAW_WHITE:y++,ATTRIB_VALUE:y++,ATTRIB_VALUE_QUOTED:y++,ATTRIB_VALUE_CLOSED:y++,ATTRIB_VALUE_UNQUOTED:y++,ATTRIB_VALUE_ENTITY_Q:y++,ATTRIB_VALUE_ENTITY_U:y++,CLOSE_TAG:y++,CLOSE_TAG_SAW_WHITE:y++,SCRIPT:y++,SCRIPT_ENDING:y++},e.XML_ENTITIES={amp:`&`,gt:`>`,lt:`<`,quot:`"`,apos:`'`},e.ENTITIES={amp:`&`,gt:`>`,lt:`<`,quot:`"`,apos:`'`,AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(e.ENTITIES).forEach(function(t){var n=e.ENTITIES[t],r=typeof n==`number`?String.fromCharCode(n):n;e.ENTITIES[t]=r}),e.STATE)e.STATE[e.STATE[oe]]=oe;y=e.STATE;function b(e,t,n){e[t]&&e[t](n)}function se(e){var t=e&&e.match(/(?:^|\s)encoding\s*=\s*(['"])([^'"]+)\1/i);return t?t[2]:null}function x(e){return e?e.toLowerCase().replace(/[^a-z0-9]/g,``):null}function ce(e,t){let n=x(e),r=x(t);return!n||!r?!0:r===`utf16`?n===`utf16le`||n===`utf16be`:n===r}function le(e,t){if(!(!e.strict||!e.encoding||!t||t.name!==`xml`)){var n=se(t.body);n&&!ce(e.encoding,n)&&T(e,`XML declaration encoding `+n+` does not match detected stream encoding `+e.encoding.toUpperCase())}}function S(e,t,n){e.textNode&&C(e),b(e,t,n)}function C(e){e.textNode=ue(e.opt,e.textNode),e.textNode&&b(e,`ontext`,e.textNode),e.textNode=``}function ue(e,t){return e.trim&&(t=t.trim()),e.normalize&&(t=t.replace(/\s+/g,` `)),t}function w(e,t){return C(e),e.trackPosition&&(t+=` 6Line: `+e.line+` 7Column: `+e.column+` 8Char: `+e.c),t=Error(t),e.error=t,b(e,`onerror`,t),e}function de(e){return e.sawRoot&&!e.closedRoot&&T(e,`Unclosed root tag`),e.state!==y.BEGIN&&e.state!==y.BEGIN_WHITESPACE&&e.state!==y.TEXT&&w(e,`Unexpected end`),C(e),e.c=``,e.closed=!0,b(e,`onend`),n.call(e,e.strict,e.opt),e}function T(e,t){if(typeof e!=`object`||!(e instanceof n))throw Error(`bad call to strictFail`);e.strict&&w(e,t)}function fe(e){e.strict||(e.tagName=e.tagName[e.looseCase]());var t=e.tags[e.tags.length-1]||e,n=e.tag={name:e.tagName,attributes:{}};e.opt.xmlns&&(n.ns=t.ns),e.attribList.length=0,S(e,`onopentagstart`,n)}function E(e,t){var n=e.indexOf(`:`)<0?[``,e]:e.split(`:`),r=n[0],i=n[1];return t&&e===`xmlns`&&(r=`xmlns`,i=``),{prefix:r,local:i}}function D(e){if(e.strict||(e.attribName=e.attribName[e.looseCase]()),e.attribList.indexOf(e.attribName)!==-1||e.tag.attributes.hasOwnProperty(e.attribName)){e.attribName=e.attribValue=``;return}if(e.opt.xmlns){var t=E(e.attribName,!0),n=t.prefix,r=t.local;if(n===`xmlns`)if(r===`xml`&&e.attribValue!==f)T(e,`xml: prefix must be bound to `+f+` 9Actual: `+e.attribValue);else if(r===`xmlns`&&e.attribValue!==p)T(e,`xmlns: prefix must be bound to `+p+` 10Actual: `+e.attribValue);else{var i=e.tag,a=e.tags[e.tags.length-1]||e;i.ns===a.ns&&(i.ns=Object.create(a.ns)),i.ns[r]=e.attribValue}e.attribList.push([e.attribName,e.attribValue])}else e.tag.attributes[e.attribName]=e.attribValue,S(e,`onattribute`,{name:e.attribName,value:e.attribValue});e.attribName=e.attribValue=``}function O(e,t){if(e.opt.xmlns){var n=e.tag,r=E(e.tagName);n.prefix=r.prefix,n.local=r.local,n.uri=n.ns[r.prefix]||``,n.prefix&&!n.uri&&(T(e,`Unbound namespace prefix: `+JSON.stringify(e.tagName)),n.uri=r.prefix);var i=e.tags[e.tags.length-1]||e;n.ns&&i.ns!==n.ns&&Object.keys(n.ns).forEach(function(t){S(e,`onopennamespace`,{prefix:t,uri:n.ns[t]})});for(var a=0,o=e.attribList.length;a<o;a++){var s=e.attribList[a],c=s[0],l=s[1],u=E(c,!0),d=u.prefix,ee=u.local,f=d===``?``:n.ns[d]||``,p={name:c,value:l,prefix:d,local:ee,uri:f};d&&d!==`xmlns`&&!f&&(T(e,`Unbound namespace prefix: `+JSON.stringify(d)),p.uri=d),e.tag.attributes[c]=p,S(e,`onattribute`,p)}e.attribList.length=0}e.tag.isSelfClosing=!!t,e.sawRoot=!0,e.tags.push(e.tag),S(e,`onopentag`,e.tag),t||(!e.noscript&&e.tagName.toLowerCase()===`script`?e.state=y.SCRIPT:e.state=y.TEXT,e.tag=null,e.tagName=``),e.attribName=e.attribValue=``,e.attribList.length=0}function k(e){if(!e.tagName){T(e,`Weird empty close tag.`),e.textNode+=`</>`,e.state=y.TEXT;return}if(e.script){if(e.tagName!==`script`){e.script+=`</`+e.tagName+`>`,e.tagName=``,e.state=y.SCRIPT;return}S(e,`onscript`,e.script),e.script=``}var t=e.tags.length,n=e.tagName;e.strict||(n=n[e.looseCase]());for(var r=n;t--&&e.tags[t].name!==r;)T(e,`Unexpected close tag`);if(t<0){T(e,`Unmatched closing tag: `+e.tagName),e.textNode+=`</`+e.tagName+`>`,e.state=y.TEXT;return}e.tagName=n;for(var i=e.tags.length;i-- >t;){var a=e.tag=e.tags.pop();e.tagName=e.tag.name,S(e,`onclosetag`,e.tagName);var o={};for(var s in a.ns)o[s]=a.ns[s];var c=e.tags[e.tags.length-1]||e;e.opt.xmlns&&a.ns!==c.ns&&Object.keys(a.ns).forEach(function(t){var n=a.ns[t];S(e,`onclosenamespace`,{prefix:t,uri:n})})}t===0&&(e.closedRoot=!0),e.tagName=e.attribValue=e.attribName=``,e.attribList.length=0,e.state=y.TEXT}function pe(e){var t=e.entity,n=t.toLowerCase(),r,i=``;return e.ENTITIES[t]?e.ENTITIES[t]:e.ENTITIES[n]?e.ENTITIES[n]:(t=n,t.charAt(0)===`#`&&(t.charAt(1)===`x`?(t=t.slice(2),r=parseInt(t,16),i=r.toString(16)):(t=t.slice(1),r=parseInt(t,10),i=r.toString(10))),t=t.replace(/^0+/,``),isNaN(r)||i.toLowerCase()!==t||r<0||r>1114111?(T(e,`Invalid character entity`),`&`+e.entity+`;`):String.fromCodePoint(r))}function me(e,t){t===`<`?(e.state=y.OPEN_WAKA,e.startTagPosition=e.position):g(t)||(T(e,`Non-whitespace before first tag.`),e.textNode=t,e.state=y.TEXT)}function A(e,t){var n=``;return t<e.length&&(n=e.charAt(t)),n}function he(t){var n=this;if(this.error)throw this.error;if(n.closed)return w(n,`Cannot write after close. Assign an onready handler.`);if(t===null)return de(n);typeof t==`object`&&(t=t.toString());for(var i=0,a=``;a=A(t,i++),n.c=a,a;)switch(n.trackPosition&&(n.position++,a===` 11`?(n.line++,n.column=0):n.column++),n.state){case y.BEGIN:if(n.state=y.BEGIN_WHITESPACE,a===``)continue;me(n,a);continue;case y.BEGIN_WHITESPACE:me(n,a);continue;case y.TEXT:if(n.sawRoot&&!n.closedRoot){for(var o=i-1;a&&a!==`<`&&a!==`&`;)a=A(t,i++),a&&n.trackPosition&&(n.position++,a===` 12`?(n.line++,n.column=0):n.column++);n.textNode+=t.substring(o,i-1)}a===`<`&&!(n.sawRoot&&n.closedRoot&&!n.strict)?(n.state=y.OPEN_WAKA,n.startTagPosition=n.position):(!g(a)&&(!n.sawRoot||n.closedRoot)&&T(n,`Text data outside of root node.`),a===`&`?n.state=y.TEXT_ENTITY:n.textNode+=a);continue;case y.SCRIPT:a===`<`?n.state=y.SCRIPT_ENDING:n.script+=a;continue;case y.SCRIPT_ENDING:a===`/`?n.state=y.CLOSE_TAG:(n.script+=`<`+a,n.state=y.SCRIPT);continue;case y.OPEN_WAKA:if(a===`!`)n.state=y.SGML_DECL,n.sgmlDecl=``;else if(!g(a))if(v(m,a))n.state=y.OPEN_TAG,n.tagName=a;else if(a===`/`)n.state=y.CLOSE_TAG,n.tagName=``;else if(a===`?`)n.state=y.PROC_INST,n.procInstName=n.procInstBody=``;else{if(T(n,`Unencoded <`),n.startTagPosition+1<n.position){var s=n.position-n.startTagPosition;a=Array(s).join(` `)+a}n.textNode+=`<`+a,n.state=y.TEXT}continue;case y.SGML_DECL:if(n.sgmlDecl+a===`--`){n.state=y.COMMENT,n.comment=``,n.sgmlDecl=``;continue}n.doctype&&n.doctype!==!0&&n.sgmlDecl?(n.state=y.DOCTYPE_DTD,n.doctype+=`<!`+n.sgmlDecl+a,n.sgmlDecl=``):(n.sgmlDecl+a).toUpperCase()===d?(S(n,`onopencdata`),n.state=y.CDATA,n.sgmlDecl=``,n.cdata=``):(n.sgmlDecl+a).toUpperCase()===ee?(n.state=y.DOCTYPE,(n.doctype||n.sawRoot)&&T(n,`Inappropriately located doctype declaration`),n.doctype=``,n.sgmlDecl=``):a===`>`?(S(n,`onsgmldeclaration`,n.sgmlDecl),n.sgmlDecl=``,n.state=y.TEXT):(_(a)&&(n.state=y.SGML_DECL_QUOTED),n.sgmlDecl+=a);continue;case y.SGML_DECL_QUOTED:a===n.q&&(n.state=y.SGML_DECL,n.q=``),n.sgmlDecl+=a;continue;case y.DOCTYPE:a===`>`?(n.state=y.TEXT,S(n,`ondoctype`,n.doctype),n.doctype=!0):(n.doctype+=a,a===`[`?n.state=y.DOCTYPE_DTD:_(a)&&(n.state=y.DOCTYPE_QUOTED,n.q=a));continue;case y.DOCTYPE_QUOTED:n.doctype+=a,a===n.q&&(n.q=``,n.state=y.DOCTYPE);continue;case y.DOCTYPE_DTD:a===`]`?(n.doctype+=a,n.state=y.DOCTYPE):a===`<`?(n.state=y.OPEN_WAKA,n.startTagPosition=n.position):_(a)?(n.doctype+=a,n.state=y.DOCTYPE_DTD_QUOTED,n.q=a):n.doctype+=a;continue;case y.DOCTYPE_DTD_QUOTED:n.doctype+=a,a===n.q&&(n.state=y.DOCTYPE_DTD,n.q=``);continue;case y.COMMENT:a===`-`?n.state=y.COMMENT_ENDING:n.comment+=a;continue;case y.COMMENT_ENDING:a===`-`?(n.state=y.COMMENT_ENDED,n.comment=ue(n.opt,n.comment),n.comment&&S(n,`oncomment`,n.comment),n.comment=``):(n.comment+=`-`+a,n.state=y.COMMENT);continue;case y.COMMENT_ENDED:a===`>`?n.doctype&&n.doctype!==!0?n.state=y.DOCTYPE_DTD:n.state=y.TEXT:(T(n,`Malformed comment`),n.comment+=`--`+a,n.state=y.COMMENT);continue;case y.CDATA:for(var o=i-1;a&&a!==`]`;)a=A(t,i++),a&&n.trackPosition&&(n.position++,a===` 13`?(n.line++,n.column=0):n.column++);n.cdata+=t.substring(o,i-1),a===`]`&&(n.state=y.CDATA_ENDING);continue;case y.CDATA_ENDING:a===`]`?n.state=y.CDATA_ENDING_2:(n.cdata+=`]`+a,n.state=y.CDATA);continue;case y.CDATA_ENDING_2:a===`>`?(n.cdata&&S(n,`oncdata`,n.cdata),S(n,`onclosecdata`),n.cdata=``,n.state=y.TEXT):a===`]`?n.cdata+=`]`:(n.cdata+=`]]`+a,n.state=y.CDATA);continue;case y.PROC_INST:a===`?`?n.state=y.PROC_INST_ENDING:g(a)?n.state=y.PROC_INST_BODY:n.procInstName+=a;continue;case y.PROC_INST_BODY:if(!n.procInstBody&&g(a))continue;a===`?`?n.state=y.PROC_INST_ENDING:n.procInstBody+=a;continue;case y.PROC_INST_ENDING:if(a===`>`){let e={name:n.procInstName,body:n.procInstBody};le(n,e),S(n,`onprocessinginstruction`,e),n.procInstName=n.procInstBody=``,n.state=y.TEXT}else n.procInstBody+=`?`+a,n.state=y.PROC_INST_BODY;continue;case y.OPEN_TAG:v(h,a)?n.tagName+=a:(fe(n),a===`>`?O(n):a===`/`?n.state=y.OPEN_TAG_SLASH:(g(a)||T(n,`Invalid character in tag name`),n.state=y.ATTRIB));continue;case y.OPEN_TAG_SLASH:a===`>`?(O(n,!0),k(n)):(T(n,`Forward-slash in opening tag not followed by >`),n.state=y.ATTRIB);continue;case y.ATTRIB:if(g(a))continue;a===`>`?O(n):a===`/`?n.state=y.OPEN_TAG_SLASH:v(m,a)?(n.attribName=a,n.attribValue=``,n.state=y.ATTRIB_NAME):T(n,`Invalid attribute name`);continue;case y.ATTRIB_NAME:a===`=`?n.state=y.ATTRIB_VALUE:a===`>`?(T(n,`Attribute without value`),n.attribValue=n.attribName,D(n),O(n)):g(a)?n.state=y.ATTRIB_NAME_SAW_WHITE:v(h,a)?n.attribName+=a:T(n,`Invalid attribute name`);continue;case y.ATTRIB_NAME_SAW_WHITE:if(a===`=`)n.state=y.ATTRIB_VALUE;else if(g(a))continue;else T(n,`Attribute without value`),n.tag.attributes[n.attribName]=``,n.attribValue=``,S(n,`onattribute`,{name:n.attribName,value:``}),n.attribName=``,a===`>`?O(n):v(m,a)?(n.attribName=a,n.state=y.ATTRIB_NAME):(T(n,`Invalid attribute name`),n.state=y.ATTRIB);continue;case y.ATTRIB_VALUE:if(g(a))continue;_(a)?(n.q=a,n.state=y.ATTRIB_VALUE_QUOTED):(n.opt.unquotedAttributeValues||w(n,`Unquoted attribute value`),n.state=y.ATTRIB_VALUE_UNQUOTED,n.attribValue=a);continue;case y.ATTRIB_VALUE_QUOTED:if(a!==n.q){a===`&`?n.state=y.ATTRIB_VALUE_ENTITY_Q:n.attribValue+=a;continue}D(n),n.q=``,n.state=y.ATTRIB_VALUE_CLOSED;continue;case y.ATTRIB_VALUE_CLOSED:g(a)?n.state=y.ATTRIB:a===`>`?O(n):a===`/`?n.state=y.OPEN_TAG_SLASH:v(m,a)?(T(n,`No whitespace between attributes`),n.attribName=a,n.attribValue=``,n.state=y.ATTRIB_NAME):T(n,`Invalid attribute name`);continue;case y.ATTRIB_VALUE_UNQUOTED:if(!ie(a)){a===`&`?n.state=y.ATTRIB_VALUE_ENTITY_U:n.attribValue+=a;continue}D(n),a===`>`?O(n):n.state=y.ATTRIB;continue;case y.CLOSE_TAG:if(n.tagName)a===`>`?k(n):v(h,a)?n.tagName+=a:n.script?(n.script+=`</`+n.tagName+a,n.tagName=``,n.state=y.SCRIPT):(g(a)||T(n,`Invalid tagname in closing tag`),n.state=y.CLOSE_TAG_SAW_WHITE);else{if(g(a))continue;ae(m,a)?n.script?(n.script+=`</`+a,n.state=y.SCRIPT):T(n,`Invalid tagname in closing tag.`):n.tagName=a}continue;case y.CLOSE_TAG_SAW_WHITE:if(g(a))continue;a===`>`?k(n):T(n,`Invalid characters in closing tag`);continue;case y.TEXT_ENTITY:case y.ATTRIB_VALUE_ENTITY_Q:case y.ATTRIB_VALUE_ENTITY_U:var c,l;switch(n.state){case y.TEXT_ENTITY:c=y.TEXT,l=`textNode`;break;case y.ATTRIB_VALUE_ENTITY_Q:c=y.ATTRIB_VALUE_QUOTED,l=`attribValue`;break;case y.ATTRIB_VALUE_ENTITY_U:c=y.ATTRIB_VALUE_UNQUOTED,l=`attribValue`;break}if(a===`;`){var u=pe(n);n.opt.unparsedEntities&&!Object.values(e.XML_ENTITIES).includes(u)?((n.entityCount+=1)>n.opt.maxEntityCount&&w(n,`Parsed entity count exceeds max entity count`),(n.entityDepth+=1)>n.opt.maxEntityDepth&&w(n,`Parsed entity depth exceeds max entity depth`),n.entity=``,n.state=c,n.write(u),--n.entityDepth):(n[l]+=u,n.entity=``,n.state=c)}else v(n.entity.length?re:ne,a)?n.entity+=a:(T(n,`Invalid character in entity name`),n[l]+=`&`+n.entity+a,n.entity=``,n.state=c);continue;default:throw Error(n,`Unknown state: `+n.state)}return n.position>=n.bufferCheckPosition&&r(n),n} 14/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */ 15String.fromCodePoint||(function(){var e=String.fromCharCode,t=Math.floor,n=function(){var n=16384,r=[],i,a,o=-1,s=arguments.length;if(!s)return``;for(var c=``;++o<s;){var l=Number(arguments[o]);if(!isFinite(l)||l<0||l>1114111||t(l)!==l)throw RangeError(`Invalid code point: `+l);l<=65535?r.push(l):(l-=65536,i=(l>>10)+55296,a=l%1024+56320,r.push(i,a)),(o+1===s||r.length>n)&&(c+=e.apply(null,r),r.length=0)}return c};Object.defineProperty?Object.defineProperty(String,`fromCodePoint`,{value:n,configurable:!0,writable:!0}):String.fromCodePoint=n})()})(exports===void 0?exports.sax={}:exports)}))());
15function an(e){let t=e.replace(/\s+/g,` `).trim(),n,r=t,i=t.indexOf(`[`);i!==-1&&t.endsWith(`]`)&&(r=t.slice(0,i).trim(),n=t.slice(i+1,-1).trim());let a=/^([^\s]+)\b/.exec(r)?.[1],o=/\bPUBLIC\s+(?:'([^']*)'|"([^"]*)")\s+(?:'([^']*)'|"([^"]*)")/i,s=/\bSYSTEM\s+(?:'([^']*)'|"([^"]*)")/i,c=o.exec(r);if(c){let t=c[1]??c[2]??``,r=c[3]??c[4]??``;return{raw:e,name:a,kind:`PUBLIC`,publicId:t,systemId:r,internalSubset:n}}let l=s.exec(r);if(l){let t=l[1]??l[2]??``;return{raw:e,name:a,kind:`SYSTEM`,systemId:t,internalSubset:n}}return{raw:e,name:a,kind:`UNKNOWN`,internalSubset:n}}function X(e,t){if(t.length>e.length)return!1;for(let n=0;n<t.length;n++)if(e[n]!==t[n])return!1;return!0}function on(e){return/^<\s*\w+(?=\s+[^<>]*=|>)/.test(e)}function Z(e,t){let n=new TextDecoder(t);return on(n.decode(e))}function sn(e){if(X(e,[60,63,120,109,108,32]))return{xml:!0,encoding:`utf-8`,offset:0};if(X(e,[239,187,191])){let t=`utf-8`;if(X(e.subarray(3),[60,63,120,109,108,32])||Z(e,t))return{xml:!0,encoding:t,offset:3}}if(X(e,[254,255])){let t=`utf-16be`;if(X(e.subarray(2),[0,60,0,63,0,120,0,109,0,108,0,32])||Z(e,t))return{xml:!0,encoding:t,offset:2}}if(X(e,[255,254])){let t=`utf-16le`;if(X(e.subarray(2),[60,0,63,0,120,0,109,0,108,0,32,0])||Z(e,t))return{xml:!0,encoding:t,offset:2}}return X(e,[0,60,0,63,0,120,0,109,0,108,0,32])?{xml:!0,encoding:`utf-16be`,offset:0}:X(e,[60,0,63,0,120,0,109,0,108,0,32,0])?{xml:!0,encoding:`utf-16le`,offset:0}:Z(e,`utf-8`)?{xml:!0,encoding:`utf-8`,offset:0}:{xml:!1}}let Q={docBook:{ext:`dbk`,mime:`application/docbook+xml`},gpx:{ext:`gpx`,mime:`application/gpx+xml`},musicXml:{ext:`musicxml`,mime:`application/vnd.recordare.musicxml+xml`},plist:{ext:`plist`,mime:`application/x-plist`},smil:{ext:`smil`,mime:`application/smil+xml`},svg:{ext:`svg`,mime:`image/svg+xml`},x3d:{ext:`x3d`,mime:`model/x3d+xml`}};var cn={"http://www.w3.org/2000/svg":Q.svg,"http://www.w3.org/1999/xhtml":{ext:`xhtml`,mime:`application/xhtml+xml`},"http://www.opengis.net/kml/2.2":{ext:`kml`,mime:`application/vnd.google-earth.kml+xml`},"http://www.opengis.net/gml":{ext:`gml`,mime:`application/gml+xml`},"http://www.w3.org/ns/ttml":{ext:`ttml`,mime:`application/ttml+xml`},"http://www.w3.org/2001/SMIL20/Language":Q.smil,"http://www.w3.org/2005/Atom":{ext:`atom`,mime:`application/atom+xml`},"urn:oasis:names:tc:xliff:document:2.0":{ext:`xlf`,mime:`application/xliff+xml`},"http://docbook.org/ns/docbook":Q.docBook,"http://www.tei-c.org/ns/1.0":{ext:`tei`,mime:`application/tei+xml`},"http://www.w3.org/1998/Math/MathML":{ext:`mml`,mime:`application/mathml+xml`},"http://www.topografix.com/GPX/1/0":Q.gpx,"http://www.topografix.com/GPX/1/1":Q.gpx},ln={opml:{ext:`opml`,mime:`text/x-opml`},plist:Q.plist,rss:{ext:`rss`,mime:`application/rss+xml`},"score-partwise":Q.musicXml,smil:Q.smil,svg:Q.svg},un={"-//OASIS//DTD DocBook XML V4.0//EN":Q.docBook,"-//OASIS//DTD DocBook XML V4.1//EN":Q.docBook,"-//OASIS//DTD DocBook XML V4.2//EN":Q.docBook,"-//OASIS//DTD DocBook XML V4.3//EN":Q.docBook,"-//OASIS//DTD DocBook XML V4.4//EN":Q.docBook,"-//OASIS//DTD DocBook XML V4.5//EN":Q.docBook,"-//Recordare//DTD MusicXML 4.0 Partwise//EN":Q.musicXml,"-//Apple//DTD PLIST 1.0//EN":Q.plist,"ISO//Web3D//DTD X3D 3.3//EN":Q.x3d},dn=class{constructor(e){this.options=e??{},this.firstTag=!0,this.onEnd=!1,this.parser=rn.default.parser(!0,{xmlns:!0}),this.nesting=0,this.parser.onerror=e=>{e.message.startsWith(`Invalid character entity`)||(this.fileType=void 0,this.onEnd=!0)},this.parser.onopentag=e=>{++this.nesting,!(!this.firstTag||this.onEnd)&&(this.firstTag=!1,e.uri?this.fileType=cn[e.uri]:e.name&&(this.fileType=ln[e.name.toLowerCase()]),this.fileType&&!this.options.fullScan&&(this.onEnd=!0))},this.parser.ondoctype=e=>{if(this.fileType||this.onEnd)return;let t=an(e);t.kind===`PUBLIC`&&t.publicId&&(this.fileType=un[t.publicId],this.fileType&&!this.options.fullScan&&(this.onEnd=!0))},this.parser.onclosetag=()=>{--this.nesting}}write(e){this.parser.write(e)}close(){this.parser.close(),this.onEnd=!0}isValid(){return this.nesting===0}};let fn={id:`xml`,detect:async e=>{let t=new Uint8Array(512);await e.peekBuffer(t,{length:128,mayBeLess:!0});let n=sn(t);if(n.xml){await e.ignore(n.offset);let r=new dn,i=new TextDecoder(n.encoding);do{let n=await e.readBuffer(t,{mayBeLess:!0}),a=t.subarray(0,n),o=i.decode(a);r.write(o),n<t.length&&r.close()}while(!r.onEnd);return r.fileType??{ext:`xml`,mime:`application/xml`}}}};var pn=class{static ruleDefinition={name:`abstractExtension`};async validate(e){return!1}async hasValuesExtension(e,t){let n=!1;for(let r of e)if(await this.hasExtension(r,t)){n=!0;break}return n}async allValuesHasValidExtension(e,t){let n=!0;for(let r of e)if(!await this.hasExtension(r,t)){n=!1;break}return n}async getExtensionFromFile(e){let t=``;if(e instanceof File)try{let n=e.stream(),r=await Ht(n,{customDetectors:[fn]});t=r&&r.ext}catch(e){console.error(e)}return t}async resolveExtension(e){let t=e.file;return await this.getExtensionFromFile(t)||t.extension||``}async hasExtension(e,t){let n=await this.resolveExtension(e);return n?t.includes(n)||t.includes(n.split(`.`).pop()):t.includes(this.getExtension(e.file.name))}getExtension(e){return(e||``).toLowerCase().split(`.`).pop()}},mn=class extends pn{static ruleDefinition={name:`fileAllowedExtensions`};async validate({config:e,values:t}){let n=(e?.value||``).split(`,`);return!n.length||await this.allValuesHasValidExtension(t,n)}getMessageParams(e){return[(e?.value||``).split(`,`).join(`, `).toUpperCase().trim()]}},hn=class{static ruleDefinition={name:`fileMaxFiles`};async validate({elements:e,config:t,values:n}){let r=t.value;
15return!r||n.length<=r&&e[0].dataset.fileErrorCode!==`fileMaxFiles`}getMessageParams(e){return[e?.value||``]}},gn=class{static ruleDefinition={name:`abstractSize`};async validate({config:e,values:t,elements:n}){let r=this.getLimit(e);return!r||this.isValid(t,r,n[0])}isValid(e,t,n){return!1}getFileSize(e){return e?.file?.size}getLimit({value:e}){return e?.limit}getMessageParams({value:e}){return[`${e?.displayfield}`.trim()]}},_n=class extends gn{static ruleDefinition={name:`fileMaxSize`};isValid(e,t){return!this.hasAtLeastOneLargerFile(e,t)}hasAtLeastOneLargerFile(e,t){return e.some(e=>this.hasLargerFile(e,t))}hasLargerFile(e,t){let n=this.getFileSize(e);return n&&n>t}},vn=class extends gn{static ruleDefinition={name:`fileMinSize`};isValid(e,t){return!this.hasAtLeastOneSmallerFile(e,t)}hasAtLeastOneSmallerFile(e,t){return e.some(e=>this.hasSmallerFile(e,t))}hasSmallerFile(e,t){let n=this.getFileSize(e);return n&&n<=t}},yn=class extends pn{static ruleDefinition={name:`fileRestrictedExtensions`};async validate({config:e,values:t}){let n=(e?.value||``).split(`,`);return!n.length||!await this.hasValuesExtension(t,n)}},bn=class extends gn{static ruleDefinition={name:`fileTotalMaxSize`};isValid(e,t,n){let r=!this.canValidateFile()||this.check(e,t);return r||n.setAttribute(`data-file-pending-error-code`,`fileTotalMaxSize`),r}check(e,t){return this.calculateFileSize(e)<=t}calculateFileSize(e){return this.getSingleFileSize(e)||this.calculateFileTatalSize(e)}calculateFileTatalSize(e){return e.reduce((e,t)=>e+(this.getFileSize(t)||0),0)}getSingleFileSize(e){return e.length==1&&e[0]._fileTotalMaxSize}canValidateFile(){return window.File&&window.FileReader&&window.FileList&&window.Blob}},xn=class{static ruleDefinition={name:`fileUnknownError`,className:`js-file`};async validate({elements:e}){return!e[0].hasAttribute(`data-fileunknownerror`)}},Sn=class{static ruleDefinition={name:`abstarctDimension`};async validate(e){return!1}async validateDimension({config:e,values:t,elements:n}){let r=this.getDimensionFiles(t,e.imageTypes);return this.canValidate(r)?await this.validateFiles(r,e.value):!0}async validateFiles(e,t){let n=!0;for(let r of e)if(n=await this.validateFile(r,t),!n)break;return n}async validateFile(e,t){let n=await this.process(e);return!n.success||this.isDimensionValid(n.image,t)}canValidate(e){return`URL`in globalThis&&e.length>0}isDimensionValid(e,{width:t,height:n}){return!1}getDimensionFiles(e,t){return e.filter(e=>this.canProcessFile(e.file,t)).map(this.getImage).filter(e=>!!e)}getImage(e){let t=``;try{t=e.file instanceof File?globalThis.URL.createObjectURL(e.file):``}catch(e){console.log(e)}return t}getExtension(e){return(e||``).toLowerCase().split(`.`).pop()}canProcessFile(e,t){return t.includes(this.getExtension(e.name))}async process(e){try{return{success:!0,image:await this.loadImage(e)}}catch(e){return{success:!1,error:e}}finally{URL.revokeObjectURL(e)}}loadImage(e){return new Promise((t,n)=>{let r=new Image;r.onload=()=>t(r),r.onerror=()=>n(Error(`Image failed to load from url: ${e}`)),r.onabort=()=>n(Error(`Image loading was aborted.`)),r.src=e})}getMessageParams({value:e}){return[e.width||``,e.height||``]}},Cn=class extends Sn{static ruleDefinition={name:`maxDimension`};async validate(e){return await this.validateDimension(e)}isDimensionValid(e,{width:t,height:n}){return(!t||t>e.width)&&(!n||n>e.height)}},wn=class extends Sn{static ruleDefinition={name:`minDimension`};async validate(e){return await this.validateDimension(e)}isDimensionValid(e,{width:t,height:n}){return(!t||t<e.width)&&(!n||n<e.height)}};function Tn(){return[xn,yn,mn,hn,_n,vn,bn,Cn,wn]}var En=class{static ruleDefinition={name:`date`,className:`date`,getElementRule:e=>e instanceof HTMLInputElement&&e.type==`date`};async validate({config:e,values:t,elements:n}){let r=this.getValues(t,e.type),i=r[0];return!r.length||this.isPlaceholder(e,i)||this.isValidDate(this.getDatePicker().getDate(n[0],i,e.value))}getValues(e,t){return t==`accessibilitydate`?e.length==3?[`${e[2]}-${e[1]}-${e[0]}`]:[]:e}isValidDate(e){return e instanceof Date&&!Number.isNaN(e.getTime())}isObject(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}getFormat(e){return this.isObject(e.value)&&e.value.format}isPlaceholder(e,t){let n=this.getFormat(e);return n?n===t:!1}getDatePicker(){return globalThis.helperJs.datePicker}getMessageKey(e,t){return this.getFormat(e)&&!this.getDatePicker().isDateSupported()?`dateFormat`:`date`}getMessageParams(e){return[this.getFormat(e)||``]}},Dn=class extends w{static ruleDefinition={name:`email`,className:`email`,getElementRule:e=>e instanceof HTMLInputElement&&e.type==`email`};async validate(e){return await super.validate({...e,config:{value:/^(")?(?:[^\."])(?:(?:[\.])?(?:[\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\w\-!#$%&'*+\/=?^_`{|}~]))*\1@(\w[\-\w\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]*\.){1,5}([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]){2,15}$/}})}},On=class extends w{static ruleDefinition={name:`number`,className:`number`,getElementRule:e=>e instanceof HTMLInputElement&&e.type==`number`};async validate(e){return await super.validate({...e,config:{value:/^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:-?\.\d+)?$/}})}},kn=class extends w{static ruleDefinition={name:`time`,getElementRule:e=>e instanceof HTMLInputElement&&e.type==`time`};async validate(e){return await super.validate({...e,config:{value:/^([01]?[0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9]){0,1}$/}})}},An=class extends w{static ruleDefinition={name:`url`,className:`url`,getElementRule:e=>e instanceof HTMLInputElement&&e.type==`url`};async validate(e){return await super.validate({...e,config:{value:/(((^https?)|(^ftp)):\/\/([\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\w\-]+\.)+\w{2,3}(\/[\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\w\-%]+(\.\w{2,})?)*(([\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i}})}};function jn(){return[Dn,On,En,An,kn]}function Mn(){return[...he(),...jn(),de,w,k,fe,D,O,T,x,...Tn()]}var $=class{static ruleDefinition={name:`equalTo`,updateConnectedRules:(e,t,n)=>{let{name:r}=n.value;e[r]??={},e[r][t]??={},e[r][t].equalTo=n}};async validate(e){return this.isEqual(e)}isEqual(e){let t=this.getCompareValues(e),{values:n,config:r}=e;return!n.length&&!t.length||this.castByType(r,n[0])===this.castByType(r,t[0])}getCompareValues({config:e,domHelper:t}){let{value:n}=e,r=t.getElementsByName(n.name);return t.getValues(r)}castByType(e,t){return e.type==`number`?parseFloat(t):this.applyCaseInsensitive(e,t)}applyCaseInsensitive(e,t){return this.isCaseInsensitive(e,t)?`${t}`.toLowerCase():t}isCaseInsensitive(e,t){return t&&e.hasOwnProperty(`caseSensitive`)&&!e.caseSensitive}getMessageParams(e){return[e.value.title]}},Nn=class extends ${static ruleDefinition={name:`greaterThanOrEqualTo`,updateConnectedRules:(e,t,n)=>{let{name:r}=n.value;e[r]??={},e[r][t]??={},e[r][t].greaterThanOrEqualTo=n}};async validate(e){let t=this.getCompareValues(e),{values:n,config:r}=e;return!n.length||!t.length||this.castByType(r,n[0])>=this.castByType(r,t[0])}getMessageKey({type:e}){return e==`date`?`dateGreaterThanOrEqualTo`:`greaterThanOrEqualTo`}},Pn=class extends ${static ruleDefinition={name:`greaterThan`,updateConnectedRules:(e,t,n)=>{let{name:r}=n.value;e[r]??={},e[r][t]??={},e[r][t].greaterThan=n}};async validate(e){let t=this.getCompareValues(e),{values:n,config:r}=e;return!n.length||!t.length||this.castByType(r,n[0])>this.castByType(r,t[0])}getMessageKey({type:e}){return e==`date`?`dateGreaterThan`:`greaterThan`}},Fn=class{static ruleDefinition={name:`iban`};async validate({values:e,config:t}){let n=this.getValue(e);return!n.length||n.length>5&&this.isValid(t.value,n)}getValue(e){return e.length?e[0].replace(/ /g,``).toUpperCase():``}bbancountrypatterns={AL:`\\d{8}[\\dA-Z]{16}`,AD:`\\d{8}[\\dA-Z]{12}`,AT:`\\d{16}`,AZ:`[\\dA-Z]{4}\\d{20}`,BE:`\\d{12}`,BH:`[A-Z]{4}[\\dA-Z]{14}`,BA:`\\d{16}`,BR:`\\d{23}[A-Z][\\dA-Z]`,BG:`[A-Z]{4}\\d{6}[\\dA-Z]{8}`,CR:`\\d{18}`,HR:`\\d{17}`,CY:`\\d{8}[\\dA-Z]{16}`,CZ:`\\d{20}`,DK:`\\d{14}`,DO:`[A-Z]{4}\\d{20}`,EE:`\\d{16}`,FO:`\\d{14}`,FI:`\\d{14}`,FR:`\\d{10}[\\dA-Z]{11}\\d{2}`,GE:`[\\dA-Z]{2}\\d{16}`,DE:`\\d{18}`,GI:`[A-Z]{4}[\\dA-Z]{15}`,GR:`\\d{7}[\\dA-Z]{16}
15`,GL:`\\d{14}`,GT:`[\\dA-Z]{4}[\\dA-Z]{20}`,HU:`\\d{24}`,IS:`\\d{22}`,IE:`[\\dA-Z]{4}\\d{14}`,IL:`\\d{19}`,IT:`[A-Z]\\d{10}[\\dA-Z]{12}`,KZ:`\\d{3}[\\dA-Z]{13}`,KW:`[A-Z]{4}[\\dA-Z]{22}`,LV:`[A-Z]{4}[\\dA-Z]{13}`,LB:`\\d{4}[\\dA-Z]{20}`,LI:`\\d{5}[\\dA-Z]{12}`,LT:`\\d{16}`,LU:`\\d{3}[\\dA-Z]{13}`,MK:`\\d{3}[\\dA-Z]{10}\\d{2}`,MT:`[A-Z]{4}\\d{5}[\\dA-Z]{18}`,MR:`\\d{23}`,MU:`[A-Z]{4}\\d{19}[A-Z]{3}`,MC:`\\d{10}[\\dA-Z]{11}\\d{2}`,MD:`[\\dA-Z]{2}\\d{18}`,ME:`\\d{18}`,NL:`[A-Z]{4}\\d{10}`,NO:`\\d{11}`,PK:`[\\dA-Z]{4}\\d{16}`,PS:`[\\dA-Z]{4}\\d{21}`,PL:`\\d{24}`,PT:`\\d{21}`,RO:`[A-Z]{4}[\\dA-Z]{16}`,SM:`[A-Z]\\d{10}[\\dA-Z]{12}`,SA:`\\d{2}[\\dA-Z]{18}`,RS:`\\d{18}`,SK:`\\d{20}`,SI:`\\d{15}`,ES:`\\d{20}`,SE:`\\d{20}`,CH:`\\d{5}[\\dA-Z]{12}`,TN:`\\d{20}`,TR:`\\d{5}[\\dA-Z]{17}`,AE:`\\d{3}\\d{16}`,GB:`[A-Z]{4}\\d{14}`,VG:`[\\dA-Z]{4}\\d{16}`,UA:`\\d{25}`};isValid({country:e},t){let n=e.length?e.split(`,`):[],r=t.substring(0,2);if(n.length&&!n.includes(r)||this.bbancountrypatterns.hasOwnProperty(r)&&!RegExp(`^[A-Z]{2}\\d{2}`+this.bbancountrypatterns[r]+`$`,``).test(t))return!1;let i=t.substring(2,4),a=t.substring(4,t.length)+r+`00`,o=this.getIbanDigits(a),s=98-this.getRemainder(o),c=(s<10?`0`:``)+s;return i===c}getIbanDigits(e){let t=``;for(let n=0;n<e.length;n++)t+=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ`.indexOf(e.charAt(n));return t.replace(/^0+/,``)}getRemainder(e){let t=``;for(let n=0;n<e.length;n++)t=(t+``+e.charAt(n))%97;return parseInt(t,10)}getMessageParams(e){return[e.value]}},In=class extends On{static ruleDefinition={name:`lv95coordinate`,className:`js-lv95-coordinate`,getElementRule:e=>!1}},Ln=class extends ${static ruleDefinition={name:`lessThanOrEqualTo`,updateConnectedRules:(e,t,n)=>{let{name:r}=n.value;e[r]??={},e[r][t]??={},e[r][t].lessThanOrEqualTo=n}};async validate(e){let t=this.getCompareValues(e),{values:n,config:r}=e;return!n.length||!t.length||this.castByType(r,n[0])<=this.castByType(r,t[0])}getMessageKey({type:e}){return e==`date`?`dateLessThanOrEqualTo`:`lessThanOrEqualTo`}},Rn=class extends ${static ruleDefinition={name:`lessThan`,updateConnectedRules:(e,t,n)=>{let{name:r}=n.value;e[r]??={},e[r][t]??={},e[r][t].lessThan=n}};async validate(e){let t=this.getCompareValues(e),{values:n,config:r}=e;return!n.length||!t.length||this.castByType(r,n[0])<this.castByType(r,t[0])}getMessageKey({type:e}){return e==`date`?`dateLessThan`:`lessThan`}},zn=class{static ruleDefinition={name:`maxLength`};async validate({values:e,config:t}){return!e.length||this.getValue(t.type,e)<=t.value}hasOptions(e){return[`servercombo`,`select`,`checkbox`,`groupedselect`].includes(e)}getValue(e,t){return(this.hasOptions(e)?t:t[0]).length}getMessageParams(e){return[e.value]}getMessageKey({type:e}
15){return this.hasOptions(e)?`maxOptions`:`maxLength`}},Bn=class{static ruleDefinition={name:`minLength`};async validate({values:e,config:t}){return!e.length||this.getValue(t.type,e)>=t.value}hasOptions(e){return[`servercombo`,`select`,`checkbox`,`groupedselect`].includes(e)}getValue(e,t){return(this.hasOptions(e)?t:t[0]).length}getMessageParams(e){return[e.value]}getMessageKey({type:e}){return this.hasOptions(e)?`minOptions`:`minLength`}},Vn=class extends ${static ruleDefinition={name:`notEqualTo`,updateConnectedRules:(e,t,n)=>{let{name:r}=n.value;e[r]??={},e[r][t]??={},e[r][t].notEqualTo=n}};async validate(e){let{values:t}=e,n=this.getCompareValues(e);return!t.length||!n.length||!this.isEqual(e)}},Hn=class{static ruleDefinition={name:`socialSecurityNumber`};async validate({values:e}){return!e.length||this.hasValidFormat(e[0])&&this.isValid(e[0])}hasValidFormat(e){return/^[7][5][6][.][\d]{4}[.][\d]{4}[.][\d]{2}$/.test(e)}isValid(e){let t=e.split(`.`).join(``).split(``),n=parseInt(t[t.length-1],10),r=0;for(let e=1;e<t.length-1;e+=2)r+=parseInt(t[e-1],10)+parseInt(t[e],10)*3;return Math.ceil(r/10)*10-r==n}},Un=class{static ruleDefinition={name:`wordsContains`};REG_EX={punctuation:new RegExp(/[~`!#$%^&*(){}[\];:'<,.>?/\\|_+=]/,`g`),space:/\s/};async validate({values:e,config:t}){return!e.length||this.isValid(t,e)}isValid(e,t){return this.resolveWord(e.value,t).length>0}resolveWord({substring:e,startswith:t,endswith:n,words:r,caseSensitive:i},a){let o=this.normalizeValue(a[0],i);return this.subString(this.getWords(e,i),o)||this.startsWith(this.getWords(t,i),o)||this.endsWith(this.getWords(n,i),o)||this.wordInList(this.getWords(r,i),o)}subString(e,t){for(let n=0;n<e.length;n++){let r=e[n].trim();if(t.indexOf(r)>-1)return r}return``}startsWith(e,t){for(let n=0;n<e.length;n++){let r=e[n].trim(),i=t.indexOf(r);for(;i>-1;){if(i===0||t[i-1].match(this.REG_EX.space)||t[i-1].match(this.REG_EX.punctuation))return r;i=t.indexOf(r,i+r.length)}}return``}endsWith(e,t){for(let n=0;n<e.length;n++){let r=e[n].trim(),i=t.indexOf(r);for(;i>-1;){if(i+=r.length,t.length===i||t[i].match(this.REG_EX.space)||t[i].match(this.REG_EX.punctuation))return r;i=t.indexOf(r,i)}}return``}wordInList(e,t){let n=t.replace(this.REG_EX.punctuation,` `).match(/(\S+)/g);for(let t=0;t<e.length;t++){let r=e[t].trim();if(n.includes(r))return r}return``}getWords(e,t){let n=this.normalizeValue(e,t);return n?n.split(`,`):[]}normalizeValue(e,t){return t?e:e.toLowerCase()}getMessageParams(e,t){return[]}},Wn=class extends Un{static ruleDefinition={name:`wordsNotContains`};async validate({values:e,config:t}){return!e.length||!this.isValid(t,e)}getMessageParams(e,t){return[this.resolveWord(e.value,t)||``]}},Gn=class extends E{static ruleDefinition={name:`dateYearsInFuture`};compare(e,t){return e<=t}getLimit(e){return e.getAttribute(`max`)}},Kn=class extends E{static ruleDefinition={name:`dateYearsInPast`};compare(e,t){return e>=t}getLimit(e){return e.getAttribute(`min`)}},qn=class{static ruleDefinition={name:`forbidWeekDays`};async validate({values:e,elements:t,config:n}){let r=this.getDate(e);return!r||this.compare(r,n.value)}getDate(e){return e.length&&this.hasValidValue(e[0])?new Date(e[0]):null}hasValidValue(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)&&new Date(e).toISOString().substring(0,10)===e}getDay(e){return`getDay`in e?{0:`sunday`,1:`monday`,2:`tuesday`,3:`wednesday`,4:`thursday`,5:`friday`,6:`saturday`}[e.getDay()]:-1}compare(e,t){let n=this.getDay(e);return n==-1||!t.split(`,`).includes(n)}getMessageParams({days:e}){return[e]}},Jn=class extends E{static ruleDefinition={name:`maxAge`};compare(e,t){return e>=t}getLimit(e){return e.getAttribute(`min`)}getMessageParams(e){return[e.value]}},Yn=class extends E{static ruleDefinition={name:`maxDate`};compare(e,t){return e<=t}getLimit(e){return e.getAttribute(`max`)}},Xn=class extends E{static ruleDefinition={name:`minAge`};compare(e,t){return e<=t}getLimit(e){return e.getAttribute(`max`)}getMessageParams(e){return[e.value]}},Zn=class extends E{static ruleDefinition={name:`minDate`};compare(e,t){return e>=t}getLimit(e){return e.getAttribute(`min`)}};function Qn(){return[Gn,Kn,qn,Jn,Yn,Xn,Zn]}var $n=class extends w{static ruleDefinition={name:`digits`};async validate(e){return await super.validate({...e,config:{value:/^\d+$/}})}},er=class extends w{static ruleDefinition={name:`integer`}},tr=class extends w{static ruleDefinition={name:`ipv4`}},nr=class extends w{static ruleDefinition={name:`latlong`}},rr=class extends w{static ruleDefinition={name:`onlyLetterNumber`}},ir=class extends w{static ruleDefinition={name:`onlyLetterSp`}},ar=class extends w{static ruleDefinition={name:`onlyNumberSp`}},or=class extends w{static ruleDefinition={name:`pattern`};async validate(e){return await super.validate({...e,config:{value:`^(?:${e.config.value})$`}})}};function sr(){return[$n,er,tr,nr,rr,ir,ar,or]}function cr(){return[$,Nn,Pn,Fn,In,Ln,Rn,zn,Bn,Vn,Hn,Un,Wn,...Qn(),...sr()]}function lr(e=[]){let t=[...Mn(),...cr(),...e];return new ue(t)}var ur=class{messages=new Map;default=null;setMessage(e,t){return this.messages.set(e,t),this}removeMessage(e){return this.messages.delete(e),this}setDefault(e){return this.default=e,this}getMessage(e){return this.messages.get(e)??this.default??``}},dr=class{fieldConfigs=new Map;generalMessages;constructor(e,t){this.parseConfig(e),this.setMessage(t)}register(e){this.generalMessages={...this.generalMessages,...e}}setMessage(e){this.generalMessages=e}parseConfig(e){for(let t in e){let n=e[t],r=this.forField(t);for(let e in n)e===`default`?r.setDefault(n[e]):r.setMessage(e,n[e])}}forField(e){return this.fieldConfigs.has(e)||this.fieldConfigs.set(e,new ur),this.fieldConfigs.get(e)}getMessage(e,t,n,r){let i=this.fieldConfigs.get(e);return i&&i.getMessage(t)||n||this.generalMessages[r||t]}},fr=class{label;domHelper;messageFormatter;messageManager;constructor(e,t,n,r){this.messageManager=e,this.messageFormatter=t,this.domHelper=n,this.label=r}register(e){this.messageManager.register(e)}resolve(e,t,n,r,i){let a=this.getMessage(e,t,n,i),o=[this.getLabel(e),...r];return this.messageFormatter.format(a,o)}getLabel(e){return this.label.resolveLabel(e,this.domHelper.getElementId(e))}getMessage(e,t,n,r){let i=this.domHelper.getMessage(e,n);return this.messageManager.getMessage(e?.getAttribute(`name`),t,i,r)}},pr={de:{captcha:`Bitte überprüfen Sie Ihre Eingabe bei der Sicherheitsüberprüfung.`,equalToListItem:`Das Feld «{1}» enthält keinen gültigen Wert.`,fileInvalidFormat:`Die Daten des Felds «{1}» sind nicht korrekt formatiert.`,required:`«{1}» ist ein Pflichtfeld.`,mapRequired:`Bitte wählen Sie einen Ort auf der Karte aus. Setzen Sie dafür eine Markierung auf der Karte.`,iban:`Die IBAN-Nummer ist nicht gültig.`,latlong:`Das Feld «{1}» hat eine ungültige Längengrad- oder Breitengrad-Angabe.`,socialSecurityNumber:`«{1}» ist keine gültige AHV-Nummer (Sozialversicherungsnummer).`,date:`Das Datumsformat für «{1}» kann nicht verwendet werden.`,dateFormat:`Das Datumsformat für «{1}» kann nicht verwendet werden. Richtig: «{2}»`,dateYearsInFuture:`«{1}» darf nicht vor «{2}» liegen.`,dateYearsInPast:`â{1}â liegt weiter zurück als â{2}â.`,forbidWeekDays:`Beim Feld «{1}» wurde ein gesperrter Wochentag ausgewählt. Folgende Wochentage stehen nicht zur Verfügung: {2}.`,max:`«{1}» darf nicht grösser sein als {2}.`,min:`Der Mindestwert für «{1}» ist {2}.`,maxAge:`«{1}» Das Höchstalter beträgt: «{2}».`,minAge:`«{1}» Das Mindestalter beträgt: «{2}».`,maxDate:`Das Datum bei Feld «{1}» darf nicht nach {2} liegen.`,minDate:`Das Datum bei Feld «{1}» darf nicht vor {2} liegen.`,maxTime:`Die Zeitangabe bei «{1}» ist nicht möglich. Die späteste Uhrzeit ist {2}.`,minTime:`Die Zeitangabe bei «{1}» ist nicht möglich. Die früheste Uhrzeit ist {2}.`,maxLength:`â{1}â darf nicht mehr als {2} Zeichen enthalten.`,minLength:`«{1}» muss mindestens {2} Zeichen enthalten.`,maxOptions:`Beim Feld «{1}» können maximal {2} Optionen ausgewählt werden.`,minOptions:`Beim Feld «{1}» müssen mindestens {2} Optionen ausgewählt werden.`,email:`«{1}» muss eine gültige E-Mail-Adresse sein.`,digits:`Geben Sie bitte nur Ziffern ein.`,integer:`«{1}» muss eine Zahl sein.`,ipv4:`«{1}» muss eine gültige IP-Adresse sein (IPv4).`,number:`«{1}» muss ein numerischer Wert sein.`,lv95coordinate:`«{1}» muss ein numerischer Wert und eine gültige Schweizer Koordinate sein.`,onlyLetterNumber:`«{1}» darf nur Buchstaben und Zahlen enthalten, keine Sonderzeichen und Umlaute.`,onlyLetterSp:`«{1}» darf nur Buchstaben enthalten (ohne Sonderzeichen und Umlaute).`,onlyNumberSp:`«{1}» darf nur Zahlen und Leerzeichen enthalten.`,regex:`«{1}» entspricht nicht dem hinterlegten Prüfmuster.`,time:`«{1}» muss eine gültige Zeitangabe zwischen 00:00 und 23:59 sein.`,url:`«{1}» muss eine gültige Internetadresse sein.`,zip:`Bitte geben Sie eine gültige Postleitzahl ein.`,pattern:`Das Prüfmuster im Feld «{1}» hat das erfolgreiche Absenden verhindert.`,equalTo:`«{1}» muss identisch sein mit «{2}».`,notEqualTo:`«{1}» darf nicht identisch sein mit «{2}».`,greaterThan:`Der Wert von Feld «{1}» muss grösser sein als der Wert von Feld «{2}».`,greaterThanOrEqualTo:`Der Wert von Feld «{1}» darf nicht kleiner sein als der Wert von Feld «{2}».`,lessThan:`Der Wert von Feld «{1}» muss kleiner sein als der Wert von Feld «{2}».`,lessThanOrEqualTo:`Der Wert von Feld â{1}â darf nicht grösser sein als der Wert von Feld â{2}â.`,dateGreaterThan:`Das Datum von Feld «{1}» muss aktueller sein als das Datum von Feld «{2}».`,dateGreaterThanOrEqualTo:`Das Datum von Feld «{1}» darf nicht älter sein als das Datum von Feld «{2}».`,dateLessThan:`Das Datum von Feld «{1}» muss weiter zurückliegen als das Datum von Feld «{2}».`,dateLessThanOrEqualTo:`Das Datum von Feld «{1}» darf nicht aktueller sein als das Datum von Feld «{2}».`,fileAllowedExtensions:`Das Dateiformat von «{1}
15» ist nicht zugelassen. Mögliche Dateiformate: {2}`,fileRestrictedExtensions:`Die Datei für «{1}» darf aufgrund ihres Dateityps nicht hochgeladen werden.`,fileMaxFiles:`Beim Feld «{1}» können maximal {2} Dateien hochgeladen werden.`,fileMaxSize:`Die Datei «{1}» ist zu gross. Maximale Dateigrösse: {2}`,fileMinSize:`Die Datei «{1}» ist zu klein. Minimale Dateigrösse: {2}`,fileTotalMaxSize:`Die Gesamtgrösse aller Dateien beim Feld «{1}» wurde überschritten. Die maximale Datenmenge beträgt {2}.`,fileUnknownError:`Achtung: Das Hochladen hat nicht funktioniert.`,maxDimension:`Achtung, die Bildgrösse beim Feld «{1}» entspricht nicht der Vorgabe von weniger als {2} x {3} Pixeln.`,minDimension:`Achtung, die Bildgrösse beim Feld «{1}» entspricht nicht der Vorgabe von mindestens {2} x {3} Pixeln.`,emailList:`Bitte geben Sie korrekte E-Mail-Adressen an.`,housenumber:`Ãberprüfen Sie die Eingabe der Hausnummer. Es sind maximal 12 Zeichen erlaubt.`,intltelinput:`Das Format der Telefonnummer ist nicht korrekt.`,postnumber:`Ãberprüfen Sie die Eingabe des Postfachs. Es sind maximal 5 Zeichen erlaubt.`},en:{captcha:`Captcha verification failed.`,equalToListItem:`The field "{1}" does not contain a valid value.`,fileInvalidFormat:`The data of the field "{1}" is not formatted correctly.`,required:`{1} is required.`,mapRequired:`Please select a location on the map. Place a marker on the map.`,iban:`The IBAN number is not valid.`,latlong:`The field {1} has invalid latitude or longitude.`,socialSecurityNumber:`{1} is not a valid AHV number (social security number)`,date:`{1} must be in a valid date format.`,dateFormat:`{1} must be in a valid date format. Valid format: {2}`,dateYearsInFuture:`{1} must be less than: {2}`,dateYearsInPast:`{1} must be greater than: {2}`,forbidWeekDays:`A locked weekday was selected in the field {1}. The following weekdays are not available: {2}.`,max:`{1} must be no more than {2}`,min:`{1} must be at least {2}`,maxAge:`{1} The max age should be: {2}.`,minAge:`{1} The min age should be: {2}.`,maxDate:`The date in field {1} must not be after {2}.`,minDate:`The date in field {1} must not be before {2}.`,maxTime:`The time at "{1}" is not possible. The latest time is {2}.`,minTime:`The time at "{1}" is not possible. The earliest time is {2}`,maxLength:`{1} must be no more than {2} characters long.`,minLength:`{1} must be at least {2} characters long.`,maxOptions:`{1} must be no more than {2} options selected.`,minOptions:`{1} must be at least {2} selected options.`,email:`{1} must be a valid email address.`,digits:`Please enter only digits.`,integer:`{1} must be an integer.`,ipv4:`{1} must be valid IP-Address (IPv4).`,number:`{1} must be a number.`,lv95coordinate:`{1} must be a numerical value and a valid Swiss coordinate.`,onlyLetterNumber:`{1} must contains only letters or numbers.`,onlyLetterSp:`{1} must contains only letters.`,onlyNumberSp:`{1} must contain only numbers.`,regex:`{1} must match the specified pattern.`,time:`{1} must be a valid time, between 00:00 and 23:59.`,url:`{1} must be a valid URL.`,zip:`Please enter a valid postcode.`,pattern:`The check pattern in the "{1}" field has prevented successful sending.`,equalTo:`{1} must be the same as {2}.`,notEqualTo:`{1} must be not identical to the {2}.`,greaterThan:`The value of the field {1} must be greater than a value of {2}.`,greaterThanOrEqualTo:`The value of the field {1} must be greater than (or equal to) a value of {2}.`,lessThan:`The value of the field {1} must be less than a value of {2}.`,lessThanOrEqualTo:`The value of the field {1} must be less than (or equal to) a value of {2}.`,dateGreaterThan:`The value of the field {1} must be greater than a value of {2}.`,dateGreaterThanOrEqualTo:`The value of the field {1} must be greater than (or equal to) a value of {2}.`,dateLessThan:`The value of the field {1} must be less than a value of {2}.`,dateLessThanOrEqualTo:`The value of the field {1} must be less than (or equal to) a value of {2}.`,fileAllowedExtensions:`{1} has invalid extension. Allowed extentions are: {2}`,fileRestrictedExtensions:`The file for {1} with that specific extension is not permitted.`,fileMaxFiles:`With the field {1} a maximum of {2} files can be uploaded.`,fileMaxSize:`The file {1} is too large. Maximum file size: {2}`,fileMinSize:`The file {1} is too small. Minimum file size: {2}`,fileTotalMaxSize:`The total size of all files in the field {1} has been exceeded. The maximum data volume is {2}.`,fileUnknownError:`Sorry was not able to upload a file.`,maxDimension:`Attention, the image dimension of field {1} does not correspond to the default of less than {2} x {3} pixels.`,minDimension:`Attention, the image dimension of field {1} does not correspond to the specifications of at least {2} x {3} pixels.`,emailList:`Please provide correct e-mail addresses.`,housenumber:`Check the entry of the house number. More than 12 characters are not allowed.`,intltelinput
15:`The format of the phone number is incorrect.`,postnumber:`Check the entry of the mailbox. A maximum of 5 characters is allowed.`},fr:{captcha:`Sâil vous plaît vérifier votre entrée à la vérification de la sécurité.`,equalToListItem:`Le champ « {1} » ne contient pas de valeur valide.`,fileInvalidFormat:`Les données du champ « {1} » ne sont pas correctement formatées.`,required:`« {1} » est un champ obligatoire.`,mapRequired:`Veuillez sélectionner un lieu sur la carte. Pour ce faire, placez un marqueur sur la carte.`,iban:`Le numéro IBAN nâest pas valide.`,latlong:`Le champ « {1} » a une indication de longitude ou de latitude non valable.`,socialSecurityNumber:`« {1} » nâest pas un numéro AVS (numéro de sécurité sociale) valide.`,date:`Le format de date ne peut être utilisé pour « {1} ».`,dateFormat:`Le format de date ne peut être utilisé pour « {1} ». Correct : « {2} ».`,dateYearsInFuture:`« {1} » ne doit pas être avant « {2} ».`,dateYearsInPast:`« {1} » est en outre que « {2} ».`,forbidWeekDays:`Un jour de la semaine bloqué a été sélectionné dans le champ « {1} ». Les jours de semaine suivants ne sont pas disponibles : {2}.`,max:`« {1} » ne doit pas être supérieur à {2}.`,min:`La valeur minimale pour « {1} » est {2}.`,maxAge:`« {1} » Lââge maximum est: « {2} ».`,minAge:`« {1} » Lââge minimum est: « {2} ».`,maxDate:`La date dans le champ « {1} » ne doit pas être postérieure à {2}.`,minDate:`La date dans le champ « {1} » ne doit pas être antérieure à {2}.`,maxTime:`Il nâest pas possible dâindiquer lâheure à « {1} ». Lâheure la plus tardive est {2}.`,minTime:`Il nâest pas possible dâindiquer lâheure à « {1} ». Lâheure la plus matinale est {2}.`,maxLength:`« {1} » ne peut pas contenir plus de {2} caractères.`,minLength:`« {1} » doit contenir au moins {2} caractères.`,maxOptions:`« {1} » doit avoir au maximum {2} options sélectionnées.`,minOptions:`« {1} » doit avoir au moins {2} options sélectionnées.`,email:`« {1} » doit dâêtre un courriel valide.`,digits:`Veuillez fournir seulement des chiffres.`,integer:`« {1} » doit être un nombre.`,ipv4:`« {1} » doit être une adresse IP valide (IPv4).`,number:`« {1} » doit être une valeur numérique.`,lv95coordinate:`« {1} » doit être une valeur numérique et une coordonnée suisse valide.`,onlyLetterNumber:`« {1} doit contenir uniquement des lettres et des chiffres, sans caractères spéciaux ou des trémas.`,onlyLetterSp:`« {1} » doit contenir seulement les lettres contenir (sans caractères spéciaux et les trémas).`,onlyNumberSp:`« {1} » doit contenir uniquement des chiffres et des espaces.`,regex:`« {1} » ne correspond pas à la mire stockée.`,time:`« {1} » doit être valide temps entre 0:00 et 23:59.`,url:`« {1} » doit être une adresse Internet valide.`,zip:`Veuillez saisir un code postal valide.`,pattern:`Le motif de contrôle dans le champ « {1} » a empêché lâenvoi réussi.`,equalTo:`« {1} » doit identique avec « {2} ».`,notEqualTo:`« {1} » ne peut pas être identique à {2}.`,greaterThan:`La valeur du champ « {1} » doit être supérieure à la valeur du champ « {2} ».`,greaterThanOrEqualTo:`La valeur du champ « {1} » ne doit pas être inférieure à la valeur du champ « {2} ».`,lessThan:`La valeur du champ « {1} » doit être inférieure à la valeur du champ « {2} ».`,lessThanOrEqualTo:`La valeur du champ « {1} » ne doit pas être supérieure à la valeur du champ « {2} ».`,dateGreaterThan:`La date du champ « {1} » doit être plus récente que la date du champ « {2} ».`,dateGreaterThanOrEqualTo:`La date du champ « {1} » ne doit pas être antérieure à la date du champ « {2} ».`,dateLessThan:`La date du champ « {1} » doit avoir été antérieure à la date du champ « {2} ».`,dateLessThanOrEqualTo:`La date du champ « {1} » ne doit pas être plus récente que la date du champ « {2} ».`,fileAllowedExtensions:`Le format de fichier valeur nâa ne pas admis. Formats de fichiers possibles : {2}`,fileRestrictedExtensions:`Le fichier pour « {1} » ne peut pas être téléchargé en raison de son type de fichier.`,fileMaxFiles:`Avec le champ « {1}
15», un maximum de fichiers {2} peuvent être téléchargés.`,fileMaxSize:`Le fichier « {1} » est trop grand. Taille maximal du fichier : {2}.`,fileMinSize:`Le fichier « {1} » est trop petit. Taille minimale du fichier : {2}`,fileTotalMaxSize:`La taille totale de tous les fichiers dans le champ « {1} » a été dépassée. Le volume maximal de données est {2}.`,fileUnknownError:`Attention : le téléchargement nâa pas fonctionné.`,maxDimension:`Attention, la taille de lâimage du champs « {1} » ne correspond pas à la valeur par défaut de moins de {2} x {3} pixels.`,minDimension:`Attention, la taille de lâimage du champs « {1} » ne correspond pas aux spécifications dâau moins {2} x {3} pixels.`,emailList:`Veuillez fournir des adresses e-mail correctes.`,housenumber:`Vérifiez l'entrée du numéro de maison. Plus de 12 caractères ne sont pas autorisés.`,intltelinput:`Le format du numéro de téléphone nâest pas correct.`,postnumber:`Vérifiez lâentrée de la boîte aux lettres. Un maximum de 5 caractères est autorisé.`},it:{captcha:`Si prega di controllare lâingresso durante il controllo di sicurezza.`,equalToListItem:`Il campo «{1}» non contiene un valore valido.`,fileInvalidFormat:`I dati del campo « {1} » non sono formattati correttamente.`,required:`«{1}» è un campo obbligatorio.`,mapRequired:`Selezionare una posizione sulla mappa. Posizionare un marcatore sulla mappa.`,iban:`Il numero IBAN non è valido.`,latlong:`Il campo « {1} » ha una specificazione di longitudine o latitudine non valida.`,socialSecurityNumber:`«{1}» non è un numero di AVS valido (numero di previdenza sociale)`,date:` Il formato della data per «{1}» non può essere utilizzato.`,dateFormat:`Il formato della data per «{1}» non può essere utilizzato. Corretto: «{2}».`,dateYearsInFuture:`«{1}» non può essere prima di «{2}».`,dateYearsInPast:`«{1}» è più indietro di «{2}».`,forbidWeekDays:`Nel campo «{1}» è stato selezionato un giorno feriale chiuso a chiave. I seguenti giorni feriali non sono disponibili: {2}.`,max:`«{1}» non può essere maggiore di {2}.`,min:`Il valore minimo per «{1}» è {2}.`,maxAge:`«{1}» Lâetà massima è: «{2}».`,minAge:`«{1}» Lâetà minima è: «{2}».`,maxDate:`La data nel campo «{1}» non deve essere successiva a {2}.`,minDate:`La data nel campo «{1}» non deve essere antecedente a {2}.`,maxTime:`L'ora a «{1}» non è possibile. L'ora più recente è {2}.`,minTime:`L'ora a «{1}» non è possibile. L'ora più vicina è {2}.`,maxLength:`«{1}» non può contenere più di {2} caratteri.`,minLength:`«{1}» deve contenere almeno {2} caratteri.`,maxOptions:`«{1}» deve avere al massimo {2} opzioni selezionate.`,minOptions:`«{1}» deve avere almeno {2} opzioni selezionate.`,email:`«{1}» deve essere un indirizzo e-mail valido.`,digits:`Inserisci solo numeri`,integer:`«{1}» deve essere un numero.`,ipv4:`«{1}» deve essere un indirizzo IP valido (IPv4)`,number:`«{1}» deve essere un valore numerico.`,lv95coordinate:`«{1}» deve essere un valore numerico e una coordinata svizzera valida.`,onlyLetterNumber:`«{1}» può contenere solo lettere e numeri, senza caratteri speciali o dieresi.`,onlyLetterSp:`«{1}» può contenere solo lettere (senza caratteri speciali e dieresi).`,onlyNumberSp:`«{1}» può contenere solo numeri e spazi.`,regex:`«{1}» non corrisponde al campione di prova memorizzato.`,time:`«{1}» deve essere una specifica di tempo valida tra le 00:00 e le 23:59.`,url:`«{1}» deve essere un indirizzo Internet valido.`,zip:`Si prega di inserire un codice postale valido.`,pattern:`Il modello di controllo nel campo «{1}» ha impedito l'invio.`,equalTo:`«{1}» deve essere identico a «{2}».`,notEqualTo:`«{1}» non deve essere identico a «{2}».`,greaterThan:`Il valore del campo «{1}» deve essere maggiore del valore del campo «{2}».`,greaterThanOrEqualTo:`Il valore del campo «{1}» non deve essere inferiore al valore del campo «{2}».`,lessThan:`Il valore del campo «{1}» deve essere inferiore al valore del campo «{2}».`,lessThanOrEqualTo:`Il valore del campo «{1}» non deve essere maggiore del valore del campo «{2}».`,dateGreaterThan:`La data del campo «{1}» deve essere più recente della data del campo «{2}».`,dateGreaterThanOrEqualTo:`La data del campo «{1}» non deve essere più vecchia della data del campo «{2}».`,dateLessThan:`La data del campo «{1}» deve essere più indietro rispetto alla data del campo «{2}».`,dateLessThanOrEqualTo:`La data del campo «{1}» non deve essere più recente della data del campo «{2}».`,fileAllowedExtensions:`Il formato di file di «{1}» non è consentito. Possibili formati di file: {2}`,fileRestrictedExtensions:`Il file per «{1}» non può essere caricato a causa del suo tipo di file.`,fileMaxFiles:`Con il campo «{1}» si possono caricare al massimo {2} file.`,fileMaxSize:`Il file «{1}» è troppo grande. Dimensione massima del file: {2}`,fileMinSize:`Il file «{1}» è troppo piccolo. Dimensione minima del file: {2}`,fileTotalMaxSize:`La dimensione totale di tutti i file nel campo «{1}» è stata superata. Il volume massimo di dati è {2}.`,fileUnknownError:`Sorry was not able to upload a file.`,maxDimension:`Attenzione, la dimensione dellâimmagine del campo «{1}» non corrisponde al valore predefinito di meno di {2} x {3} pixel.`,minDimension:`Attenzione, la dimensione dellâimmagine del campo «{1}» non corrisponde al valore predefinito di almeno {2} x {3} pixel.`,emailList:`Si prega di fornire indirizzi e-mail corretti.`,housenumber:`Controllare la voce del numero civico. Non sono ammessi più di 12 caratteri.`,intltelinput
15:`Il formato del numero di telefono non è corretto.`,postnumber:`Controllare la voce della cassetta postale. à consentito un massimo di 5 caratteri.`}};function mr(e,t){let n=pr[e]||pr.de;return new dr(t,n)}function hr(e,t,n,r){return new fr(e,t,n,r)}var gr=new class{format(e,t){let n=e||``;return t.forEach((e,t)=>{let r=RegExp(`\\{${t+1}\\}`,`g`);n=n.replace(r,String(e))}),n}};function _r(e,t){if(!e){console.trace(`validator: form was element was not provided`);return}let n=new ne(e),r=new g(n),i=new re(r,t.titles||{}),a=lr([]),o=mr(t.langCode,t.messages||{}),s=hr(o,gr,n,i),c=new ae(n,r),l={rules:t.rules||{},autoSubmit:t.autoSubmit};return t.submitHandler&&(l.submitHandler=t.submitHandler),{instance:C.create(n,c,a,s,l)}}function vr(e){return C.get(e)}let yr=gr.format;exports.clearErrors=e=>{let t=e.closest(`form`);vr(t)?.clearErrors(e)},exports.format=yr,exports.get=vr,exports.validate=_r});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.