@talisdev/bibliographic-resource-parsers-lib 5.28.0 → 5.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- (function(v,d){typeof exports=="object"&&typeof module<"u"?d(exports):typeof define=="function"&&define.amd?define(["exports"],d):(v=typeof globalThis<"u"?globalThis:v||self,d(v.BibliographicResourceParsersLib={}))})(this,(function(v){"use strict";function d(e,t,r){function n(a,c){var u;Object.defineProperty(a,"_zod",{value:a._zod??{},enumerable:!1}),(u=a._zod).traits??(u.traits=new Set),a._zod.traits.add(e),t(a,c);for(const l in i.prototype)l in a||Object.defineProperty(a,l,{value:i.prototype[l].bind(a)});a._zod.constr=i,a._zod.def=c}const o=r?.Parent??Object;class s extends o{}Object.defineProperty(s,"name",{value:e});function i(a){var c;const u=r?.Parent?new s:this;n(u,a),(c=u._zod).deferred??(c.deferred=[]);for(const l of u._zod.deferred)l();return u}return Object.defineProperty(i,"init",{value:n}),Object.defineProperty(i,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}class Pe extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class dn extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const gn={};function ge(e){return gn}function di(e){const t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}function $t(e,t){return typeof t=="bigint"?t.toString():t}function At(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Rt(e){return e==null}function wt(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function gi(e,t){const r=(e.toString().split(".")[1]||"").length,n=t.toString();let o=(n.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(n)){const c=n.match(/\d?e-(\d?)/);c?.[1]&&(o=Number.parseInt(c[1]))}const s=r>o?r:o,i=Number.parseInt(e.toFixed(s).replace(".","")),a=Number.parseInt(t.toFixed(s).replace(".",""));return i%a/10**s}const vn=Symbol("evaluating");function V(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==vn)return n===void 0&&(n=vn,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Ae(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Re(...e){const t={};for(const r of e){const n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function bn(e){return JSON.stringify(e)}const _n="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function He(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const vi=At(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Oe(e){if(He(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(He(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function yn(e){return Oe(e)?{...e}:Array.isArray(e)?[...e]:e}const bi=new Set(["string","number","symbol"]);function Ne(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ve(e,t,r){const n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function $(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function _i(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const yi={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Si(e,t){const r=e._zod.def,n=Re(e._zod.def,{get shape(){const o={};for(const s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&(o[s]=r.shape[s])}return Ae(this,"shape",o),o},checks:[]});return ve(e,n)}function Ei(e,t){const r=e._zod.def,n=Re(e._zod.def,{get shape(){const o={...e._zod.def.shape};for(const s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&delete o[s]}return Ae(this,"shape",o),o},checks:[]});return ve(e,n)}function $i(e,t){if(!Oe(t))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const o=Re(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return Ae(this,"shape",s),s},checks:[]});return ve(e,o)}function Ai(e,t){if(!Oe(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r={...e._zod.def,get shape(){const n={...e._zod.def.shape,...t};return Ae(this,"shape",n),n},checks:e._zod.def.checks};return ve(e,r)}function Ri(e,t){const r=Re(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return Ae(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return ve(e,r)}function wi(e,t,r){const n=Re(t._zod.def,{get shape(){const o=t._zod.def.shape,s={...o};if(r)for(const i in r){if(!(i in o))throw new Error(`Unrecognized key: "${i}"`);r[i]&&(s[i]=e?new e({type:"optional",innerType:o[i]}):o[i])}else for(const i in o)s[i]=e?new e({type:"optional",innerType:o[i]}):o[i];return Ae(this,"shape",s),s},checks:[]});return ve(t,n)}function Ii(e,t,r){const n=Re(t._zod.def,{get shape(){const o=t._zod.def.shape,s={...o};if(r)for(const i in r){if(!(i in s))throw new Error(`Unrecognized key: "${i}"`);r[i]&&(s[i]=new e({type:"nonoptional",innerType:o[i]}))}else for(const i in o)s[i]=new e({type:"nonoptional",innerType:o[i]});return Ae(this,"shape",s),s},checks:[]});return ve(t,n)}function ze(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function Le(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function Ye(e){return typeof e=="string"?e:e?.message}function be(e,t,r){const n={...e,path:e.path??[]};if(!e.message){const o=Ye(e.inst?._zod.def?.error?.(e))??Ye(t?.error?.(e))??Ye(r.customError?.(e))??Ye(r.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function It(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Ze(...e){const[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}const Sn=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,$t,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},En=d("$ZodError",Sn),$n=d("$ZodError",Sn,{Parent:Error});function ki(e,t=r=>r.message){const r={},n=[];for(const o of e.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(t(o))):n.push(t(o));return{formErrors:n,fieldErrors:r}}function Ci(e,t=r=>r.message){const r={_errors:[]},n=o=>{for(const s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(i=>n({issues:i}));else if(s.code==="invalid_key")n({issues:s.issues});else if(s.code==="invalid_element")n({issues:s.issues});else if(s.path.length===0)r._errors.push(t(s));else{let i=r,a=0;for(;a<s.path.length;){const c=s.path[a];a===s.path.length-1?(i[c]=i[c]||{_errors:[]},i[c]._errors.push(t(s))):i[c]=i[c]||{_errors:[]},i=i[c],a++}}};return n(e),r}const kt=e=>(t,r,n,o)=>{const s=n?Object.assign(n,{async:!1}):{async:!1},i=t._zod.run({value:r,issues:[]},s);if(i instanceof Promise)throw new Pe;if(i.issues.length){const a=new(o?.Err??e)(i.issues.map(c=>be(c,s,ge())));throw _n(a,o?.callee),a}return i.value},Ct=e=>async(t,r,n,o)=>{const s=n?Object.assign(n,{async:!0}):{async:!0};let i=t._zod.run({value:r,issues:[]},s);if(i instanceof Promise&&(i=await i),i.issues.length){const a=new(o?.Err??e)(i.issues.map(c=>be(c,s,ge())));throw _n(a,o?.callee),a}return i.value},Ke=e=>(t,r,n)=>{const o=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new Pe;return s.issues.length?{success:!1,error:new(e??En)(s.issues.map(i=>be(i,o,ge())))}:{success:!0,data:s.value}},Pi=Ke($n),Qe=e=>async(t,r,n)=>{const o=n?Object.assign(n,{async:!0}):{async:!0};let s=t._zod.run({value:r,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(i=>be(i,o,ge())))}:{success:!0,data:s.value}},Oi=Qe($n),Ni=e=>(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return kt(e)(t,r,o)},zi=e=>(t,r,n)=>kt(e)(t,r,n),Li=e=>async(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Ct(e)(t,r,o)},Ti=e=>async(t,r,n)=>Ct(e)(t,r,n),xi=e=>(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Ke(e)(t,r,o)},qi=e=>(t,r,n)=>Ke(e)(t,r,n),Zi=e=>async(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Qe(e)(t,r,o)},ji=e=>async(t,r,n)=>Qe(e)(t,r,n),Di=/^[cC][^\s-]{8,}$/,Ui=/^[0-9a-z]+$/,Bi=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Vi=/^[0-9a-vA-V]{20}$/,Fi=/^[A-Za-z0-9]{27}$/,Ji=/^[a-zA-Z0-9_-]{21}$/,Mi=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Wi=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,An=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Gi=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Xi="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Hi(){return new RegExp(Xi,"u")}const Yi=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Ki=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Qi=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,ea=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ta=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Rn=/^[A-Za-z0-9_-]*$/,ra=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,na=/^\+(?:[0-9]){6,14}[0-9]$/,wn="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",oa=new RegExp(`^${wn}$`);function In(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function sa(e){return new RegExp(`^${In(e)}$`)}function ia(e){const t=In({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${t}(?:${r.join("|")})`;return new RegExp(`^${wn}T(?:${n})$`)}const aa=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},ca=/^-?\d+$/,ua=/^-?\d+(?:\.\d+)?/,la=/^null$/i,pa=/^[^A-Z]*$/,ha=/^[^a-z]*$/,se=d("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),kn={number:"number",bigint:"bigint",object:"date"},Cn=d("$ZodCheckLessThan",(e,t)=>{se.init(e,t);const r=kn[typeof t.value];e._zod.onattach.push(n=>{const o=n._zod.bag,s=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:r,code:"too_big",maximum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Pn=d("$ZodCheckGreaterThan",(e,t)=>{se.init(e,t);const r=kn[typeof t.value];e._zod.onattach.push(n=>{const o=n._zod.bag,s=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),fa=d("$ZodCheckMultipleOf",(e,t)=>{se.init(e,t),e._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):gi(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),ma=d("$ZodCheckNumberFormat",(e,t)=>{se.init(e,t),t.format=t.format||"float64";const r=t.format?.includes("int"),n=r?"int":"number",[o,s]=yi[t.format];e._zod.onattach.push(i=>{const a=i._zod.bag;a.format=t.format,a.minimum=o,a.maximum=s,r&&(a.pattern=ca)}),e._zod.check=i=>{const a=i.value;if(r){if(!Number.isInteger(a)){i.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?i.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort}):i.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort});return}}a<o&&i.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>s&&i.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inst:e})}}),da=d("$ZodCheckMaxLength",(e,t)=>{var r;se.init(e,t),(r=e._zod.def).when??(r.when=n=>{const o=n.value;return!Rt(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{const o=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const o=n.value;if(o.length<=t.maximum)return;const i=It(o);n.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),ga=d("$ZodCheckMinLength",(e,t)=>{var r;se.init(e,t),(r=e._zod.def).when??(r.when=n=>{const o=n.value;return!Rt(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{const o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const o=n.value;if(o.length>=t.minimum)return;const i=It(o);n.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),va=d("$ZodCheckLengthEquals",(e,t)=>{var r;se.init(e,t),(r=e._zod.def).when??(r.when=n=>{const o=n.value;return!Rt(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{const o=n._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=n=>{const o=n.value,s=o.length;if(s===t.length)return;const i=It(o),a=s>t.length;n.issues.push({origin:i,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),et=d("$ZodCheckStringFormat",(e,t)=>{var r,n;se.init(e,t),e._zod.onattach.push(o=>{const s=o._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),ba=d("$ZodCheckRegex",(e,t)=>{et.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),_a=d("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=pa),et.init(e,t)}),ya=d("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=ha),et.init(e,t)}),Sa=d("$ZodCheckIncludes",(e,t)=>{se.init(e,t);const r=Ne(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(o=>{const s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),Ea=d("$ZodCheckStartsWith",(e,t)=>{se.init(e,t);const r=new RegExp(`^${Ne(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),$a=d("$ZodCheckEndsWith",(e,t)=>{se.init(e,t);const r=new RegExp(`.*${Ne(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Aa=d("$ZodCheckOverwrite",(e,t)=>{se.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});class Ra{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const n=t.split(`
1
+ (function(v,m){typeof exports=="object"&&typeof module<"u"?m(exports):typeof define=="function"&&define.amd?define(["exports"],m):(v=typeof globalThis<"u"?globalThis:v||self,m(v.BibliographicResourceParsersLib={}))})(this,(function(v){"use strict";function m(e,t,r){function n(a,c){var u;Object.defineProperty(a,"_zod",{value:a._zod??{},enumerable:!1}),(u=a._zod).traits??(u.traits=new Set),a._zod.traits.add(e),t(a,c);for(const l in i.prototype)l in a||Object.defineProperty(a,l,{value:i.prototype[l].bind(a)});a._zod.constr=i,a._zod.def=c}const o=r?.Parent??Object;class s extends o{}Object.defineProperty(s,"name",{value:e});function i(a){var c;const u=r?.Parent?new s:this;n(u,a),(c=u._zod).deferred??(c.deferred=[]);for(const l of u._zod.deferred)l();return u}return Object.defineProperty(i,"init",{value:n}),Object.defineProperty(i,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}class Pe extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class En extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const $n={};function ge(e){return $n}function Si(e){const t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}function It(e,t){return typeof t=="bigint"?t.toString():t}function kt(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Ct(e){return e==null}function Pt(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Ei(e,t){const r=(e.toString().split(".")[1]||"").length,n=t.toString();let o=(n.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(n)){const c=n.match(/\d?e-(\d?)/);c?.[1]&&(o=Number.parseInt(c[1]))}const s=r>o?r:o,i=Number.parseInt(e.toFixed(s).replace(".","")),a=Number.parseInt(t.toFixed(s).replace(".",""));return i%a/10**s}const An=Symbol("evaluating");function V(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==An)return n===void 0&&(n=An,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Ae(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Re(...e){const t={};for(const r of e){const n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function Rn(e){return JSON.stringify(e)}const wn="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ke(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const $i=kt(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Oe(e){if(Ke(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(Ke(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function In(e){return Oe(e)?{...e}:Array.isArray(e)?[...e]:e}const Ai=new Set(["string","number","symbol"]);function Ne(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ve(e,t,r){const n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function A(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Ri(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const wi={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Ii(e,t){const r=e._zod.def,n=Re(e._zod.def,{get shape(){const o={};for(const s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&(o[s]=r.shape[s])}return Ae(this,"shape",o),o},checks:[]});return ve(e,n)}function ki(e,t){const r=e._zod.def,n=Re(e._zod.def,{get shape(){const o={...e._zod.def.shape};for(const s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&delete o[s]}return Ae(this,"shape",o),o},checks:[]});return ve(e,n)}function Ci(e,t){if(!Oe(t))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const o=Re(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return Ae(this,"shape",s),s},checks:[]});return ve(e,o)}function Pi(e,t){if(!Oe(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r={...e._zod.def,get shape(){const n={...e._zod.def.shape,...t};return Ae(this,"shape",n),n},checks:e._zod.def.checks};return ve(e,r)}function Oi(e,t){const r=Re(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return Ae(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return ve(e,r)}function Ni(e,t,r){const n=Re(t._zod.def,{get shape(){const o=t._zod.def.shape,s={...o};if(r)for(const i in r){if(!(i in o))throw new Error(`Unrecognized key: "${i}"`);r[i]&&(s[i]=e?new e({type:"optional",innerType:o[i]}):o[i])}else for(const i in o)s[i]=e?new e({type:"optional",innerType:o[i]}):o[i];return Ae(this,"shape",s),s},checks:[]});return ve(t,n)}function zi(e,t,r){const n=Re(t._zod.def,{get shape(){const o=t._zod.def.shape,s={...o};if(r)for(const i in r){if(!(i in s))throw new Error(`Unrecognized key: "${i}"`);r[i]&&(s[i]=new e({type:"nonoptional",innerType:o[i]}))}else for(const i in o)s[i]=new e({type:"nonoptional",innerType:o[i]});return Ae(this,"shape",s),s},checks:[]});return ve(t,n)}function ze(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function Le(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function Qe(e){return typeof e=="string"?e:e?.message}function be(e,t,r){const n={...e,path:e.path??[]};if(!e.message){const o=Qe(e.inst?._zod.def?.error?.(e))??Qe(t?.error?.(e))??Qe(r.customError?.(e))??Qe(r.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function Ot(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function De(...e){const[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}const kn=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,It,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Cn=m("$ZodError",kn),Pn=m("$ZodError",kn,{Parent:Error});function Li(e,t=r=>r.message){const r={},n=[];for(const o of e.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(t(o))):n.push(t(o));return{formErrors:n,fieldErrors:r}}function xi(e,t=r=>r.message){const r={_errors:[]},n=o=>{for(const s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(i=>n({issues:i}));else if(s.code==="invalid_key")n({issues:s.issues});else if(s.code==="invalid_element")n({issues:s.issues});else if(s.path.length===0)r._errors.push(t(s));else{let i=r,a=0;for(;a<s.path.length;){const c=s.path[a];a===s.path.length-1?(i[c]=i[c]||{_errors:[]},i[c]._errors.push(t(s))):i[c]=i[c]||{_errors:[]},i=i[c],a++}}};return n(e),r}const Nt=e=>(t,r,n,o)=>{const s=n?Object.assign(n,{async:!1}):{async:!1},i=t._zod.run({value:r,issues:[]},s);if(i instanceof Promise)throw new Pe;if(i.issues.length){const a=new(o?.Err??e)(i.issues.map(c=>be(c,s,ge())));throw wn(a,o?.callee),a}return i.value},zt=e=>async(t,r,n,o)=>{const s=n?Object.assign(n,{async:!0}):{async:!0};let i=t._zod.run({value:r,issues:[]},s);if(i instanceof Promise&&(i=await i),i.issues.length){const a=new(o?.Err??e)(i.issues.map(c=>be(c,s,ge())));throw wn(a,o?.callee),a}return i.value},et=e=>(t,r,n)=>{const o=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new Pe;return s.issues.length?{success:!1,error:new(e??Cn)(s.issues.map(i=>be(i,o,ge())))}:{success:!0,data:s.value}},Ti=et(Pn),tt=e=>async(t,r,n)=>{const o=n?Object.assign(n,{async:!0}):{async:!0};let s=t._zod.run({value:r,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(i=>be(i,o,ge())))}:{success:!0,data:s.value}},qi=tt(Pn),Di=e=>(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Nt(e)(t,r,o)},Zi=e=>(t,r,n)=>Nt(e)(t,r,n),ji=e=>async(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return zt(e)(t,r,o)},Ui=e=>async(t,r,n)=>zt(e)(t,r,n),Bi=e=>(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return et(e)(t,r,o)},Vi=e=>(t,r,n)=>et(e)(t,r,n),Fi=e=>async(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return tt(e)(t,r,o)},Ji=e=>async(t,r,n)=>tt(e)(t,r,n),Mi=/^[cC][^\s-]{8,}$/,Wi=/^[0-9a-z]+$/,Gi=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Xi=/^[0-9a-vA-V]{20}$/,Hi=/^[A-Za-z0-9]{27}$/,Yi=/^[a-zA-Z0-9_-]{21}$/,Ki=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Qi=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,On=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,ea=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,ta="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function ra(){return new RegExp(ta,"u")}const na=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,oa=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,sa=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,ia=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,aa=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Nn=/^[A-Za-z0-9_-]*$/,ca=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,ua=/^\+(?:[0-9]){6,14}[0-9]$/,zn="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",la=new RegExp(`^${zn}$`);function Ln(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function pa(e){return new RegExp(`^${Ln(e)}$`)}function ha(e){const t=Ln({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${t}(?:${r.join("|")})`;return new RegExp(`^${zn}T(?:${n})$`)}const fa=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},da=/^-?\d+$/,ma=/^-?\d+(?:\.\d+)?/,ga=/^null$/i,va=/^[^A-Z]*$/,ba=/^[^a-z]*$/,se=m("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),xn={number:"number",bigint:"bigint",object:"date"},Tn=m("$ZodCheckLessThan",(e,t)=>{se.init(e,t);const r=xn[typeof t.value];e._zod.onattach.push(n=>{const o=n._zod.bag,s=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:r,code:"too_big",maximum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),qn=m("$ZodCheckGreaterThan",(e,t)=>{se.init(e,t);const r=xn[typeof t.value];e._zod.onattach.push(n=>{const o=n._zod.bag,s=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),_a=m("$ZodCheckMultipleOf",(e,t)=>{se.init(e,t),e._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):Ei(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),ya=m("$ZodCheckNumberFormat",(e,t)=>{se.init(e,t),t.format=t.format||"float64";const r=t.format?.includes("int"),n=r?"int":"number",[o,s]=wi[t.format];e._zod.onattach.push(i=>{const a=i._zod.bag;a.format=t.format,a.minimum=o,a.maximum=s,r&&(a.pattern=da)}),e._zod.check=i=>{const a=i.value;if(r){if(!Number.isInteger(a)){i.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?i.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort}):i.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort});return}}a<o&&i.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>s&&i.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inst:e})}}),Sa=m("$ZodCheckMaxLength",(e,t)=>{var r;se.init(e,t),(r=e._zod.def).when??(r.when=n=>{const o=n.value;return!Ct(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{const o=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const o=n.value;if(o.length<=t.maximum)return;const i=Ot(o);n.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Ea=m("$ZodCheckMinLength",(e,t)=>{var r;se.init(e,t),(r=e._zod.def).when??(r.when=n=>{const o=n.value;return!Ct(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{const o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const o=n.value;if(o.length>=t.minimum)return;const i=Ot(o);n.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),$a=m("$ZodCheckLengthEquals",(e,t)=>{var r;se.init(e,t),(r=e._zod.def).when??(r.when=n=>{const o=n.value;return!Ct(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{const o=n._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=n=>{const o=n.value,s=o.length;if(s===t.length)return;const i=Ot(o),a=s>t.length;n.issues.push({origin:i,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),rt=m("$ZodCheckStringFormat",(e,t)=>{var r,n;se.init(e,t),e._zod.onattach.push(o=>{const s=o._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),Aa=m("$ZodCheckRegex",(e,t)=>{rt.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Ra=m("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=va),rt.init(e,t)}),wa=m("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=ba),rt.init(e,t)}),Ia=m("$ZodCheckIncludes",(e,t)=>{se.init(e,t);const r=Ne(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(o=>{const s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),ka=m("$ZodCheckStartsWith",(e,t)=>{se.init(e,t);const r=new RegExp(`^${Ne(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Ca=m("$ZodCheckEndsWith",(e,t)=>{se.init(e,t);const r=new RegExp(`.*${Ne(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Pa=m("$ZodCheckOverwrite",(e,t)=>{se.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});class Oa{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const n=t.split(`
2
2
  `).filter(i=>i),o=Math.min(...n.map(i=>i.length-i.trimStart().length)),s=n.map(i=>i.slice(o)).map(i=>" ".repeat(this.indent*2)+i);for(const i of s)this.content.push(i)}compile(){const t=Function,r=this?.args,o=[...(this?.content??[""]).map(s=>` ${s}`)];return new t(...r,o.join(`
3
- `))}}const wa={major:4,minor:1,patch:12},G=d("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=wa;const n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(const o of n)for(const s of o._zod.onattach)s(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const o=(i,a,c)=>{let u=ze(i),l;for(const f of a){if(f._zod.def.when){if(!f._zod.def.when(i))continue}else if(u)continue;const m=i.issues.length,g=f._zod.check(i);if(g instanceof Promise&&c?.async===!1)throw new Pe;if(l||g instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await g,i.issues.length!==m&&(u||(u=ze(i,m)))});else{if(i.issues.length===m)continue;u||(u=ze(i,m))}}return l?l.then(()=>i):i},s=(i,a,c)=>{if(ze(i))return i.aborted=!0,i;const u=o(a,n,c);if(u instanceof Promise){if(c.async===!1)throw new Pe;return u.then(l=>e._zod.parse(l,c))}return e._zod.parse(u,c)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction==="backward"){const u=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return u instanceof Promise?u.then(l=>s(l,i,a)):s(u,i,a)}const c=e._zod.parse(i,a);if(c instanceof Promise){if(a.async===!1)throw new Pe;return c.then(u=>o(u,n,a))}return o(c,n,a)}}e["~standard"]={validate:o=>{try{const s=Pi(e,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return Oi(e,o).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}}),Pt=d("$ZodString",(e,t)=>{G.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??aa(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),J=d("$ZodStringFormat",(e,t)=>{et.init(e,t),Pt.init(e,t)}),Ia=d("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Wi),J.init(e,t)}),ka=d("$ZodUUID",(e,t)=>{if(t.version){const n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=An(n))}else t.pattern??(t.pattern=An());J.init(e,t)}),Ca=d("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Gi),J.init(e,t)}),Pa=d("$ZodURL",(e,t)=>{J.init(e,t),e._zod.check=r=>{try{const n=r.value.trim(),o=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:ra.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=o.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Oa=d("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Hi()),J.init(e,t)}),Na=d("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Ji),J.init(e,t)}),za=d("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Di),J.init(e,t)}),La=d("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Ui),J.init(e,t)}),Ta=d("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Bi),J.init(e,t)}),xa=d("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Vi),J.init(e,t)}),qa=d("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Fi),J.init(e,t)}),Za=d("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=ia(t)),J.init(e,t)}),ja=d("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=oa),J.init(e,t)}),Da=d("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=sa(t)),J.init(e,t)}),Ua=d("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Mi),J.init(e,t)}),Ba=d("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Yi),J.init(e,t),e._zod.onattach.push(r=>{const n=r._zod.bag;n.format="ipv4"})}),Va=d("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Ki),J.init(e,t),e._zod.onattach.push(r=>{const n=r._zod.bag;n.format="ipv6"}),e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),Fa=d("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Qi),J.init(e,t)}),Ja=d("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=ea),J.init(e,t),e._zod.check=r=>{const n=r.value.split("/");try{if(n.length!==2)throw new Error;const[o,s]=n;if(!s)throw new Error;const i=Number(s);if(`${i}`!==s)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${o}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function On(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Ma=d("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=ta),J.init(e,t),e._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),e._zod.check=r=>{On(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function Wa(e){if(!Rn.test(e))return!1;const t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return On(r)}const Ga=d("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Rn),J.init(e,t),e._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),e._zod.check=r=>{Wa(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Xa=d("$ZodE164",(e,t)=>{t.pattern??(t.pattern=na),J.init(e,t)});function Ha(e,t=null){try{const r=e.split(".");if(r.length!==3)return!1;const[n]=r;if(!n)return!1;const o=JSON.parse(atob(n));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const Ya=d("$ZodJWT",(e,t)=>{J.init(e,t),e._zod.check=r=>{Ha(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),Nn=d("$ZodNumber",(e,t)=>{G.init(e,t),e._zod.pattern=e._zod.bag.pattern??ua,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}const o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;const s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...s?{received:s}:{}}),r}}),Ka=d("$ZodNumber",(e,t)=>{ma.init(e,t),Nn.init(e,t)}),Qa=d("$ZodNull",(e,t)=>{G.init(e,t),e._zod.pattern=la,e._zod.values=new Set([null]),e._zod.parse=(r,n)=>{const o=r.value;return o===null||r.issues.push({expected:"null",code:"invalid_type",input:o,inst:e}),r}}),ec=d("$ZodUnknown",(e,t)=>{G.init(e,t),e._zod.parse=r=>r}),tc=d("$ZodNever",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function zn(e,t,r){e.issues.length&&t.issues.push(...Le(r,e.issues)),t.value[r]=e.value}const rc=d("$ZodArray",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>{const o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=Array(o.length);const s=[];for(let i=0;i<o.length;i++){const a=o[i],c=t.element._zod.run({value:a,issues:[]},n);c instanceof Promise?s.push(c.then(u=>zn(u,r,i))):zn(c,r,i)}return s.length?Promise.all(s).then(()=>r):r}});function tt(e,t,r,n){e.issues.length&&t.issues.push(...Le(r,e.issues)),e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}function Ln(e){const t=Object.keys(e.shape);for(const n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);const r=_i(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function Tn(e,t,r,n,o,s){const i=[],a=o.keySet,c=o.catchall._zod,u=c.def.type;for(const l of Object.keys(t)){if(a.has(l))continue;if(u==="never"){i.push(l);continue}const f=c.run({value:t[l],issues:[]},n);f instanceof Promise?e.push(f.then(m=>tt(m,r,l,t))):tt(f,r,l,t)}return i.length&&r.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:s}),e.length?Promise.all(e).then(()=>r):r}const nc=d("$ZodObject",(e,t)=>{if(G.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const a=t.shape;Object.defineProperty(t,"shape",{get:()=>{const c={...a};return Object.defineProperty(t,"shape",{value:c}),c}})}const n=At(()=>Ln(t));V(e._zod,"propValues",()=>{const a=t.shape,c={};for(const u in a){const l=a[u]._zod;if(l.values){c[u]??(c[u]=new Set);for(const f of l.values)c[u].add(f)}}return c});const o=He,s=t.catchall;let i;e._zod.parse=(a,c)=>{i??(i=n.value);const u=a.value;if(!o(u))return a.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),a;a.value={};const l=[],f=i.shape;for(const m of i.keys){const P=f[m]._zod.run({value:u[m],issues:[]},c);P instanceof Promise?l.push(P.then(b=>tt(b,a,m,u))):tt(P,a,m,u)}return s?Tn(l,u,a,c,n.value,e):l.length?Promise.all(l).then(()=>a):a}}),oc=d("$ZodObjectJIT",(e,t)=>{nc.init(e,t);const r=e._zod.parse,n=At(()=>Ln(t)),o=m=>{const g=new Ra(["shape","payload","ctx"]),P=n.value,b=L=>{const B=bn(L);return`shape[${B}]._zod.run({ value: input[${B}], issues: [] }, ctx)`};g.write("const input = payload.value;");const O=Object.create(null);let Z=0;for(const L of P.keys)O[L]=`key_${Z++}`;g.write("const newResult = {};");for(const L of P.keys){const B=O[L],Q=bn(L);g.write(`const ${B} = ${b(L)};`),g.write(`
3
+ `))}}const Na={major:4,minor:1,patch:12},X=m("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Na;const n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(const o of n)for(const s of o._zod.onattach)s(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const o=(i,a,c)=>{let u=ze(i),l;for(const f of a){if(f._zod.def.when){if(!f._zod.def.when(i))continue}else if(u)continue;const d=i.issues.length,g=f._zod.check(i);if(g instanceof Promise&&c?.async===!1)throw new Pe;if(l||g instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await g,i.issues.length!==d&&(u||(u=ze(i,d)))});else{if(i.issues.length===d)continue;u||(u=ze(i,d))}}return l?l.then(()=>i):i},s=(i,a,c)=>{if(ze(i))return i.aborted=!0,i;const u=o(a,n,c);if(u instanceof Promise){if(c.async===!1)throw new Pe;return u.then(l=>e._zod.parse(l,c))}return e._zod.parse(u,c)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction==="backward"){const u=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return u instanceof Promise?u.then(l=>s(l,i,a)):s(u,i,a)}const c=e._zod.parse(i,a);if(c instanceof Promise){if(a.async===!1)throw new Pe;return c.then(u=>o(u,n,a))}return o(c,n,a)}}e["~standard"]={validate:o=>{try{const s=Ti(e,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return qi(e,o).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}}),Lt=m("$ZodString",(e,t)=>{X.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??fa(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),J=m("$ZodStringFormat",(e,t)=>{rt.init(e,t),Lt.init(e,t)}),za=m("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Qi),J.init(e,t)}),La=m("$ZodUUID",(e,t)=>{if(t.version){const n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=On(n))}else t.pattern??(t.pattern=On());J.init(e,t)}),xa=m("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=ea),J.init(e,t)}),Ta=m("$ZodURL",(e,t)=>{J.init(e,t),e._zod.check=r=>{try{const n=r.value.trim(),o=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:ca.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=o.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),qa=m("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=ra()),J.init(e,t)}),Da=m("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Yi),J.init(e,t)}),Za=m("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Mi),J.init(e,t)}),ja=m("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Wi),J.init(e,t)}),Ua=m("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Gi),J.init(e,t)}),Ba=m("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Xi),J.init(e,t)}),Va=m("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Hi),J.init(e,t)}),Fa=m("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=ha(t)),J.init(e,t)}),Ja=m("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=la),J.init(e,t)}),Ma=m("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=pa(t)),J.init(e,t)}),Wa=m("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Ki),J.init(e,t)}),Ga=m("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=na),J.init(e,t),e._zod.onattach.push(r=>{const n=r._zod.bag;n.format="ipv4"})}),Xa=m("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=oa),J.init(e,t),e._zod.onattach.push(r=>{const n=r._zod.bag;n.format="ipv6"}),e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),Ha=m("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=sa),J.init(e,t)}),Ya=m("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=ia),J.init(e,t),e._zod.check=r=>{const n=r.value.split("/");try{if(n.length!==2)throw new Error;const[o,s]=n;if(!s)throw new Error;const i=Number(s);if(`${i}`!==s)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${o}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function Dn(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Ka=m("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=aa),J.init(e,t),e._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),e._zod.check=r=>{Dn(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function Qa(e){if(!Nn.test(e))return!1;const t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Dn(r)}const ec=m("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Nn),J.init(e,t),e._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),e._zod.check=r=>{Qa(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),tc=m("$ZodE164",(e,t)=>{t.pattern??(t.pattern=ua),J.init(e,t)});function rc(e,t=null){try{const r=e.split(".");if(r.length!==3)return!1;const[n]=r;if(!n)return!1;const o=JSON.parse(atob(n));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const nc=m("$ZodJWT",(e,t)=>{J.init(e,t),e._zod.check=r=>{rc(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),Zn=m("$ZodNumber",(e,t)=>{X.init(e,t),e._zod.pattern=e._zod.bag.pattern??ma,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}const o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;const s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...s?{received:s}:{}}),r}}),oc=m("$ZodNumber",(e,t)=>{ya.init(e,t),Zn.init(e,t)}),sc=m("$ZodNull",(e,t)=>{X.init(e,t),e._zod.pattern=ga,e._zod.values=new Set([null]),e._zod.parse=(r,n)=>{const o=r.value;return o===null||r.issues.push({expected:"null",code:"invalid_type",input:o,inst:e}),r}}),ic=m("$ZodUnknown",(e,t)=>{X.init(e,t),e._zod.parse=r=>r}),ac=m("$ZodNever",(e,t)=>{X.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function jn(e,t,r){e.issues.length&&t.issues.push(...Le(r,e.issues)),t.value[r]=e.value}const cc=m("$ZodArray",(e,t)=>{X.init(e,t),e._zod.parse=(r,n)=>{const o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=Array(o.length);const s=[];for(let i=0;i<o.length;i++){const a=o[i],c=t.element._zod.run({value:a,issues:[]},n);c instanceof Promise?s.push(c.then(u=>jn(u,r,i))):jn(c,r,i)}return s.length?Promise.all(s).then(()=>r):r}});function nt(e,t,r,n){e.issues.length&&t.issues.push(...Le(r,e.issues)),e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}function Un(e){const t=Object.keys(e.shape);for(const n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);const r=Ri(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function Bn(e,t,r,n,o,s){const i=[],a=o.keySet,c=o.catchall._zod,u=c.def.type;for(const l of Object.keys(t)){if(a.has(l))continue;if(u==="never"){i.push(l);continue}const f=c.run({value:t[l],issues:[]},n);f instanceof Promise?e.push(f.then(d=>nt(d,r,l,t))):nt(f,r,l,t)}return i.length&&r.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:s}),e.length?Promise.all(e).then(()=>r):r}const uc=m("$ZodObject",(e,t)=>{if(X.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const a=t.shape;Object.defineProperty(t,"shape",{get:()=>{const c={...a};return Object.defineProperty(t,"shape",{value:c}),c}})}const n=kt(()=>Un(t));V(e._zod,"propValues",()=>{const a=t.shape,c={};for(const u in a){const l=a[u]._zod;if(l.values){c[u]??(c[u]=new Set);for(const f of l.values)c[u].add(f)}}return c});const o=Ke,s=t.catchall;let i;e._zod.parse=(a,c)=>{i??(i=n.value);const u=a.value;if(!o(u))return a.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),a;a.value={};const l=[],f=i.shape;for(const d of i.keys){const P=f[d]._zod.run({value:u[d],issues:[]},c);P instanceof Promise?l.push(P.then(b=>nt(b,a,d,u))):nt(P,a,d,u)}return s?Bn(l,u,a,c,n.value,e):l.length?Promise.all(l).then(()=>a):a}}),lc=m("$ZodObjectJIT",(e,t)=>{uc.init(e,t);const r=e._zod.parse,n=kt(()=>Un(t)),o=d=>{const g=new Oa(["shape","payload","ctx"]),P=n.value,b=x=>{const B=Rn(x);return`shape[${B}]._zod.run({ value: input[${B}], issues: [] }, ctx)`};g.write("const input = payload.value;");const O=Object.create(null);let D=0;for(const x of P.keys)O[x]=`key_${D++}`;g.write("const newResult = {};");for(const x of P.keys){const B=O[x],Q=Rn(x);g.write(`const ${B} = ${b(x)};`),g.write(`
4
4
  if (${B}.issues.length) {
5
5
  payload.issues = payload.issues.concat(${B}.issues.map(iss => ({
6
6
  ...iss,
@@ -17,4 +17,4 @@
17
17
  newResult[${Q}] = ${B}.value;
18
18
  }
19
19
 
20
- `)}g.write("payload.value = newResult;"),g.write("return payload;");const K=g.compile();return(L,B)=>K(m,L,B)};let s;const i=He,a=!gn.jitless,u=a&&vi.value,l=t.catchall;let f;e._zod.parse=(m,g)=>{f??(f=n.value);const P=m.value;return i(P)?a&&u&&g?.async===!1&&g.jitless!==!0?(s||(s=o(t.shape)),m=s(m,g),l?Tn([],P,m,g,f,e):m):r(m,g):(m.issues.push({expected:"object",code:"invalid_type",input:P,inst:e}),m)}});function xn(e,t,r,n){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const o=e.filter(s=>!ze(s));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(s=>s.issues.map(i=>be(i,n,ge())))}),t)}const sc=d("$ZodUnion",(e,t)=>{G.init(e,t),V(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),V(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),V(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),V(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>wt(s.source)).join("|")})$`)}});const r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(o,s)=>{if(r)return n(o,s);let i=!1;const a=[];for(const c of t.options){const u=c._zod.run({value:o.value,issues:[]},s);if(u instanceof Promise)a.push(u),i=!0;else{if(u.issues.length===0)return u;a.push(u)}}return i?Promise.all(a).then(c=>xn(c,o,e,s)):xn(a,o,e,s)}}),ic=d("$ZodIntersection",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>{const o=r.value,s=t.left._zod.run({value:o,issues:[]},n),i=t.right._zod.run({value:o,issues:[]},n);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([c,u])=>qn(r,c,u)):qn(r,s,i)}});function Ot(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Oe(e)&&Oe(t)){const r=Object.keys(t),n=Object.keys(e).filter(s=>r.indexOf(s)!==-1),o={...e,...t};for(const s of n){const i=Ot(e[s],t[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};o[s]=i.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let n=0;n<e.length;n++){const o=e[n],s=t[n],i=Ot(o,s);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};r.push(i.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function qn(e,t,r){if(t.issues.length&&e.issues.push(...t.issues),r.issues.length&&e.issues.push(...r.issues),ze(e))return e;const n=Ot(t.value,r.value);if(!n.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return e.value=n.data,e}const ac=d("$ZodRecord",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>{const o=r.value;if(!Oe(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;const s=[];if(t.keyType._zod.values){const i=t.keyType._zod.values;r.value={};for(const c of i)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){const u=t.valueType._zod.run({value:o[c],issues:[]},n);u instanceof Promise?s.push(u.then(l=>{l.issues.length&&r.issues.push(...Le(c,l.issues)),r.value[c]=l.value})):(u.issues.length&&r.issues.push(...Le(c,u.issues)),r.value[c]=u.value)}let a;for(const c in o)i.has(c)||(a=a??[],a.push(c));a&&a.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:a})}else{r.value={};for(const i of Reflect.ownKeys(o)){if(i==="__proto__")continue;const a=t.keyType._zod.run({value:i,issues:[]},n);if(a instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(a.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:a.issues.map(u=>be(u,n,ge())),input:i,path:[i],inst:e}),r.value[a.value]=a.value;continue}const c=t.valueType._zod.run({value:o[i],issues:[]},n);c instanceof Promise?s.push(c.then(u=>{u.issues.length&&r.issues.push(...Le(i,u.issues)),r.value[a.value]=u.value})):(c.issues.length&&r.issues.push(...Le(i,c.issues)),r.value[a.value]=c.value)}}return s.length?Promise.all(s).then(()=>r):r}}),cc=d("$ZodEnum",(e,t)=>{G.init(e,t);const r=di(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(o=>bi.has(typeof o)).map(o=>typeof o=="string"?Ne(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{const i=o.value;return n.has(i)||o.issues.push({code:"invalid_value",values:r,input:i,inst:e}),o}}),uc=d("$ZodLiteral",(e,t)=>{if(G.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?Ne(r):r?Ne(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,n)=>{const o=r.value;return e._zod.values.has(o)||r.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),r}}),lc=d("$ZodTransform",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new dn(e.constructor.name);const o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(i=>(r.value=i,r));if(o instanceof Promise)throw new Pe;return r.value=o,r}});function Zn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const pc=d("$ZodOptional",(e,t)=>{G.init(e,t),e._zod.optin="optional",e._zod.optout="optional",V(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),V(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${wt(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>Zn(s,r.value)):Zn(o,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}}),hc=d("$ZodNullable",(e,t)=>{G.init(e,t),V(e._zod,"optin",()=>t.innerType._zod.optin),V(e._zod,"optout",()=>t.innerType._zod.optout),V(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${wt(r.source)}|null)$`):void 0}),V(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)}),fc=d("$ZodDefault",(e,t)=>{G.init(e,t),e._zod.optin="optional",V(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>jn(s,t)):jn(o,t)}});function jn(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const mc=d("$ZodPrefault",(e,t)=>{G.init(e,t),e._zod.optin="optional",V(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n))}),dc=d("$ZodNonOptional",(e,t)=>{G.init(e,t),V(e._zod,"values",()=>{const r=t.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),e._zod.parse=(r,n)=>{const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>Dn(s,e)):Dn(o,e)}});function Dn(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const gc=d("$ZodCatch",(e,t)=>{G.init(e,t),V(e._zod,"optin",()=>t.innerType._zod.optin),V(e._zod,"optout",()=>t.innerType._zod.optout),V(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>(r.value=s.value,s.issues.length&&(r.value=t.catchValue({...r,error:{issues:s.issues.map(i=>be(i,n,ge()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(s=>be(s,n,ge()))},input:r.value}),r.issues=[]),r)}}),vc=d("$ZodPipe",(e,t)=>{G.init(e,t),V(e._zod,"values",()=>t.in._zod.values),V(e._zod,"optin",()=>t.in._zod.optin),V(e._zod,"optout",()=>t.out._zod.optout),V(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){const s=t.out._zod.run(r,n);return s instanceof Promise?s.then(i=>rt(i,t.in,n)):rt(s,t.in,n)}const o=t.in._zod.run(r,n);return o instanceof Promise?o.then(s=>rt(s,t.out,n)):rt(o,t.out,n)}});function rt(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const bc=d("$ZodReadonly",(e,t)=>{G.init(e,t),V(e._zod,"propValues",()=>t.innerType._zod.propValues),V(e._zod,"values",()=>t.innerType._zod.values),V(e._zod,"optin",()=>t.innerType._zod.optin),V(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(Un):Un(o)}});function Un(e){return e.value=Object.freeze(e.value),e}const _c=d("$ZodCustom",(e,t)=>{se.init(e,t),G.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{const n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(s=>Bn(s,r,n,e));Bn(o,r,n,e)}});function Bn(e,t,r,n){if(!e){const o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(Ze(o))}}class yc{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){const n=r[0];if(this._map.set(t,n),n&&typeof n=="object"&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,t)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){const r=t._zod.parent;if(r){const n={...this.get(r)??{}};delete n.id;const o={...n,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function Sc(){return new yc}const nt=Sc();function Ec(e,t){return new e({type:"string",...$(t)})}function $c(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...$(t)})}function Vn(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...$(t)})}function Ac(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...$(t)})}function Rc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...$(t)})}function wc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...$(t)})}function Ic(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...$(t)})}function Fn(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...$(t)})}function kc(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...$(t)})}function Cc(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...$(t)})}function Pc(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...$(t)})}function Oc(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...$(t)})}function Nc(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...$(t)})}function zc(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...$(t)})}function Lc(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...$(t)})}function Tc(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...$(t)})}function xc(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...$(t)})}function qc(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...$(t)})}function Zc(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...$(t)})}function jc(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...$(t)})}function Dc(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...$(t)})}function Uc(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...$(t)})}function Bc(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...$(t)})}function Vc(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...$(t)})}function Fc(e,t){return new e({type:"string",format:"date",check:"string_format",...$(t)})}function Jc(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...$(t)})}function Mc(e,t){return new e({type:"string",format:"duration",check:"string_format",...$(t)})}function Wc(e,t){return new e({type:"number",checks:[],...$(t)})}function Gc(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...$(t)})}function Xc(e,t){return new e({type:"null",...$(t)})}function Hc(e){return new e({type:"unknown"})}function Yc(e,t){return new e({type:"never",...$(t)})}function Jn(e,t){return new Cn({check:"less_than",...$(t),value:e,inclusive:!1})}function Nt(e,t){return new Cn({check:"less_than",...$(t),value:e,inclusive:!0})}function Mn(e,t){return new Pn({check:"greater_than",...$(t),value:e,inclusive:!1})}function zt(e,t){return new Pn({check:"greater_than",...$(t),value:e,inclusive:!0})}function Wn(e,t){return new fa({check:"multiple_of",...$(t),value:e})}function Gn(e,t){return new da({check:"max_length",...$(t),maximum:e})}function ot(e,t){return new ga({check:"min_length",...$(t),minimum:e})}function Xn(e,t){return new va({check:"length_equals",...$(t),length:e})}function Kc(e,t){return new ba({check:"string_format",format:"regex",...$(t),pattern:e})}function Qc(e){return new _a({check:"string_format",format:"lowercase",...$(e)})}function eu(e){return new ya({check:"string_format",format:"uppercase",...$(e)})}function tu(e,t){return new Sa({check:"string_format",format:"includes",...$(t),includes:e})}function ru(e,t){return new Ea({check:"string_format",format:"starts_with",...$(t),prefix:e})}function nu(e,t){return new $a({check:"string_format",format:"ends_with",...$(t),suffix:e})}function je(e){return new Aa({check:"overwrite",tx:e})}function ou(e){return je(t=>t.normalize(e))}function su(){return je(e=>e.trim())}function iu(){return je(e=>e.toLowerCase())}function au(){return je(e=>e.toUpperCase())}function cu(e,t,r){return new e({type:"array",element:t,...$(r)})}function uu(e,t,r){const n=$(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}function lu(e,t,r){return new e({type:"custom",check:"custom",fn:t,...$(r)})}function pu(e){const t=hu(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(Ze(n,r.value,t._zod.def));else{const o=n;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),r.issues.push(Ze(o))}},e(r.value,r)));return t}function hu(e,t){const r=new se({check:"custom",...$(t)});return r._zod.check=e,r}const fu=d("ZodISODateTime",(e,t)=>{Za.init(e,t),X.init(e,t)});function mu(e){return Vc(fu,e)}const du=d("ZodISODate",(e,t)=>{ja.init(e,t),X.init(e,t)});function gu(e){return Fc(du,e)}const vu=d("ZodISOTime",(e,t)=>{Da.init(e,t),X.init(e,t)});function bu(e){return Jc(vu,e)}const _u=d("ZodISODuration",(e,t)=>{Ua.init(e,t),X.init(e,t)});function yu(e){return Mc(_u,e)}const ae=d("ZodError",(e,t)=>{En.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>Ci(e,r)},flatten:{value:r=>ki(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,$t,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,$t,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Su=kt(ae),Eu=Ct(ae),$u=Ke(ae),Au=Qe(ae),Ru=Ni(ae),wu=zi(ae),Iu=Li(ae),ku=Ti(ae),Cu=xi(ae),Pu=qi(ae),Ou=Zi(ae),Nu=ji(ae),H=d("ZodType",(e,t)=>(G.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(Re(t,{checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]})),e.clone=(r,n)=>ve(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.parse=(r,n)=>Su(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>$u(e,r,n),e.parseAsync=async(r,n)=>Eu(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>Au(e,r,n),e.spa=e.safeParseAsync,e.encode=(r,n)=>Ru(e,r,n),e.decode=(r,n)=>wu(e,r,n),e.encodeAsync=async(r,n)=>Iu(e,r,n),e.decodeAsync=async(r,n)=>ku(e,r,n),e.safeEncode=(r,n)=>Cu(e,r,n),e.safeDecode=(r,n)=>Pu(e,r,n),e.safeEncodeAsync=async(r,n)=>Ou(e,r,n),e.safeDecodeAsync=async(r,n)=>Nu(e,r,n),e.refine=(r,n)=>e.check($l(r,n)),e.superRefine=r=>e.check(Al(r)),e.overwrite=r=>e.check(je(r)),e.optional=()=>he(e),e.nullable=()=>so(e),e.nullish=()=>he(so(e)),e.nonoptional=r=>gl(e,r),e.array=()=>U(e),e.or=r=>pe([e,r]),e.and=r=>il(e,r),e.transform=r=>ao(e,ll(r)),e.default=r=>fl(e,r),e.prefault=r=>dl(e,r),e.catch=r=>bl(e,r),e.pipe=r=>ao(e,r),e.readonly=()=>Sl(e),e.describe=r=>{const n=e.clone();return nt.add(n,{description:r}),n},Object.defineProperty(e,"description",{get(){return nt.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return nt.get(e);const n=e.clone();return nt.add(n,r[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Hn=d("_ZodString",(e,t)=>{Pt.init(e,t),H.init(e,t);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...n)=>e.check(Kc(...n)),e.includes=(...n)=>e.check(tu(...n)),e.startsWith=(...n)=>e.check(ru(...n)),e.endsWith=(...n)=>e.check(nu(...n)),e.min=(...n)=>e.check(ot(...n)),e.max=(...n)=>e.check(Gn(...n)),e.length=(...n)=>e.check(Xn(...n)),e.nonempty=(...n)=>e.check(ot(1,...n)),e.lowercase=n=>e.check(Qc(n)),e.uppercase=n=>e.check(eu(n)),e.trim=()=>e.check(su()),e.normalize=(...n)=>e.check(ou(...n)),e.toLowerCase=()=>e.check(iu()),e.toUpperCase=()=>e.check(au())}),zu=d("ZodString",(e,t)=>{Pt.init(e,t),Hn.init(e,t),e.email=r=>e.check($c(Lu,r)),e.url=r=>e.check(Fn(Kn,r)),e.jwt=r=>e.check(Bc(Hu,r)),e.emoji=r=>e.check(kc(xu,r)),e.guid=r=>e.check(Vn(Yn,r)),e.uuid=r=>e.check(Ac(st,r)),e.uuidv4=r=>e.check(Rc(st,r)),e.uuidv6=r=>e.check(wc(st,r)),e.uuidv7=r=>e.check(Ic(st,r)),e.nanoid=r=>e.check(Cc(qu,r)),e.guid=r=>e.check(Vn(Yn,r)),e.cuid=r=>e.check(Pc(Zu,r)),e.cuid2=r=>e.check(Oc(ju,r)),e.ulid=r=>e.check(Nc(Du,r)),e.base64=r=>e.check(jc(Wu,r)),e.base64url=r=>e.check(Dc(Gu,r)),e.xid=r=>e.check(zc(Uu,r)),e.ksuid=r=>e.check(Lc(Bu,r)),e.ipv4=r=>e.check(Tc(Vu,r)),e.ipv6=r=>e.check(xc(Fu,r)),e.cidrv4=r=>e.check(qc(Ju,r)),e.cidrv6=r=>e.check(Zc(Mu,r)),e.e164=r=>e.check(Uc(Xu,r)),e.datetime=r=>e.check(mu(r)),e.date=r=>e.check(gu(r)),e.time=r=>e.check(bu(r)),e.duration=r=>e.check(yu(r))});function p(e){return Ec(zu,e)}const X=d("ZodStringFormat",(e,t)=>{J.init(e,t),Hn.init(e,t)}),Lu=d("ZodEmail",(e,t)=>{Ca.init(e,t),X.init(e,t)}),Yn=d("ZodGUID",(e,t)=>{Ia.init(e,t),X.init(e,t)}),st=d("ZodUUID",(e,t)=>{ka.init(e,t),X.init(e,t)}),Kn=d("ZodURL",(e,t)=>{Pa.init(e,t),X.init(e,t)});function Tu(e){return Fn(Kn,e)}const xu=d("ZodEmoji",(e,t)=>{Oa.init(e,t),X.init(e,t)}),qu=d("ZodNanoID",(e,t)=>{Na.init(e,t),X.init(e,t)}),Zu=d("ZodCUID",(e,t)=>{za.init(e,t),X.init(e,t)}),ju=d("ZodCUID2",(e,t)=>{La.init(e,t),X.init(e,t)}),Du=d("ZodULID",(e,t)=>{Ta.init(e,t),X.init(e,t)}),Uu=d("ZodXID",(e,t)=>{xa.init(e,t),X.init(e,t)}),Bu=d("ZodKSUID",(e,t)=>{qa.init(e,t),X.init(e,t)}),Vu=d("ZodIPv4",(e,t)=>{Ba.init(e,t),X.init(e,t)}),Fu=d("ZodIPv6",(e,t)=>{Va.init(e,t),X.init(e,t)}),Ju=d("ZodCIDRv4",(e,t)=>{Fa.init(e,t),X.init(e,t)}),Mu=d("ZodCIDRv6",(e,t)=>{Ja.init(e,t),X.init(e,t)}),Wu=d("ZodBase64",(e,t)=>{Ma.init(e,t),X.init(e,t)}),Gu=d("ZodBase64URL",(e,t)=>{Ga.init(e,t),X.init(e,t)}),Xu=d("ZodE164",(e,t)=>{Xa.init(e,t),X.init(e,t)}),Hu=d("ZodJWT",(e,t)=>{Ya.init(e,t),X.init(e,t)}),Qn=d("ZodNumber",(e,t)=>{Nn.init(e,t),H.init(e,t),e.gt=(n,o)=>e.check(Mn(n,o)),e.gte=(n,o)=>e.check(zt(n,o)),e.min=(n,o)=>e.check(zt(n,o)),e.lt=(n,o)=>e.check(Jn(n,o)),e.lte=(n,o)=>e.check(Nt(n,o)),e.max=(n,o)=>e.check(Nt(n,o)),e.int=n=>e.check(to(n)),e.safe=n=>e.check(to(n)),e.positive=n=>e.check(Mn(0,n)),e.nonnegative=n=>e.check(zt(0,n)),e.negative=n=>e.check(Jn(0,n)),e.nonpositive=n=>e.check(Nt(0,n)),e.multipleOf=(n,o)=>e.check(Wn(n,o)),e.step=(n,o)=>e.check(Wn(n,o)),e.finite=()=>e;const r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function eo(e){return Wc(Qn,e)}const Yu=d("ZodNumberFormat",(e,t)=>{Ka.init(e,t),Qn.init(e,t)});function to(e){return Gc(Yu,e)}const Ku=d("ZodNull",(e,t)=>{Qa.init(e,t),H.init(e,t)});function it(e){return Xc(Ku,e)}const Qu=d("ZodUnknown",(e,t)=>{ec.init(e,t),H.init(e,t)});function ro(){return Hc(Qu)}const el=d("ZodNever",(e,t)=>{tc.init(e,t),H.init(e,t)});function tl(e){return Yc(el,e)}const rl=d("ZodArray",(e,t)=>{rc.init(e,t),H.init(e,t),e.element=t.element,e.min=(r,n)=>e.check(ot(r,n)),e.nonempty=r=>e.check(ot(1,r)),e.max=(r,n)=>e.check(Gn(r,n)),e.length=(r,n)=>e.check(Xn(r,n)),e.unwrap=()=>e.element});function U(e,t){return cu(rl,e,t)}const nl=d("ZodObject",(e,t)=>{oc.init(e,t),H.init(e,t),V(e,"shape",()=>t.shape),e.keyof=()=>De(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:ro()}),e.loose=()=>e.clone({...e._zod.def,catchall:ro()}),e.strict=()=>e.clone({...e._zod.def,catchall:tl()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>$i(e,r),e.safeExtend=r=>Ai(e,r),e.merge=r=>Ri(e,r),e.pick=r=>Si(e,r),e.omit=r=>Ei(e,r),e.partial=(...r)=>wi(oo,e,r[0]),e.required=(...r)=>Ii(io,e,r[0])});function I(e,t){const r={type:"object",shape:e??{},...$(t)};return new nl(r)}const ol=d("ZodUnion",(e,t)=>{sc.init(e,t),H.init(e,t),e.options=t.options});function pe(e,t){return new ol({type:"union",options:e,...$(t)})}const sl=d("ZodIntersection",(e,t)=>{ic.init(e,t),H.init(e,t)});function il(e,t){return new sl({type:"intersection",left:e,right:t})}const al=d("ZodRecord",(e,t)=>{ac.init(e,t),H.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function no(e,t,r){return new al({type:"record",keyType:e,valueType:t,...$(r)})}const Lt=d("ZodEnum",(e,t)=>{cc.init(e,t),H.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(n,o)=>{const s={};for(const i of n)if(r.has(i))s[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new Lt({...t,checks:[],...$(o),entries:s})},e.exclude=(n,o)=>{const s={...t.entries};for(const i of n)if(r.has(i))delete s[i];else throw new Error(`Key ${i} not found in enum`);return new Lt({...t,checks:[],...$(o),entries:s})}});function De(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Lt({type:"enum",entries:r,...$(t)})}const cl=d("ZodLiteral",(e,t)=>{uc.init(e,t),H.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function M(e,t){return new cl({type:"literal",values:Array.isArray(e)?e:[e],...$(t)})}const ul=d("ZodTransform",(e,t)=>{lc.init(e,t),H.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new dn(e.constructor.name);r.addIssue=s=>{if(typeof s=="string")r.issues.push(Ze(s,r.value,t));else{const i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=r.value),i.inst??(i.inst=e),r.issues.push(Ze(i))}};const o=t.transform(r.value,r);return o instanceof Promise?o.then(s=>(r.value=s,r)):(r.value=o,r)}});function ll(e){return new ul({type:"transform",transform:e})}const oo=d("ZodOptional",(e,t)=>{pc.init(e,t),H.init(e,t),e.unwrap=()=>e._zod.def.innerType});function he(e){return new oo({type:"optional",innerType:e})}const pl=d("ZodNullable",(e,t)=>{hc.init(e,t),H.init(e,t),e.unwrap=()=>e._zod.def.innerType});function so(e){return new pl({type:"nullable",innerType:e})}const hl=d("ZodDefault",(e,t)=>{fc.init(e,t),H.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function fl(e,t){return new hl({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():yn(t)}})}const ml=d("ZodPrefault",(e,t)=>{mc.init(e,t),H.init(e,t),e.unwrap=()=>e._zod.def.innerType});function dl(e,t){return new ml({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():yn(t)}})}const io=d("ZodNonOptional",(e,t)=>{dc.init(e,t),H.init(e,t),e.unwrap=()=>e._zod.def.innerType});function gl(e,t){return new io({type:"nonoptional",innerType:e,...$(t)})}const vl=d("ZodCatch",(e,t)=>{gc.init(e,t),H.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function bl(e,t){return new vl({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const _l=d("ZodPipe",(e,t)=>{vc.init(e,t),H.init(e,t),e.in=t.in,e.out=t.out});function ao(e,t){return new _l({type:"pipe",in:e,out:t})}const yl=d("ZodReadonly",(e,t)=>{bc.init(e,t),H.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Sl(e){return new yl({type:"readonly",innerType:e})}const co=d("ZodCustom",(e,t)=>{_c.init(e,t),H.init(e,t)});function El(e,t){return uu(co,e??(()=>!0),t)}function $l(e,t={}){return lu(co,e,t)}function Al(e){return pu(e)}var E=(e=>(e.Article="article",e.AudioDocument="audiodocument",e.AudioVisualDocument="audiovisualdocument",e.Book="book",e.Bookitem="bookitem",e.Conference="conference",e.Document="document",e.Image="image",e.Issue="issue",e.Journal="journal",e.Preprint="preprint",e.Proceeding="proceeding",e.Report="report",e.Unknown="unknown",e.Webpage="webpage",e))(E||{});const Rl=pe([M("book"),M("bookitem"),M("conference"),M("document"),M("report"),M("proceeding"),M("unknown")]),wl=pe([M("article"),M("conference"),M("issue"),M("journal"),M("preprint"),M("proceeding"),M("unknown")]),fe=I({artnum:p(),atitle:p(),aufirst:p(),aulast:p(),auinit:p(),auinit1:p(),auinitm:p(),ausuffix:p(),au:U(p()),aucorp:p(),bici:p(),btitle:p(),chron:p(),coden:p(),date:p(),edition:p(),eissn:p(),epage:p(),externalDBID:p(),externalDocID:p(),genre:De(E),id:p(),isbn:p(),issn:p(),issue:p(),jtitle:p(),pages:p(),part:p(),place:p(),pub:p(),quarter:p(),rft_id:U(p()),series:p(),sici:p(),spage:p(),ssn:p(),stitle:p(),title:p(),tpages:p(),volume:p()}).partial(),Tt=I({bibid:p(),doi:p(),uri:p()}).partial(),Il=fe.pick({atitle:!0,aufirst:!0,aulast:!0,auinit:!0,auinit1:!0,auinitm:!0,ausuffix:!0,au:!0,aucorp:!0,bici:!0,btitle:!0,date:!0,edition:!0,epage:!0,id:!0,isbn:!0,issn:!0,pages:!0,place:!0,pub:!0,rft_id:!0,title:!0,tpages:!0,series:!0,spage:!0}).partial(),kl=fe.pick({artnum:!0,atitle:!0,aufirst:!0,aulast:!0,auinit:!0,auinit1:!0,auinitm:!0,ausuffix:!0,au:!0,aucorp:!0,chron:!0,coden:!0,date:!0,epage:!0,id:!0,isbn:!0,eissn:!0,issn:!0,issue:!0,title:!0,jtitle:!0,pages:!0,part:!0,pub:!0,rft_id:!0,sici:!0,spage:!0,stitle:!0,ssn:!0,quarter:!0,volume:!0}).partial(),Cl=fe.pick({au:!0,date:!0,isbn:!0,pub:!0,title:!0}).partial(),Pl=fe.pick({au:!0,date:!0,pub:!0,title:!0}).partial(),Ol=fe.pick({au:!0,date:!0,pub:!0,title:!0,spage:!0,epage:!0}).partial(),Nl=fe.pick({au:!0,date:!0,title:!0}).partial(),uo=I({...fe.shape,...Tt.shape}),Y=(e,t)=>({...t,genre:e}),j=(e,t)=>({...t,genre:e}),me=e=>({...e,genre:E.AudioVisualDocument}),lo=e=>({...e,genre:E.Image}),po=e=>({...e,genre:E.Document}),at=e=>({...e,genre:E.Webpage}),ho=e=>Object.keys(e.shape),fo=ho(fe),xt=ho(Tt),zl=(e,t,r)=>{if(r.length>0&&typeof r[0]=="string"){const n=t.startsWith("rft_")?t:`rft.${t}`;e.append(n,r[0])}},Ll=(e,t,r)=>{e.append(t,r)},Tl=(e,t,r)=>{e.append(`rft.${t}`,r)},mo=e=>xt.includes(e),go=e=>{const t=new URLSearchParams;return Object.entries(e).forEach(([r,n])=>{Array.isArray(n)?zl(t,r,n):typeof n=="string"&&n&&(mo(r)?Ll(t,r,n):Tl(t,r,n))}),t},vo=(e,t,r,n)=>{const o=t.getAll(r).filter(s=>!!s).map(s=>s.trim());return o.length===0?e:{...e,[n]:o}},bo=e=>{const t=xl(e),r=(o,s)=>{if(s==="au")return vo(o,t,"rft.au","au");if(s==="rft_id")return vo(o,t,"rft_id","rft_id");const i=mo(s)?s:`rft.${s}`,a=t.get(i);return a?{...o,[s]:a.trim()}:o},n=[...fo,...xt].reduce(r,{});return Object.keys(n).length===0?null:n},xl=e=>URL.canParse(e)?new URL(e).searchParams:new URLSearchParams(e);function ql(e){return typeof e!="string"?!1:Object.values(E).includes(e)}var _e=(e=>(e.CA="CA",e.EUAPAC="EUAPAC",e))(_e||{});const qt=I({id:p(),name:p(),region:De(_e)}),Zl=I({tenants:U(qt)}),_o=9*1024*1024,yo=I({url:Tu({error:e=>e.input===void 0?'should have the required string property "url"':'"url" must be a string'}),html:p({error:e=>e.input===void 0?'should have the required string property "html"':void 0}).max(_o,{error:`"html" should be a string with a MAX Length of ${_o}`}),tenantCode:p({error:e=>e.input===void 0?'should have the required string property "tenantCode"':void 0}).min(1,{error:'"tenantCode" must be a string'}),region:De([_e.EUAPAC,_e.CA],{error:e=>e.input===void 0?'should have the required string property "region"':'"region" must be a string of EUAPAC or CA'})});function jl(e){return yo.safeParse(e).success}const Zt=I({name:p(),region:De(_e),apps:no(p(),p())}),So=no(p(),Zt),Eo=e=>Zt.safeParse(e).success,$o=e=>So.safeParse(e).success;function Ao(e){return qt.safeParse(e).success}function Dl(e){return typeof e=="string"&&Object.keys(_e).includes(e)}const Ul=e=>{if(!$o(e))throw new Error("Error: the customer list data is invalid.");return{tenants:Object.entries(e).map(([r,n])=>Bl(r,n))}},Bl=(e,t)=>{if(!Eo(t))throw new Error(`Invalid customer: ${t}`);const{name:r,region:n}=t,o={id:e,name:r,region:n};if(!Ao(o))throw new Error(`Invalid tenant: ${JSON.stringify(o)}`);return o},jt=I({parserType:p(),parserName:p().nullable(),uri:p(),referrer:p()}),Dt=I({parserType:p(),parserName:p().nullable(),referrer:p()}),Ut=I({bookmarkingWorkflowUrl:it(),resource:it()}),Bt=I({bookmarkingWorkflowUrl:p(),resource:it()}),Vt=I({bookmarkingWorkflowUrl:it(),resource:uo}),Ft=I({z3988SearchResult:M(!0)}),Jt=I({summonSearchResult:M(!0)}),ct=pe([Bt,Ut,Vt,Ft,Jt]),Ro=I({meta:jt}).and(ct),wo=I({meta:Dt}).and(ct);function Vl(e){return{bookmarkingWorkflowUrl:e,resource:null}}function q(){return{bookmarkingWorkflowUrl:null,resource:null}}function A(e){return{bookmarkingWorkflowUrl:null,resource:e}}function Io(){return{z3988SearchResult:!0}}function ko(){return{summonSearchResult:!0}}const Fl=e=>{const t=e.getAttribute("title");return t?bo(t):null},Mt=({document:e})=>{const t=Array.from(e.querySelectorAll(".Z3988"));if(t.length===0)return q();const r=t.map(Fl).find(n=>n!==null);return r?A(r):q()},Jl=e=>{const t=Array.from(e.querySelectorAll(".author > a")).map(r=>r.textContent.trim()).filter(Boolean);return t.length?t:void 0},Ml=e=>e.querySelector("#rpi-attribute-book_details-edition > .rpi-attribute-value > span")?.textContent??void 0,Wl=e=>{const t=e.querySelector("#rpi-attribute-book_details-isbn10 > .rpi-attribute-value > span")?.textContent??void 0,r=e.querySelector("#rpi-attribute-book_details-isbn13 > .rpi-attribute-value > span")?.textContent??void 0;if(t&&r)return`${t},${r}`;if(t)return t;if(r)return r},Gl=e=>e.querySelector("#rpi-attribute-book_details-publication_date > .rpi-attribute-value > span")?.textContent??void 0,Xl=e=>e.querySelector("#rpi-attribute-book_details-publisher > .rpi-attribute-value > span")?.textContent??void 0,Hl=e=>e.querySelector("#rpi-attribute-book_details-series > .rpi-attribute-value > a")?.textContent??void 0,Yl=e=>{const t=e.querySelector("#rpi-attribute-book_details-fiona_pages > .rpi-attribute-value > span")?.textContent??void 0;return(t?/\d+/.exec(t)?.[0]:null)??void 0},Kl=({url:e,document:t})=>{const r=Jl(t),n=Ml(t),o=Wl(t),s=Gl(t),i=Xl(t),a=Hl(t),c=t.getElementById("productTitle")?.textContent.trim()??void 0,u=Yl(t);return{bookmarkingWorkflowUrl:null,resource:Y(E.Book,{au:r,date:s,edition:n,isbn:o,pub:i,series:a,title:c,tpages:u,uri:e})}},de=e=>{if(e)return e.replace(/[^0-9]/g,"")},Co=e=>Array.from(e.querySelectorAll(".author-source-list li a")).filter(t=>t.childNodes.length>0).map(t=>t.childNodes[0].textContent?.trim()).filter(t=>!!t),Po=e=>e.querySelector(".article-header")?.querySelector("h1 span")?.textContent.trim(),Oo=e=>({date:e?.textContent.match(/\d{4}/)?.[0],pub:"Elsevier Inc."}),Ql=e=>{const t=e.querySelector(".article-meta");if(!t)return{};const r=t.querySelector(".issue")?.textContent??void 0,n=t.querySelector(".title")?.textContent.trim()??void 0,[o,s]=(r?.split(",")??[]).map(i=>i.trim());return{volume:de(o),issue:de(s),jtitle:n}},ep=e=>{const t=e.querySelector(".article-header .source")?.textContent,r=t?.match(/\d{4}-\d{2}-\d{2}/)?.[0],n=t?.match(/Pages (\d+-\d+)/),[o,s]=(n?.[1].split("-")??[]).map(u=>u.trim()),{jtitle:i,volume:a,issue:c}=Ql(e);return A(j(E.Article,{au:Co(e),atitle:Po(e),spage:o,epage:s,date:r,jtitle:i,volume:a,issue:c}))},tp=e=>{const[t,r]=e.querySelectorAll(".source"),{date:n,pub:o}=Oo(r),s=e.querySelector(".browse__book-toc"),[i,a]=(s?.querySelector("h1")?.textContent.split(",")??[]).map(c=>c.trim());return A(Y(E.Book,{btitle:i,edition:a,pub:o,au:t.textContent?[t.textContent]:void 0,date:n}))},rp=e=>{const t=e.querySelector(".article-meta");if(!t)return{};const r=t.querySelector(".edition")?.textContent??void 0,n=t.querySelector(".title")?.textContent.trim()??void 0,o=t.querySelector(".copyright"),{date:s,pub:i}=Oo(o);return{edition:r,btitle:n,date:s,pub:i}},np=e=>{const{edition:t,btitle:r,date:n,pub:o}=rp(e),s=e.querySelector(".article-header .source")?.textContent,i=/(\d+-\d+|[IVXLCDM]+-[IVXLCDM]+)/i,a=s?.match(i),[c,u]=(a?.[1].split("-")??[]).map(l=>l.trim());return A(Y(E.Bookitem,{au:Co(e),atitle:Po(e),btitle:r,edition:t,pub:o,date:n,spage:c,epage:u}))},op=/^[0-9X]$/,Wt=e=>{if(!e)return;let t="";for(const r of e)op.test(r)&&(t+=r);if(t)return t},sp=(e,t)=>{const r=e.querySelector(".c-cksc-content-header__title")?.textContent.trim(),n=e.querySelector(".c-cksc-content-nice__button")?.textContent.trim(),o=e.querySelector(".c-cksc-content-nice__date")?.textContent.trim(),s=e.evaluate('//p[contains(text(), "ISBN")]',e,null,XPathResult.ANY_TYPE),i=Wt(s.iterateNext()?.textContent);return A({genre:E.Document,title:r,pub:n,date:o,uri:t,isbn:i})},No=e=>e.querySelector(".browse-toc")??e.querySelector(".browse__journal"),ip=e=>No(e)?.querySelector("h1")?.firstElementChild?.textContent.trim(),ap=e=>{const t=No(e),r=t?.querySelector("figure figcaption.source");if(r){const[a,c,u]=r.textContent.split(",").map(l=>l.trim());return{date:a,volume:de(c),issue:de(u)}}const n=t?.querySelector("p")?.textContent,[o,s]=n?.split(",")??[];return{date:t?.querySelector(".source span")?.textContent??void 0,volume:de(o),issue:de(s)}},cp=e=>{const{date:t,volume:r,issue:n}=ap(e);return A(j(E.Journal,{jtitle:ip(e),date:t,volume:r,issue:n}))};var zo=(e=>(e.Book="Book",e.Chapter="Book Chapter",e.Article="Full Text Article",e.Journal="Journal",e.Guideline="Guideline",e))(zo||{});const up=e=>Object.values(zo).includes(e),lp=(e,t)=>{const r=e.querySelector(".content-type")??e.querySelector(".c-cksc-content-header__content-type");if(!r)return t.includes("journal")?"Journal":void 0;const n=r.textContent;if(n&&up(n))return n},pp=({url:e,document:t})=>{switch(lp(t,e)){case"Book":return tp(t);case"Book Chapter":return np(t);case"Full Text Article":return ep(t);case"Journal":return cp(t);case"Guideline":return sp(t,e);case void 0:return q()}},we=I({"@context":p()}),hp=e=>we.safeParse(e).success,Lo='script[type="application/ld+json"]',To=e=>Array.from(e.querySelectorAll(Lo)),ut=e=>e.querySelector(Lo),Ue=e=>{const t=e.textContent;if(!t)return null;try{const r=JSON.parse(t);if(hp(r))return r}catch{return null}return null},fp=I({"@id":p(),"@type":p(),author:I({"@id":p()}).optional(),datePublished:p().optional(),dateModified:p().optional(),description:p().optional(),inLanguage:p().optional(),isPartOf:I({"@id":p()}).optional(),name:p().optional(),url:p().optional()}),mp=we.extend({"@graph":U(fp)}),dp=e=>mp.safeParse(e).success,gp=e=>{const t=To(e);if(t.length===0)return null;const r=t.map(Ue).filter(dp).map(n=>n["@graph"]);return r.length!==1?null:r[0]},vp=(e,t)=>e.find(r=>r["@type"]===t)??null,bp=(e,t)=>e.find(r=>r["@id"]===t)??null,_p=e=>{const t=vp(e,"WebPage");if(!t)return null;const r=t.author?bp(e,t.author["@id"]):void 0;return at({au:r?.name?[r.name]:void 0,date:t.datePublished,title:t.name})},yp=({document:e})=>{const t=gp(e);return t?{bookmarkingWorkflowUrl:null,resource:_p(t)}:q()},xo=()=>q(),h=(e,t,r)=>{const n=re(e,t,r);return n.length>0?n[0]:void 0},re=(e,t,r)=>Array.from(e.querySelectorAll(`meta[${t}='${r}']`)).map(n=>n.getAttribute("content")).filter(n=>!!n?.trim()),qo=e=>{const t=new Map,r=e.split(";").filter(n=>!!n);for(const n of r){const[o,s,i]=n.split(":");t.set(o,{type:s,value:i})}return t},Sp=e=>{const{pathname:t}=new URL(e);return t.startsWith("/toc/")?"journal":t.startsWith("/article/")?"article":void 0},Ep=e=>{const t=e.querySelector("header h1 span")?.firstChild?.textContent?.trim(),r=e.querySelector("header p span")?.textContent.trim(),n=/\d{4}-\d{3}[\dX]/g,o=r?.match(n)??[],[s,i]=[o[0],o[1]],a=e.evaluate('//dt[contains(text(), "Publisher")]/following-sibling::dd/a',e,null,XPathResult.STRING_TYPE).stringValue.trim();return A(j(E.Journal,{pub:a,jtitle:t,issn:s,eissn:i}))},$p=e=>{let t,r;const n=re(e,"name","citation_issn");return n.length===2?(t=n[1],r=n[0]):t=n[0],{eissn:t,issn:r}},Ap=e=>{const t=h(e,"name","citation_journal_title"),r=h(e,"name","citation_title"),n=re(e,"name","citation_author"),o=h(e,"name","citation_doi"),{eissn:s,issn:i}=$p(e),a=h(e,"name","citation_publisher"),c=h(e,"name","citation_publication_date"),u=h(e,"name","citation_volume"),l=h(e,"name","citation_issue"),f=h(e,"name","citation_firstpage"),m=h(e,"name","citation_lastpage");return A(j(E.Article,{jtitle:t,atitle:r,au:n,doi:o,eissn:s,issn:i,pub:a,date:c,volume:u,issue:l,spage:f,epage:m}))},Rp=({document:e,url:t})=>{switch(Sp(t)){case"journal":return Ep(e);case"article":return Ap(e);case void 0:return q()}};var S=(e=>(e[e.None=0]="None",e[e.Book=1]="Book",e[e.Chapter=2]="Chapter",e[e.Journal=3]="Journal",e[e.Article=4]="Article",e[e.AudioVisual=5]="AudioVisual",e[e.Webpage=6]="Webpage",e))(S||{});const wp=e=>{const t=h(e,"name","pbContext");if(!t)return S.None;const r=qo(t);switch(r.has("page")?r.get("page")?.value:null){case"Article/Chapter View":return S.Article;case"Table of Contents":return S.Journal;default:return S.None}},Ip=e=>{const t=e.querySelector('meta[property="article:author"]')?.getAttribute("content")?.split(",").map(r=>r.trim());return t&&t.length>0?t:void 0},Zo=e=>{const t=new Map,r=Array.from(e.querySelectorAll(".rlist>li>span")).map(s=>s.textContent.trim()).join(""),n=/^ISSN:\s(\d{4}-\d{3}(?:\d|X))/.exec(r);n&&t.set("issn",n[1]);const o=/Online ISSN:\s(\d{4}-\d{3}(?:\d|X))/.exec(r);return o&&t.set("eissn",o[1]),t},kp=e=>e.querySelector('span[property="isPartOf"][typeof="PublicationVolume"] > span[property="volumeNumber"]')?.textContent??void 0,Cp=e=>e.querySelector('span[property="isPartOf"][typeof="PublicationIssue"] > span[property="issueNumber"]')?.textContent??void 0,Pp=e=>e.querySelector('meta[name="dc.Identifier"][scheme="doi"]')?.getAttribute("content")??void 0,Op=e=>e.querySelector("h1")?.textContent??void 0,Np=e=>{const t=new Map,r=e.querySelector("h2.heading-m")?.textContent,n=r?.match(/Issue\s+(\d+(?:-\d+)?)/);n&&t.set("issue",n[1]);const o=r?.match(/Volume\s+(\d+)/);o&&t.set("volume",o[1]);const s=r?.match(/(\d{4})$/);return s&&t.set("date",s[1]),t},zp=e=>{const t=Ip(e.document),r=h(e.document,"name","dc.Date"),n=Pp(e.document),o=Zo(e.document),s=o.get("issn"),i=o.get("eissn"),a=Cp(e.document),c=h(e.document,"name","citation_journal_title"),u=h(e.document,"name","dc.Publisher"),l=h(e.document,"name","dc.Title"),f=kp(e.document);return j(E.Article,{au:t,date:r,eissn:i,issn:s,issue:a,jtitle:c,pub:u,title:l,volume:f,doi:n})},Lp=e=>{const t=Zo(e.document),r=t.get("issn"),n=t.get("eissn"),o=Op(e.document),s=Np(e.document),i=s.get("issue"),a=s.get("volume"),c=s.get("date");return j(E.Journal,{eissn:n,issn:r,jtitle:o,title:o,issue:i,volume:a,date:c})},Tp=e=>{switch(wp(e.document)){case S.Article:return A(zp(e));case S.Journal:return A(Lp(e));default:return q()}},xp=e=>{const t=h(e,"name","citation_type"),r=h(e,"name","citation_article_type");return t==="JOUR"&&r?S.Article:t==="CHP"?S.Chapter:e.querySelector(".book-edition-year")?.textContent.includes("Book")?S.Book:e.getElementById("journal-title")?S.Journal:S.None},Gt=e=>h(e,"name","citation_doi")??h(e,"name","dc.identifier")??e.querySelector(".doi .anchor-text")?.textContent??void 0,qp=e=>{const t=Array.from(e.querySelectorAll(".kf-details .kf-detail-item:has(h3)")),r=new Map;for(const n of t){const o=n.querySelector("h3")?.textContent,s=n.querySelector("p")?.textContent;o&&s&&r.set(o,s)}return r},Xt=(e,t)=>{const r=Array.from(e.querySelectorAll(t)).map(n=>n.textContent).filter(n=>!!n);return r.length>0?r:void 0},Zp=e=>{const t=e.querySelector(".js-issn")?.textContent;if(t)return t.replace("Online ISSN: ","")},jp=e=>{const t=e.get("DOI");if(t)return URL.canParse(t)?new URL(t).pathname.substring(1):t},Dp=e=>{const t=qp(e),r=h(e,"property","og:title"),n=h(e,"property","og:book:isbn"),o=t.get("Published"),s=Xt(e,".authors-container .author-detail h3"),i=Gt(e)??jp(t);return Y(E.Book,{au:s,date:o,doi:i,isbn:n,title:r})},Up=e=>{const t=h(e,"property","og:title"),r=h(e,"property","og:book:isbn"),n=h(e,"name","citation_publication_date"),o=Xt(e,".author-group .button-link-text"),s=h(e,"name","citation_firstpage"),i=h(e,"name","citation_lastpage"),a=h(e,"name","citation_publisher"),c=Gt(e),u=h(e,"name","citation_inbook_title")??e.querySelector(".publication-title")?.textContent??void 0;return Y(E.Bookitem,{au:o,btitle:u,date:n,doi:c,epage:i,isbn:r,pub:a,spage:s,title:t})},Bp=e=>{const t=h(e,"property","og:title"),r=h(e,"name","citation_issn"),n=h(e,"name","citation_publication_date"),o=Xt(e,".author-group .button-link-text"),s=h(e,"name","citation_publisher"),i=h(e,"name","citation_firstpage"),a=h(e,"name","citation_issue"),c=h(e,"name","citation_volume"),u=Gt(e),l=h(e,"name","citation_journal_title")??e.querySelector(".publication-title")?.textContent??void 0;return j(E.Article,{au:o,jtitle:l,date:n,doi:u,issn:r,issue:a,pub:s,spage:i,title:t,volume:c})},Vp=e=>{const t=e.getElementById("journal-title")?.textContent??void 0,r=Zp(e);return j(E.Journal,{issn:r,title:t})},Fp=({document:e})=>{switch(xp(e)){case S.Book:return A(Dp(e));case S.Chapter:return A(Up(e));case S.Article:return A(Bp(e));case S.Journal:return A(Vp(e));default:return q()}},Jp=e=>{const t=h(e,"name","pbContext");return t&&qo(t).has("article")?S.Article:S.Journal},Mp=e=>{const t=e.querySelector(".itemPageRangeHistory");if(!t)return;const n=Array.from(t.childNodes).find(o=>o.textContent?.trim().startsWith("Page"));if(n)return n.textContent?.replace(/Pages?/,"").trim()??void 0},Wp=e=>{const t=e.querySelector(".issue-heading")?.textContent;return t?t.split(",")[0]?.replace("Volume","").trim():void 0},Gp=e=>{const t=e.querySelector(".issue-heading .nav-toc-list")?.textContent;return t?t.replace("Issue","").trim():void 0},Xp=e=>{const t=h(e,"property","og:title"),r=h(e,"name","dc.Publisher"),n=h(e,"name","dc.Date"),o=h(e,"name","publication_doi"),s=h(e,"name","citation_journal_title"),i=re(e,"name","dc.Creator"),a=Wp(e),c=Gp(e),u=Mp(e),l=u?.includes("-")?u.split("-")[0]:u,f=u?.includes("-")?u.split("-")[1]:u;return j(E.Article,{au:i,jtitle:s,date:n,doi:o,issue:c,pub:r,spage:l,epage:f,title:t,volume:a})},Hp=e=>{const t=h(e,"property","og:title"),r=h(e,"name","publication_doi");return j(E.Journal,{doi:r,title:t})},Yp=({document:e})=>{switch(Jp(e)){case S.Article:return A(Xp(e));case S.Journal:return A(Hp(e));default:return q()}},Kp=e=>ct.safeParse(e).success,Qp=e=>Ro.safeParse(e).success,eh=e=>wo.safeParse(e).success,th=e=>jt.safeParse(e).success,rh=e=>Dt.safeParse(e).success;function nh(e){return Bt.safeParse(e).success}function lt(e){return Vt.safeParse(e).success}function jo(e){return Ft.safeParse(e).success}function Do(e){return Jt.safeParse(e).success}function oh(e){return Ut.safeParse(e).success}const sh=e=>Array.from(e.querySelectorAll("tr th")).find(n=>n.textContent.trim()==="DOI:")?.nextElementSibling?.querySelector('span[property="identifier"]')?.textContent??void 0,ih=e=>{const t=/Record\/(\d+)/.exec(e);if(t&&t.length>1)return t[1]},ah=e=>{const{url:t,document:r}=e,n=Mt(e);if(!lt(n))return n;const o=sh(r);return o&&(n.resource.rft_id=[`info:doi/${o}`]),n.resource.bibid=ih(t),n},ch=we.extend({"@type":M("VideoObject"),name:p(),author:p(),genre:p(),description:p(),uploadDate:p(),duration:p(),thumbnailUrl:U(p())}),uh=e=>ch.safeParse(e).success,lh=e=>{const t=To(e);if(t.length===0)return null;const r=t.map(Ue).filter(uh);return r.length!==1?null:r[0]},ph=({url:e,document:t})=>{const r=lh(t);return r?{bookmarkingWorkflowUrl:null,resource:me({au:[r.author],date:r.uploadDate,title:r.name,uri:e})}:q()},Uo=e=>h(e,"name","doi")??h(e,"name","DOI")??h(e,"name","citation_doi")??h(e,"name","dc.identifier")??h(e,"name","prism.doi")??void 0,Bo=e=>{const t=e.editor?.map(o=>o.name)??[],n=[...e.author?.map(o=>o.name)??[],...t];if(n.length!==0)return n};var Be=(e=>(e.Book="Book",e.Journal="Journal",e.Periodical="Periodical",e.PublicationVolume="PublicationVolume",e.ScholarlyArticle="ScholarlyArticle",e.VideoObject="VideoObject",e.WebPage="WebPage",e))(Be||{}),ye=(e=>(e.Article="article",e.Book="book",e.Paper="Paper",e.Video="video.other",e.Website="website",e))(ye||{}),ce=(e=>(e.Article="/article/",e.Book="/book/",e.Chapter="/chapter/",e.Video="/video/",e.ReferenceWorkEntry="/referenceworkentry/",e.ReferenceWork="/referencework/",e.Protocol="/protocol/",e.Collections="/collections/",e.Journal="/journal/",e.JournalIssue="/volumes-and-issues/",e))(ce||{});const Vo=I({"@type":M(Be.ScholarlyArticle),author:U(I({"@type":p(),name:p()})).optional(),editor:U(I({"@type":p(),name:p()})).optional(),datePublished:p().optional(),headline:p().optional(),issn:U(p()).optional(),pageStart:p().optional(),pageEnd:p().optional(),isPartOf:I({"@type":pe([p(),U(p())]),name:p(),issn:U(p()).optional(),volumeNumber:p().optional(),isbn:U(p()).optional()}),publisher:I({"@type":p(),name:p()}).optional()}),Fo=e=>Vo.safeParse(e).success,hh=we.extend({"@type":M(Be.WebPage),mainEntity:Vo}),fh=e=>hh.safeParse(e).success,mh=I({"@type":U(p()),name:p().optional(),issn:U(p()),volumeNumber:p().optional()}),Jo=e=>mh.safeParse(e).success,dh=(e,t)=>h(e,"name","citation_issn")??h(e,"name","prism.issn")??(Fo(t.isPartOf)?t.isPartOf.issn?.[0]:void 0),Mo=(e,t)=>{const r=Bo(t),n=h(e,"name","citation_online_date"),o=Uo(e),s=h(e,"name","citation_issue"),i=dh(e,t),a=Jo(t.isPartOf)&&t.isPartOf.issn.length>0?t.isPartOf.issn[1]:void 0,c=t.pageStart,u=t.pageEnd,l=t.headline,f=t.isPartOf.name,m=Jo(t.isPartOf)?t.isPartOf.volumeNumber:void 0;return j(E.Article,{au:r,date:n,doi:o,issue:s,eissn:i,issn:a,spage:c,epage:u,atitle:l,jtitle:f,volume:m})},gh=we.extend({"@type":M(Be.Book),copyrightYear:p().optional(),author:U(I({"@type":p(),name:p()})).optional(),editor:U(I({"@type":p(),name:p()})).optional(),isbn:p().optional(),name:p().optional(),numberOfPages:eo().optional(),publisher:I({"@type":p(),name:p()}).optional()}),vh=e=>gh.safeParse(e).success,bh=e=>{const t=e.querySelectorAll(".c-bibliographic-information__list-item"),r=new Map;return t.forEach(n=>{const o=n.querySelector(".u-text-bold")?.textContent.trim(),s=n.querySelector(".c-bibliographic-information__value")?.textContent.trim();o&&s&&r.set(o,s)}),r},_h=(e,t)=>{const r=bh(e),n=Bo(t),o=t.copyrightYear?.toString(),s=Uo(e)??r.get("DOI"),i=t.name??r.get("Book Title"),a=t.isbn??r.get("Softcover ISBN"),c=t.numberOfPages?.toString()??r.get("Number of Pages"),u=t.publisher?.name??r.get("Publisher");return Y(E.Book,{au:n,date:o,doi:s,title:i,isbn:a,tpages:c,pub:u})},yh=I({"@type":M("Periodical"),name:p(),url:p(),issn:U(p()),editor:U(I({givenName:p(),familyName:p()})),publisher:I({name:p()}),description:p()}),Sh=e=>yh.safeParse(e).success,Eh=e=>{const t=e.editor.map(({givenName:i,familyName:a})=>`${i} ${a}`),r=e.name,[n,o]=e.issn,s=e.publisher.name;return j(E.Journal,{au:t,jtitle:r,eissn:n,issn:o,pub:s})},$h=I({"@type":M(Be.VideoObject),name:p().optional(),description:p().optional(),thumbnailUrl:p().optional(),uploadDate:p().optional(),contentUrl:p().optional(),duration:p().optional()}),Ah=e=>$h.safeParse(e).success,Rh=(e,t)=>{const r=Array.from(e.querySelectorAll('dd[data-test="video-segment-author"]')).map(i=>i.textContent.trim()).filter(i=>!!i),n=t?.uploadDate?new Date(t.uploadDate).getFullYear().toString():void 0,o=t?.name??h(e,"property","og:title")??void 0,s=e.querySelector("video-about-doi")?.textContent??void 0;return me({au:r.length>0?r:void 0,date:n,doi:s,title:o})},wh=e=>{const t=h(e,"property","og:title");return at({title:t})},Ih=(e,t)=>{const r=h(t,"property","og:type");return r===ye.Article&&e.includes(ce.Article)?S.Article:r===ye.Book&&(e.includes(ce.Book)||e.includes(ce.ReferenceWork))?S.Book:r===ye.Paper&&e.includes(ce.Chapter)?S.Chapter:r===ye.Paper&&(e.includes(ce.ReferenceWorkEntry)||e.includes(ce.Protocol))?S.Article:r===ye.Video&&e.includes(ce.Video)?S.AudioVisual:r===ye.Website&&(e.includes(ce.Collections)||e.includes(ce.JournalIssue))?S.Webpage:r===ye.Website&&e.includes(ce.Journal)?S.Journal:S.None},kh=(e,t,r)=>e===S.AudioVisual&&Ah(r)?A(Rh(t,r)):e===S.Book&&vh(r)?A(_h(t,r)):(e===S.Chapter||e===S.Article)&&Fo(r)?A(Mo(t,r)):e===S.Article&&fh(r)?A(Mo(t,r.mainEntity)):e===S.Journal&&Sh(r)?A(Eh(r)):q(),Ch=({url:e,document:t})=>{const r=Ih(e,t);if(r===S.Webpage)return A(wh(t));const n=ut(t);if(!n)return q();const o=Ue(n);return o?kh(r,t,o):q()},Ph=new Set(["Print ISBN","Online ISBN","DOI","First published","Online ISSN","Print ISSN"]),Oh=I({content:I({item:I({title:p(),"published-date":p()}),group:I({volume:p(),issue:p()}),series:I({title:p(),type:p(),eissn:p()})}).optional()}),Wo=(e,t)=>{if(!e)return;const r=e.indexOf(t);return r>-1?e.substring(0,r):e},Ht=e=>{const r=/\d+/.exec(e);if(r?.[0])return r[0]},Nh=e=>{const t=e.querySelectorAll("script"),n=Array.from(t).find(o=>o.textContent.includes("adobeDataLayerJson"))?.textContent.match(/var adobeDataLayerJson = (\{.*?});/s);if(!(!n||n.length!==2))try{const o=JSON.parse(n[1]);return Oh.parse(o)}catch{return}},zh=(e,t)=>{const r=h(e,"property","og:type"),n=t.includes("epdf");return r==="Book"||r==="books.book"?S.Book:r==="Chapter"?S.Chapter:r==="Journal"?S.Journal:r==="Article"||n?S.Article:S.None},pt=e=>{const t=re(e,"name","citation_author"),r=Array.from(e.querySelectorAll("#product-details-content .product-authors")).map(o=>o.textContent).filter(o=>!!o),n=new Set([...t,...r]);return n.size>0?[...n]:void 0},Lh=e=>{const t=Array.from(e.querySelectorAll("#product-details-content .text-piped p")).map(r=>r.textContent).find(r=>r.endsWith(" pages"));if(t)return Ht(t)},ht=e=>{const t=new Map,r=Array.from(e.querySelectorAll(".journal-info-container .info-block")).flatMap(n=>Array.from(n.querySelectorAll(".info_label")));for(const n of r){const o=n.nextElementSibling;if(!o?.classList.contains("info_value"))continue;const s=Wo(n.textContent,":"),i=Wo(o.textContent,":");!s||!i||Ph.has(s)&&t.set(s,i)}return t},ft=(e,t)=>h(e,"property","books:release_date")??h(e,"name","citation_online_date")??t.get("First published")??void 0,Yt=(e,t)=>h(e,"name","dc.identifier")??h(e,"name","citation_doi")??h(e,"name","publication_doi")??t.get("DOI")??void 0,Go=(e,t)=>{const r=new Set([h(e,"property","books:isbn"),t.get("Print ISBN"),t.get("Online ISBN")].filter(n=>!!n));return r.size>0?[...r].join(","):void 0},Th=e=>{let t,r;const n=e.querySelector(".cover-image__details div:first-of-type");if(n&&n.childNodes.length===2){const[o,s]=n.childNodes;o.textContent&&(t=Ht(o.textContent)),s.textContent&&(r=Ht(s.textContent))}return{volume:t,issue:r}},xh=e=>{const r=Array.from(e.querySelectorAll(".authors .author")).map(n=>n.textContent.trim().replace(",","")).filter(n=>!!n);return r.length>0?r:void 0},qh=e=>{const t=Array.from(e.querySelectorAll(".details-section .details-entry")),r=t.find(i=>i.querySelector(".details-label")?.textContent.trim()==="ISSN"),n=t.find(i=>i.querySelector(".details-label")?.textContent.trim()==="eISSN");let o,s;return r&&(o=r.querySelector(".details-value")?.textContent.trim()),n&&(s=n.querySelector(".details-value")?.textContent.trim()),{issn:o,eissn:s}},Zh=e=>{if(!e?.content?.group)return{volume:void 0,issue:void 0};const t=e.content.group.volume,r=e.content.group.issue;return r==="0"&&t==="0"?{volume:void 0,issue:void 0}:{volume:t,issue:r}},jh=e=>{const n=Array.from(e.querySelectorAll(".details-section .details-entry")).find(i=>i.querySelector(".details-label")?.textContent.trim()==="Pages")?.querySelector(".details-value")?.textContent.trim(),[o,s]=(n?.split("-")??[void 0,void 0]).map(i=>i?.trim());return o?.toLowerCase()==="n/a"&&s?.toLowerCase()==="n/a"?{spage:void 0,epage:void 0}:{spage:o,epage:s}},Dh=e=>{const t=ht(e),r=pt(e),n=h(e,"property","og:title"),o=ft(e,t),s=Yt(e,t),i=Go(e,t),a=Lh(e);return Y(E.Book,{au:r,date:o,doi:s,isbn:i,pages:a,title:n})},Uh=e=>{const t=ht(e),r=pt(e),n=h(e,"name","citation_book_title"),o=ft(e,t),s=Yt(e,t),i=Go(e,t),a=h(e,"name","citation_publisher"),c=h(e,"property","og:title");return Y(E.Bookitem,{au:r,btitle:n,date:o,doi:s,isbn:i,pub:a,title:c})},Bh=e=>{const t=ht(e),r=pt(e),n=ft(e,t),o=t.get("Online ISSN"),s=t.get("Print ISSN"),i=h(e,"property","og:title"),{volume:a,issue:c}=Th(e);return j(E.Journal,{au:r,date:n,eissn:o,issn:s,issue:c,title:i,volume:a})},Vh=e=>{const t=ht(e),r=Nh(e),n=pt(e)??xh(e),o=ft(e,t)??r?.content?.item["published-date"],s=Yt(e,t),{issn:i,eissn:a}=qh(e),{volume:c,issue:u}=Zh(r),l=h(e,"property","og:title")??r?.content?.item.title,f=h(e,"name","citation_journal_title")??r?.content?.series.title,{spage:m,epage:g}=jh(e);return j(E.Article,{au:n,date:o,doi:s,eissn:a,issn:i??h(e,"name","citation_issn"),issue:u,jtitle:f,title:l,volume:c,spage:m,epage:g})},Fh=({document:e,url:t})=>{switch(zh(e,t)){case S.Book:return A(Dh(e));case S.Chapter:return A(Uh(e));case S.Journal:return A(Bh(e));case S.Article:return A(Vh(e));default:return q()}},Jh=e=>{const t=re(e,"name","citation_author");return t.length>0?t:void 0},Mh=({document:e})=>{const t=Jh(e),r=h(e,"name","citation_publication_date"),n=h(e,"name","citation_doi"),o=h(e,"name","citation_isbn"),s=h(e,"name","citation_publisher"),i=h(e,"name","citation_title")??e.title,a=me({au:t,date:r,doi:n,isbn:o,pub:s,title:i});return A(a)},Wh=({document:e})=>Array.from(e.querySelectorAll(".Z3988")).length<=1?q():Io(),Kt=e=>{if(!(!e||e.length===0))return e[0]};function Qt(e,t){const r=t.map(n=>{const o=e.querySelector(n)?.textContent??null;if(o&&o.trim()!=="")return o}).filter(n=>n);return Kt(r)??null}const Ve=(e,t)=>Qt(e,[t])?.trim(),Gh=e=>{const t=e.querySelector(".content-meta-data__authors")?.textContent;if(t)return t.split(/,\s+|\s+and\s+/).filter(r=>!!r)},Xh=e=>{const t=Array.from(e.querySelectorAll('.tombstone-metadata [data-qa="item-authors"]')).map(r=>r.textContent).filter(r=>!!r);return t.length?t:void 0},Hh=e=>{const t=Array.from(e.querySelectorAll('.item-authors [data-qa="item-contributors"], .item-authors [data-qa="item-creators"]')).map(r=>r.textContent).filter(r=>!!r);return t.length?t:void 0},Yh=e=>{const t=Array.from(e.querySelectorAll(".contrib-type-author .name")).map(r=>r.textContent).filter(r=>!!r);return t.length?t:void 0},Ie=e=>{const t=new Set([...Hh(e)??[],...Gh(e)??[],...Yh(e)??[],...Xh(e)??[]]);return t.size?[...t]:void 0},ke=(e,t)=>e.querySelector('[data-qa="published-date"]')?.textContent??e.querySelector(".summary-image")?.textContent??Te(t?.get("date"))??Te(t?.get("copyright date"))??Te(t?.get("published date")),Xo=e=>{const t=e.find(r=>r.startsWith("https://doi.org/"));if(t)return t.replace("https://doi.org/","")},Ho=e=>{const t=e.get("local identifier");if(t?.length)return Xo(t)},Kh=e=>e.querySelector(".doi")?.getAttribute("href")??void 0,Te=e=>{if(e?.length)return e[0]},Ce=e=>{const t=new Map;return Array.from(e.querySelectorAll(".metadata-element, .metadata")).map(r=>{const o=r.querySelector(".metadata-label")?.textContent.trim().toLowerCase(),s=Array.from(r.querySelectorAll(".metadata-value")).map(i=>i.textContent).filter(i=>!!i);return{name:o,values:s}}).forEach(({name:r,values:n})=>{!r||!n.length||t.set(r,n)}),t},Yo=e=>{const t=Ce(e),r=e.querySelector(".summary-journal"),n=Array.from(r?.childNodes??[]),o=n[0]?.textContent??e.querySelector(".journal-link")?.textContent??void 0,s=n[2]?.textContent?.replace(/Published By:\s+?/i,"")??Te(t.get("publisher"))??e.querySelector(".publisher-link")?.textContent??void 0;return{pub:s&&s.trim()!==""?s:void 0,jtitle:o&&o.trim()!==""?o:void 0}},Qh=e=>{const t=Qt(e,['[data-qa="journal"]:first-child cite','[data-qa="copyright-statement"] > cite','[data-qa="collection-links"] mfe-content-details-pharos-link']);return t&&t.trim()!==""?t:void 0},mt=e=>de(e.querySelector('[data-qa="page-count"]')?.textContent),Fe=(e,t)=>e.querySelector(".publisher-link")?.textContent??Te(t?.get("publisher")),Se=e=>e.querySelector('[data-qa="item-title"]')?.textContent.trim()??e.querySelector("mfe-turnaway-pharos-heading")?.textContent.trim()??e.querySelector(".metadata mfe-toc-pharos-heading")?.textContent.trim()??e.querySelector(".journal_header-title")?.textContent.trim()??void 0,Ee=e=>{if(!URL.canParse(e))return;const t=new URL(e);return t.origin+t.pathname},ef=e=>{const t=e.querySelector(".ccda-container > :first-child");let r,n;if(t?.textContent.includes("Volume")||t?.textContent.includes("Issue")){const o=t.textContent.trim().split(/,\s+/);for(const s of o)s.startsWith("Volume")?n=de(s):s.startsWith("Issue")&&(r=de(s))}return{issue:r,volume:n}},tf=e=>{const t=e.querySelector('[data-qa="item-src-info"]')?.textContent??h(e,"property","og:description")??h(e,"name","description");if(!t)return{};const r=/Vol\.\s*(\d+)/.exec(t),n=r?r[1]:void 0,o=/No\.\s*(\d+)/.exec(t),s=o?o[1]:void 0,i=/pp\.\s*(\d+)-(\d+)/.exec(t),a=i?i[1]:void 0,c=i?i[2]:void 0,u=/pp\.\s*\d+-\d+\s*\((\d+)\s*pages\)/.exec(t),l=u?u[1]:void 0;return{issue:s,volume:n,spage:a,epage:c,pages:l}},rf=e=>{const t=Qt(e,["mfe-turnaway-pharos-link",'[data-qa="item-src-info"]']);if(!t)return;const n=/\(.+\)/.exec(t)?.map(o=>{const s=/\d{4}/.exec(o);return s?s[0]:void 0});return Kt(n)},nf=(e,t)=>{const r=Se(e),n=Ie(e),o=ke(e)??rf(e),s=Yo(e),i=s.jtitle??Qh(e)??void 0,a=s.pub,c=ef(e),u=tf(e),l=c.issue??u.issue,f=c.volume??u.volume,m=mt(e)??u.pages,g=u.spage,P=u.epage,b=Ee(t),O=Xo(Array.from(e.querySelector(".content-meta-data-stables")?.childNodes??[]).map(Z=>Z.textContent??""))??Kh(e);return j(E.Article,{atitle:r,au:n,date:o,doi:O,epage:P,issue:l,jtitle:i,pages:m,pub:a,spage:g,uri:b,volume:f})},of=(e,t)=>{const r=Ce(e),n=Ie(e),o=ke(e,r),s=Se(e),i=Fe(e,r),a=Ee(t);return me({au:n,date:o,pub:i,title:s,uri:a})},sf=(e,t)=>{const r=Ce(e),n=Ie(e),o=Se(e),s=ke(e),i=mt(e),a=Fe(e,r),c=Ee(t),u=Ho(r);return Y(E.Book,{au:n,date:s,doi:u,pages:i,pub:a,title:o,uri:c})},af=(e,t)=>{const r=Ce(e),n=Ie(e),o=Se(e),s=e.querySelector(".book-title-link")?.textContent??void 0,i=ke(e,r),a=Array.from(e.querySelectorAll('[data-qa="book"] > span')).map(m=>m.textContent),c=mt(e),u=a.find(m=>m.includes("pp."))?.match(/(\d+)-(\d+)/)??void 0,l=Fe(e,r),f=Ee(t);return Y(E.Bookitem,{atitle:o,au:n,btitle:s,date:i,epage:u?.[2],pub:l,pages:c,spage:u?.[1],uri:f})},cf=(e,t)=>{const r=Ce(e),n=Ie(e),o=Se(e),s=ke(e),i=mt(e),a=Fe(e,r),c=Ee(t),u=Ho(r);return Y(E.Document,{au:n,date:s,doi:u,pages:i,pub:a,title:o,uri:c})},uf=(e,t)=>{const r=Ce(e),n=Ie(e),o=ke(e,r),s=Se(e),i=Ee(t);return lo({au:n,date:o,title:s,uri:i})},lf=(e,t)=>{const{pub:r}=Yo(e),n=Se(e),o=e.querySelector(".eissn")?.textContent.replace(/EISSN\s+/,"").trim()??void 0,s=e.querySelector(".issn")?.textContent.replace(/ISSN\s+/,"").trim()??void 0,i=Ee(t);return j(E.Journal,{eissn:o,issn:s,jtitle:n,pub:r,uri:i})};var ie=(e=>(e.Article="journal article",e.Audio="audio",e.Book="book",e.Chapter="book chapter",e.Document="document",e.Image="image",e.Journal="journal",e.ResearchReport="research report",e.Serial="serial",e.Video="video",e))(ie||{});const pf=(e,t)=>{const r=Ce(e),n=Ie(e),o=ke(e,r),s=Se(e),i=Fe(e,r),a=Ee(t);return me({au:n,date:o,pub:i,title:s,uri:a})},hf=e=>Object.values(ie).includes(e),ff=e=>{if(e.querySelector(".journal_header-title"))return ie.Journal;if(e.querySelector(".journal-link"))return ie.Article;const n=e.querySelector(".content-type > span")?.textContent.toLowerCase().trim()??e.querySelector(".content-meta-data-label")?.textContent.toLowerCase().trim();return hf(n)?n:null},mf=(e,t)=>{switch(ff(e)){case ie.Article:case ie.Serial:return nf(e,t);case ie.Audio:return of(e,t);case ie.Book:return sf(e,t);case ie.Chapter:case ie.ResearchReport:return af(e,t);case ie.Document:return cf(e,t);case ie.Image:return uf(e,t);case ie.Journal:return lf(e,t);case ie.Video:return pf(e,t);default:return null}},df=({document:e,url:t})=>{const r=mf(e,t);return r?A(r):q()},Je=e=>{if(e){if(typeof e=="string")return e;if(e.length>0)return e[0]}else return},Ko=e=>{if(e)return typeof e=="string"?e:Array.isArray(e)?e.length===0?void 0:Je(e[0].name):Je(e.name)},dt=(...e)=>{const t=new Set(e.filter(r=>!!r));if(t.size!==0)return[...t]},gf=e=>{const t=Ko(e.mainEntity.creator);return t?[t]:void 0},Me=({lcn:e,title:t})=>({bibid:e,title:t}),vf=(e,t)=>{const r=dt(...(e&&gf(e))??[],...t.authors??[]),n=dt(...t.eissns??[]),o=dt(e?.mainEntity.isbn?Wt(e.mainEntity.isbn):void 0,...t.isbns??[]),s=dt(...e?.mainEntity.issn??[],...t.issns??[]),[i,a]=e?.mainEntity.pagination?.split("-")??[];return{authors:r,date:t.date,doi:Je(t.dois),edition:e?.mainEntity.edition??t.edition,epage:a,eissn:Je(n),lcn:t.lcn??e?.identifier.value,isbn:o?.join(","),issn:Je(s),issue:e?.mainEntity.issueNumber,jtitle:t.jtitle,publisher:t.publisher??Ko(e?.mainEntity.publisher),spage:i,title:e?.name??t.title,volume:e?.mainEntity.volumeNumber}},bf=e=>j(E.Article,{...Me(e),au:e.authors,doi:e.doi,eissn:e.eissn,epage:e.epage,issn:e.issn,issue:e.issue,jtitle:e.jtitle,pub:e.publisher,spage:e.spage,volume:e.volume}),_f=e=>me({...Me(e),au:e.authors,date:e.date,pub:e.publisher}),yf=e=>Y(E.Book,{...Me(e),au:e.authors,date:e.date,doi:e.doi,edition:e.edition,epage:e.epage,isbn:e.isbn,pub:e.publisher,spage:e.spage}),Sf=e=>j(E.Journal,{...Me(e),date:e.date,doi:e.doi,eissn:e.eissn,issn:e.issn,pub:e.publisher}),Qo=I({"@type":M("Organization"),name:pe([p(),U(p())])}),es=I({"@type":M("Person"),name:pe([p(),U(p())])}),Ef=we.extend({identifier:I({"@type":p(),propertyID:p(),value:p()}),mainEntity:I({"@type":p(),"@id":p(),creator:he(pe([p(),es,U(es)])),edition:he(p()),isbn:he(p()),issn:he(U(p())),issueNumber:he(p()),pagination:he(p()),publisher:he(pe([p(),Qo,U(Qo)])),volumeNumber:he(p())}),name:p()}),$f=e=>{const t=ut(e);if(!t)return null;const r=Ue(t),n=Ef.safeParse(r);return n.success?n.data:null},Af=e=>me({...Me(e),au:e.authors,date:e.date,pub:e.publisher}),Rf=/([0-9]{4}-[0-9]{1,2}-[0-9]{1,2}|[0-9]{4}-[0-9]{1,2}|[0-9]{4})/,ts=/(E?ISBN|E?ISSN|DOI)\s*:\s*/g,er=e=>`*:has([title*="${e}" i]) + .item-details-element-container prm-highlight`,wf=e=>{if(!e)return;const t=Rf.exec(e);if(t)return t.length>1?t[1]:void 0},If=e=>{const t=Array.from(e.querySelectorAll(er("Identifier"))),r={};return t.map(n=>n.textContent).filter(n=>!!n).forEach(n=>{const o=[];let s;for(;(s=ts.exec(n))!==null;)o.push({id:s[1].toLowerCase(),index:s.index,start:ts.lastIndex});o.forEach(({id:i,start:a},c)=>{r[i]??=[],r[i].push(n.substring(a,o[c+1]?.index))})}),r},kf=e=>Array.from(e.querySelectorAll(er("Author"))).filter(t=>!!t.textContent&&t.parentElement!==null&&t.parentElement.getAttribute("aria-hidden")!=="true").map(t=>t.textContent.trim()),$e=(e,t)=>e.querySelector(er(t))?.textContent.trim(),Cf=e=>{const t=$e(e,"Creation Date"),r=$e(e,"Edition"),n=$e(e,"Publication Date"),o=$e(e,"Is Part Of"),s=$e(e,"Publisher"),i=$e(e,"Title"),a=$e(e,"MMS ID")??$e(e,"Record ID"),c=kf(e),u=If(e),[l]=o?.split(",")??[],f=wf(n??t),m=[...u.isbn??[],...u.eisbn??[]].map(g=>Wt(g)).filter(g=>!!g);return{authors:c,date:f,dois:u.doi,edition:r,eissns:u.eissn,isbns:m,issns:u.issn,jtitle:l,lcn:a,publisher:s,title:i}};var rs=(e=>(e.Article="Article",e.Book="Book",e.Periodical="Periodical",e.Journal="Journal",e.AudioCD="Audio CD",e.CreativeWork="CreativeWork",e.Movie="Movie",e.Video="Video",e))(rs||{});const Pf=e=>Object.values(rs).includes(e),Of=(e,t)=>{const r=t?.mainEntity["@type"]??e.querySelector(".media-content-type")?.textContent??void 0;if(Pf(r))return r},Nf=({document:e})=>{const t=$f(e),r=Cf(e),n=vf(t,r);switch(Of(e,t)){case"Article":return A(bf(n));case"Book":return A(yf(n));case"Periodical":case"Journal":return A(Sf(n));case"Audio CD":case"CreativeWork":return A(_f(n));case"Movie":case"Video":return A(Af(n));default:return q()}},zf=e=>{const t=e.querySelectorAll('[id="Info"] > p'),n=Array.from(t).find(s=>s.textContent.includes("Document Type"))?.textContent,o=h(e,"name","DC.identifier");return o?.startsWith("info:doi/")||n?.includes("Article")?S.Article:o?.startsWith("urn:issn:")?S.Journal:void 0},Lf=e=>{const t=h(e,"name","DCTERMS.bibliographicCitation"),[r,n,o,s]=t?.split(",")??[];return{journalTitle:r,volume:n,issue:o,pages:s}},Tf=e=>{const t=h(e,"name","DC.identifier");return(t?t.split("info:doi/"):null)?.[1]??void 0},xf=e=>e.evaluate('//*[@id="altLayoutPublisherLogo"]/p/a[1]',e,null,XPathResult.STRING_TYPE,null).stringValue,qf=e=>{const[t,r]=e?e.trim().split("-"):[void 0,void 0],n=r?.replace(/\(\d+\)/,"").trim();return{spage:t,epage:n}},Zf=e=>{const t=h(e,"name","DCTERMS.issued");if(!t)return;const n=/\d{4}/.exec(t);return n?n[0]:void 0},jf=e=>{const t=h(e,"name","DC.title"),r=h(e,"name","DC.publisher"),n=Zf(e),o=Lf(e),s=o.journalTitle?.trim(),i=o.volume?.trim(),a=o.issue?.trim(),c=o.pages?qf(o.pages):void 0,u=c?.spage,l=c?.epage,f=re(e,"name","DC.creator"),m=Tf(e);return j(E.Article,{au:f,jtitle:s,date:n,doi:m,issue:a,pub:r,spage:u,epage:l,atitle:t,volume:i})},Df=e=>{const t=h(e,"name","DC.title"),r=h(e,"name","DC.publisher"),n=xf(e);return j(E.Journal,{issn:n,title:t,pub:r})},Uf=({document:e})=>{switch(zf(e)){case S.Article:return A(jf(e));case S.Journal:return A(Df(e));default:return q()}},Bf=/^\d{4}-\d{3}[\dX]$/i,Vf=e=>Bf.test(e),ns=e=>{const t=e.filter(Vf);return t.length?t:void 0},tr=e=>{const t=re(e,"name","citation_author");return t.length?t:void 0},rr=e=>h(e,"name","citation_publication_date")?.match(/^\d{4}/)?.[0],Ff=e=>h(e,"name","citation_doi"),os=e=>{const t=re(e,"name","citation_isbn");return t.length?t.join(","):void 0},ss=e=>ns(re(e,"name","citation_issn")),nr=e=>h(e,"name","citation_journal_title"),or=e=>h(e,"name","citation_publisher"),gt=e=>h(e,"name","citation_title"),Jf=e=>h(e,"name","citation_doi"),sr=e=>h(e,"name","citation_firstpage"),ir=e=>h(e,"name","citation_lastpage"),Mf=e=>h(e,"name","citation_issue"),Wf=e=>h(e,"name","citation_volume"),Gf=e=>j(E.Article,{atitle:gt(e),au:tr(e),date:rr(e),doi:Ff(e),issn:ss(e)?.[0],issue:Mf(e),jtitle:nr(e),pub:or(e),volume:Wf(e),spage:sr(e),epage:ir(e)}),Xf=e=>Y(E.Bookitem,{atitle:gt(e),au:tr(e),btitle:nr(e),date:rr(e),isbn:os(e),pub:or(e),spage:sr(e),epage:ir(e)}),Hf=e=>po({title:gt(e),au:tr(e),date:rr(e),pub:or(e),spage:sr(e),epage:ir(e)}),is=e=>!!e.isbn,Yf=e=>!!e.issn||e.type==="Article"&&!!e.journalTitle||!is(e)&&!!e.journalTitle,Kf=e=>!!e.title,Qf=e=>{const t={type:Jf(e),isbn:os(e),issn:ss(e),journalTitle:nr(e),title:gt(e)};return is(t)?Xf(e):Yf(t)?Gf(e):Kf(t)?Hf(e):null},em=({document:e})=>{const t=Qf(e);return t?A(t):q()},tm=I({"@content":p(),datePublished:p().optional(),mainEntity:I({type:p().optional(),name:p().optional(),author:U(I({name:p()})).optional(),publisher:I({type:p(),name:p()}).optional(),isbn:p().optional()})}),rm=e=>tm.safeParse(e).success,nm=e=>{const t=e.textContent;if(!t)return null;try{const r=JSON.parse(t);if(rm(r))return r}catch{return null}return null},om=({document:e})=>{const t=ut(e);if(!t)return q();const r=nm(t);if(!r)return q();const n=r.mainEntity.type,o=r.mainEntity.author?.map(u=>u.name),s=r.datePublished?.substring(0,4),i=r.mainEntity.name,a=r.mainEntity.isbn,c=r.mainEntity.publisher?.name;switch(n){case"Book":return A(Y(E.Book,{au:o,date:s,title:i,isbn:a,pub:c}));default:return q()}},sm=we.extend({"@type":p().optional(),name:p().optional(),copyrightYear:eo().optional(),author:U(I({name:p()})).optional(),publisher:U(I({name:p()})).optional()}),im=e=>sm.safeParse(e).success,am=({document:e,url:t})=>{const r=ut(e);if(!r)return q();const n=Ue(r);if(!n||!im(n))return q();const o=n["@type"],s=n.author?.map(l=>l.name),i=n.copyrightYear?.toString()??h(e,"property","og:book:release_date"),a=n.name,c=Kt(n.publisher?.map(l=>l.name)),u=h(e,"property","og:book:isbn");switch(o){case"Book":return A(Y(E.Book,{au:s,date:i,title:a,isbn:u,pub:c,uri:t}));default:return q()}},cm=e=>{const t=Array.from(e.querySelectorAll("a[rel=author]")).map(r=>r.textContent.trim()).filter(Boolean);return t.length?t:void 0},um=e=>{const t=Array.from(e.querySelectorAll("strong")).filter(r=>r.textContent.startsWith("ISBN")).map(r=>r.nextElementSibling?.textContent.trim());if(t.length!==0)return t[0]?.replace(/\s+/,",")},lm=({url:e,document:t})=>{const r=t.querySelector("h3.page-title")?.textContent.trim()??void 0,n=cm(t),o=h(t,"property","article:published_time"),s=um(t),i=Y(E.Book,{au:n,date:o?.substring(0,4),isbn:s,pub:"Milne Open Textbooks",title:r,uri:e});return A(i)},pm=({document:e,url:t})=>{switch(hm(t)){case S.Chapter:return A(vm(e));case S.Book:return A(bm(e));case S.Article:return A(fm(e));case S.Journal:return A(mm(e));default:return q()}},hm=e=>{const{pathname:t}=new URL(e);return t.includes("/books/abs/")?S.Chapter:t.includes("/books/")?S.Book:/\/journals\/.+\/article\//.exec(t)!=null?S.Article:t.includes("/journals/")?S.Journal:S.None},fm=e=>{const t=h(e,"name","citation_title"),r=h(e,"name","citation_journal_title"),n=h(e,"name","citation_doi"),o=h(e,"name","citation_volume"),s=h(e,"name","citation_issue"),i=h(e,"name","citation_firstpage"),a=h(e,"name","citation_lastpage"),c=h(e,"name","citation_publication_date")?.substring(0,4),u=h(e,"name","citation_publisher"),l=as(e),f=ns(re(e,"name","citation_issn"));return j(E.Article,{atitle:t,au:l,jtitle:r,doi:n,volume:o,issue:s,issn:f?.[0],spage:i,epage:a,date:c,pub:u})},mm=e=>{const t=dm(e),r=gm(e),n=r.find(a=>a.type==="Print"),o=r.find(a=>a.type==="Online"),s=n?n.value:void 0,i=o?o.value:void 0;return j(E.Journal,{title:t,issn:s,eissn:i})},dm=e=>e.querySelector("h1.title")?.textContent.trim()??void 0,gm=e=>{const r=Array.from(e.querySelectorAll("span.bold")).find(s=>s.textContent.trim()==="ISSN:"),n=/^([0-9]{4}-[0-9]{3}[0-9X]) \((Print|Online)\)/,o=[];return r&&r.parentElement?.querySelectorAll("span.value")?.forEach(i=>{const a=i.textContent.trim(),c=n.exec(a);c&&o.push({value:c[1],type:c[2]})}),o},vm=e=>{const t=h(e,"name","citation_title"),r=h(e,"name","citation_inbook_title"),n=h(e,"name","citation_doi"),o=h(e,"name","citation_publication_date")?.substring(0,4),s=h(e,"name","citation_publisher");return Y(E.Bookitem,{atitle:t,btitle:r,doi:n,date:o,pub:s})},bm=e=>{const t=h(e,"name","citation_title"),r=h(e,"name","citation_doi"),n=h(e,"name","citation_isbn"),o=h(e,"name","citation_publication_date")?.substring(0,4),s=h(e,"name","citation_publisher"),i=as(e);return Y(E.Book,{title:t,au:i,doi:r,isbn:n,date:o,pub:s})},as=e=>{const t=re(e,"name","citation_author");return t.length?t:void 0},_m=e=>{switch(h(e,"property","og:type")){case"Article":return"Article";case"Journal":return"Journal";default:return}};function ym(e){const t=h(e,"property","og:title"),r=h(e,"name","dc.Publisher"),n=h(e,"name","publication_doi");return A(j(E.Journal,{jtitle:t,pub:r,doi:n}))}function Sm(e){const t=h(e,"name","dc.Title"),r=re(e,"name","dc.Creator"),n=h(e,"name","dc.Date")?.substring(0,4),o=h(e,"name","publication_doi"),s=h(e,"name","citation_journal_title"),i=h(e,"name","dc.Publisher");return A(j(E.Article,{atitle:t,au:r,date:n,doi:o,jtitle:s,pub:i}))}const Em=({document:e})=>{switch(_m(e)){case"Journal":return ym(e);case"Article":return Sm(e);default:return q()}},$m=e=>{if(!e)return;const[t,r]=e.trim().split("-");return{spage:t,epage:r}},Am=e=>{const{pathname:t}=new URL(e);if(t.includes("/article/"))return S.Article},Rm=e=>{const t=h(e,"name","DC.Source"),r=h(e,"name","DC.Title"),n=re(e,"name","DC.Creator.PersonalName"),o=h(e,"name","DC.Source.ISSN"),s=h(e,"name","citation_date")?.substring(0,4),i=h(e,"name","DC.Source.Volume"),a=h(e,"name","DC.Source.Issue"),c=h(e,"name","DC.Identifier.URI"),u=h(e,"name","DC.Identifier.pageNumber"),l=u?$m(u):void 0,f=l?.spage,m=l?.epage;return j(E.Article,{jtitle:t,atitle:r,au:n,issn:o,date:s,spage:f,epage:m,volume:i,issue:a,uri:c})},wm=({document:e,url:t})=>{switch(Am(t)){case S.Article:return A(Rm(e));default:return q()}},Im=e=>{switch(km(e)){case"eBook":return"Book";case"Reference":return"Chapter";default:return}},km=e=>e.querySelector("#vol-contentType a")?.textContent??void 0;function Cm(e,t){const r=cs(e),n=ar(e),o=ls(e),s=ps(e),i=hs(e),a=fs(e),c=ar(e),u=t,{startPage:l,endPage:f}=ms(e)??{};return A(Y(E.Book,{au:r,btitle:n,date:o,doi:s,epage:f,isbn:i,pub:a,spage:l,title:c,uri:u}))}function Pm(e,t){const r=cs(e),n=us(e),o=ar(e),s=ls(e),i=ps(e),a=hs(e),c=fs(e),u=us(e),l=t,{startPage:f,endPage:m}=ms(e)??{};return A(Y(E.Book,{au:r,atitle:n,btitle:o,date:s,doi:i,epage:m,isbn:a,pub:c,spage:f,title:u,uri:l}))}const cs=e=>{const t=e.querySelectorAll("div#article_author p.author-bio b"),r=Array.from(t).map(n=>n.textContent).filter(n=>!!n).map(n=>n.trim());return r.length>0?r:void 0},xe=(e,t)=>e.querySelector(`input#${t}`)?.getAttribute("value")??void 0,Om=e=>h(e,"property","og:title"),ar=e=>xe(e,"titlevalue")??Om(e),us=e=>xe(e,"chapter-title-squid"),ls=e=>xe(e,"pubdate-squid"),ps=e=>xe(e,"doi-squid"),hs=e=>xe(e,"isbn-squid"),fs=e=>xe(e,"pubname-squid"),ms=e=>{const t=e.querySelector("#pageRange")?.textContent??void 0;if(!t)return;const n=/(\d+)–(\d+)/.exec(t);if(n)return{startPage:n[1],endPage:n[2]}},Nm=({document:e,url:t})=>{switch(Im(e)){case"Book":return Cm(e,t);case"Chapter":return Pm(e,t);default:return q()}},zm=(e,t)=>e.evaluate(`//*[@class="singleRecord_view_label"][contains(text(), "${t}")]/following-sibling::*[@class="singleRecord_view_data"]`,e,null,XPathResult.STRING_TYPE).stringValue.toLowerCase().trim(),Lm=e=>{switch(zm(e,"Medium")){case"book":case"e-book":return E.Book;case"e-journal":return E.Journal;default:return E.Unknown}},Tm=e=>{delete e.rft_id},xm=e=>{const t=Mt(e);if(lt(t)){const r=Lm(e.document);t.resource.genre=r,Tm(t.resource)}return t},qm=e=>{const t=h(e,"name","type")?.toLowerCase(),r=h(e,"name","og:type")?.toLowerCase(),n=h(e,"name","citation_article_type")?.toLowerCase();if(t==="article"||n==="article"||r==="article")return S.Article;const o=h(e,"name","twitter:title")?.trim(),s=h(e,"name","description")?.trim();if(o||s)return S.Webpage},Zm=e=>{const t=h(e,"name","DC.Title"),r=h(e,"name","DC.Publisher"),n=h(e,"name","DC.Date"),o=h(e,"name","DC.Identifier"),s=h(e,"name","citation_journal_title"),i=h(e,"name","citation_volume"),a=h(e,"name","citation_issn"),c=re(e,"name","citation_author");return j(E.Article,{au:c,jtitle:s,date:n,doi:o,issn:a,pub:r,title:t,volume:i})},jm=(e,t)=>{const r=h(t,"name","twitter:title");return at({uri:e,title:r})},Dm=({url:e,document:t})=>{switch(qm(t)){case S.Article:return A(Zm(t));case S.Webpage:return A(jm(e,t))}return q()},Um=({document:e})=>Array.from(e.querySelectorAll(".availability.documentSummaryAvailability.availabilityContent")).length<=1?q():ko(),Bm=/([0-9]{4})\s+at/;function Vm(e){if(!e)return;const t=Bm.exec(e);if(t&&t.length>1)return t[1]}function ds(e,t){const r=e.getElementsByClassName(t);if(r.length!==0)return r[0].textContent}function Fm(e){const t={};return Array.from(e.getElementsByTagName("li")).reduce((r,n)=>{const o=ds(n,"title"),s=ds(n,"content");return o&&s&&(r[o]=s),r},t)}function Jm(e){const t=e.getElementsByClassName("information");if(t.length===0)return{};const r=Fm(t[0]),n=Vm(r.Published),o=r.Show;return{date:n,series:o}}const Mm=({url:e,document:t})=>{if(!new URL(e).searchParams.has("i"))return q();const n=E.AudioDocument,o=h(t,"property","og:site_name"),s=h(t,"property","og:title"),i=Jm(t);return A({genre:n,pub:o,title:s,uri:e,...i})},Wm=e=>{const t=h(e,"name","citation_date");return t?t.split("/").find(o=>/^\d{4}/.test(o))??void 0:void 0},Gm=e=>{const t=e.querySelector("#arxiv-doi-link")?.textContent;return t?t.replace("https://doi.org/","").trim():void 0},Xm=({document:e})=>{const t=h(e,"name","citation_title"),r=h(e,"name","citation_pdf_url"),n=re(e,"name","citation_author"),o=Wm(e),s=Gm(e);return!t&&n.length===0&&!o&&!s?q():A(j(E.Article,{au:n,date:o,doi:s,title:t,uri:r}))},Hm=e=>{const t=Ve(e,"div.director-section div.term-info-section-items");if(!t)return;const r=t.split(",").map(n=>n.replace(/\s+/g," ").trim()).filter(n=>n.length>0);return r.length>0?r:void 0},Ym=e=>{const t=new Map;return Array.from(e.querySelectorAll(".info-section-container")).forEach(r=>{const n=r.querySelector(".info-section-header .info-section-title")?.textContent.trim().toLowerCase();if(!n)return;const o=Array.from(r.querySelectorAll(".term-info-section-item")).map(s=>s.textContent.replace(",","").trim()).filter(s=>!!s);o.length&&t.set(n,o)}),t},Km=({url:e,document:t})=>{const r=Ym(t),n=Hm(t)??r.get("director"),o=Ve(t,"div.product-release-year"),s=Ve(t,"div.studio-section div.term-info-section-item")??Te(r.get("supplier")),i=Ve(t,".product-title")??Ve(t,".movie-title"),a=me({au:n,date:o,pub:s,title:i,uri:e});return A(a)},Qm=e=>{if(h(e,"property","og:type")==="article")return S.Article};function ed(e){const t={},r=e.querySelector("[data-id=layout-form]");return r&&Array.from(r.getElementsByTagName("h2")).forEach(o=>{const s=o.textContent.toLowerCase(),a=Array.from(o.parentElement?.getElementsByTagName("span")??[]).map(c=>c.textContent||"");s&&(t[s]=a[0])}),t}function td(e,t,r){return r.includes("publisher")?t.publisher:r.includes("place of publication, exhibition, or creation")?t["place of publication, exhibition, or creation"]:h(e,"name","DC.publisher")}function rd(e){const t=h(e,"name","citation_publication_date");return t?t.substring(0,4):h(e,"name","citation_online_date")?.substring(0,4)}const nd=e=>{const t=ed(e),r=h(e,"name","DataCite.title"),n=re(e,"name","DataCite.contributor"),o=rd(e),s=h(e,"name","DC.identifier.DOI"),i=Object.keys(t),a=td(e,t,i),c=i.includes("journal")?t.journal:void 0,u=i.includes("volume")?t.volume:void 0,l=i.includes("issue")?t.issue:void 0,f=i.includes("issn")?t.issn:void 0,m=i.includes("electronic location (url)")?t["electronic location (url)"]:void 0;return j(E.Article,{jtitle:c,atitle:r,pub:a,au:n,date:o,doi:s,volume:u,issue:l,issn:f,uri:m})},od=({document:e})=>{switch(Qm(e)){case S.Article:return A(nd(e));default:return q()}};var x=(e=>(e.NoResourceFound="NoResourceFound",e.Z3988="Z3988",e.Z3988SearchResult="Z3988SearchResult",e.Amazon="Amazon",e.CupOfJo="CupOfJo",e.IngentaConnect="IngentaConnect",e.Jstor="Jstor",e.Milne="Milne",e.Primo="Primo",e.SagePub="SagePub",e.SageVideo="SageVideo",e.ScienceDirect="ScienceDirect",e.Springer="Springer",e.Youtube="Youtube",e.TaylorFrancis="TaylorFrancis",e.Wiley="Wiley",e.VuFind="VuFind",e.ClinicalKey="ClinicalKey",e.DOAJ="DOAJ",e.Ebscohost="Ebscohost",e.OpenStax="OpenStax",e.CambridgeJournalsOnline="CambridgeJournalsOnline",e.OpenTextbook="OpenTextbook",e.AhaJournals="AhaJournals",e.Ijees="Ijees",e.BloomsburyCollections="BloomsburyCollections",e.HeritageCirqa="HeritageCirqa",e.BritishMedicalJournal="BritishMedicalJournal",e.SummonSearchResult="SummonSearchResult",e.ApplePodcasts="ApplePodcasts",e.Arxiv="Arxiv",e.KanopyVideo="KanopyVideo",e.LaTrobeOpal="LaTrobeOpal",e))(x||{});const cr={NoResourceFound:xo,Z3988:Mt,Z3988SearchResult:Wh,Amazon:Kl,CupOfJo:yp,Jstor:df,Youtube:ph,SagePub:Tp,SageVideo:Mh,ScienceDirect:Fp,Springer:Ch,TaylorFrancis:Yp,Wiley:Fh,VuFind:ah,ClinicalKey:pp,DOAJ:Rp,Primo:Nf,IngentaConnect:Uf,Ebscohost:em,OpenStax:om,OpenTextbook:am,Milne:lm,CambridgeJournalsOnline:pm,AhaJournals:Em,Ijees:wm,BloomsburyCollections:Nm,HeritageCirqa:xm,BritishMedicalJournal:Dm,SummonSearchResult:Um,ApplePodcasts:Mm,Arxiv:Xm,KanopyVideo:Km,LaTrobeOpal:od},sd="5.28.0",ur=()=>sd,id=["com.au","com","ca","co.uk","de","fr","nl"].flatMap(e=>[`amazon.${e}`,`www.amazon.${e}`]),ad={version:ur(),siteRegistrations:[{matcher:{regexp:"^https://[a-z0-9\\-]+\\.on\\.worldcat\\.org/search"},name:"Worldcat Search Results",parsers:[x.Z3988SearchResult]},{matcher:{regexp:"^https://[a-z0-9\\-]+\\.summon\\.serialssolutions\\.com/"},name:"Summon Search Results",parsers:[x.SummonSearchResult]},{matcher:{hostnames:["cupofjo.com"]},name:"Cup of Jo",parsers:[x.CupOfJo]},{matcher:{hostnames:["youtube.com","www.youtube.com"]},name:"Youtube",parsers:[x.Youtube]},{matcher:{hostnames:["www.sciencedirect.com"]},name:"Science Direct",parsers:[x.ScienceDirect]},{matcher:{hostnames:id},name:"Amazon",parsers:[x.Amazon]},{matcher:{hostnames:["sagepub.com","www.sagepub.com","journals.sagepub.com"]},name:"Sage Publishing",parsers:[x.SagePub]},{matcher:{hostnames:["www.tandfonline.com"]},name:"Taylor & Francis",parsers:[x.TaylorFrancis]},{matcher:{hostnames:["wiley.com","www.wiley.com","onlinelibrary.wiley.com"]},name:"Wiley",parsers:[x.Wiley]},{matcher:{regexp:"^https://[a-z0-9\\-]+\\.on\\.worldcat\\.org/"},name:"Worldcat",parsers:[x.Z3988]},{matcher:{hostnames:["catalogue.rau.ac.uk"]},name:"Royal Agricultural University Library",parsers:[x.Z3988]},{matcher:{hostnames:["link.springer.com"]},name:"Springer",parsers:[x.Springer]},{matcher:{regexp:"^https://sk\\.sagepub\\.com/video/"},name:"Sage Video",parsers:[x.SageVideo]},{matcher:{regexp:"^https://vufind\\.lboro\\.ac\\.uk/(Record|PrimoRecord)"},name:"VuFind",parsers:[x.VuFind]},{matcher:{hostnames:["www.clinicalkey.com","www.clinicalkey.com.au"]},name:"ClinicalKey",parsers:[x.ClinicalKey]},{matcher:{hostnames:["www.jstor.org"]},name:"JSTOR",parsers:[x.Jstor]},{matcher:{hostnames:["doaj.org"]},name:"DOAJ",parsers:[x.DOAJ]},{matcher:{regexp:"/.*ingentaconnect.com/"},name:"IngentaConnect",parsers:[x.IngentaConnect]},{matcher:{hostnames:["research.ebsco.com"]},name:"EBSCOHost",parsers:[x.Ebscohost]},{matcher:{hostnames:["openstax.org"]},name:"OpenStax",parsers:[x.OpenStax]},{matcher:{hostnames:["open.umn.edu"]},name:"OpenTextbook",parsers:[x.OpenTextbook]},{matcher:{hostnames:["milneopentextbooks.org"]},name:"Milne Open Textbooks",parsers:[x.Milne]},{matcher:{hostnames:["www.perlego.com"]},name:"Perlego",parsers:[x.Z3988]},{matcher:{hostnames:["www.ahajournals.org"]},name:"AHA Journals",parsers:[x.AhaJournals]},{matcher:{hostnames:["www.cambridge.org"]},name:"Cambridge Journals Online",parsers:[x.CambridgeJournalsOnline]},{matcher:{hostnames:["www.nieindia.org"]},name:"International Journal of Ecology and Environmental Sciences",parsers:[x.Ijees]},{matcher:{hostnames:["www.bloomsburycollections.com"]},name:"Bloomsbury Collections",parsers:[x.BloomsburyCollections]},{matcher:{hostnames:["regwem.cirqahosting.com","buddy.cirqahosting.com"]},name:"Heritage Cirqa",parsers:[x.HeritageCirqa]},{matcher:{hostnames:["www.bmj.com"]},name:"British Medical Journal",parsers:[x.BritishMedicalJournal]},{matcher:{hostnames:["podcasts.apple.com"]},name:"Apple Podcasts",parsers:[x.ApplePodcasts]},{matcher:{hostnames:["arxiv.org"]},name:"arxiv",parsers:[x.Arxiv]},{matcher:{hostnames:["kanopy.com","www.kanopy.com"]},name:"Kanopy Video",parsers:[x.KanopyVideo]},{matcher:{hostnames:["opal.latrobe.edu.au"]},name:"La Trobe Opal",parsers:[x.LaTrobeOpal]}]},lr=I({hostnames:U(p()).min(1)}),pr=I({regexp:p()}),hr=pe([lr,pr]),fr=I({matcher:hr,name:p(),parsers:U(p()),libraryVersionRange:p().optional()}),gs=I({siteRegistrations:U(fr),version:p()}),cd=e=>gs.safeParse(e).success,ud=e=>fr.safeParse(e).success,ld=e=>hr.safeParse(e).success,vs=e=>Object.values(x).includes(e),pd=e=>typeof e=="object"&&e!==null,bs=I({url:p(),document:El(pd)}),hd=e=>bs.safeParse(e).success;var vt={exports:{}},mr,_s;function bt(){if(_s)return mr;_s=1;const e="2.0.0",t=256,r=Number.MAX_SAFE_INTEGER||9007199254740991,n=16,o=t-6;return mr={MAX_LENGTH:t,MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:o,MAX_SAFE_INTEGER:r,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},mr}var dr,ys;function _t(){return ys||(ys=1,dr=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{}),dr}var Ss;function We(){return Ss||(Ss=1,(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:o}=bt(),s=_t();t=e.exports={};const i=t.re=[],a=t.safeRe=[],c=t.src=[],u=t.safeSrc=[],l=t.t={};let f=0;const m="[a-zA-Z0-9-]",g=[["\\s",1],["\\d",o],[m,n]],P=O=>{for(const[Z,K]of g)O=O.split(`${Z}*`).join(`${Z}{0,${K}}`).split(`${Z}+`).join(`${Z}{1,${K}}`);return O},b=(O,Z,K)=>{const L=P(Z),B=f++;s(O,B,Z),l[O]=B,c[B]=Z,u[B]=L,i[B]=new RegExp(Z,K?"g":void 0),a[B]=new RegExp(L,K?"g":void 0)};b("NUMERICIDENTIFIER","0|[1-9]\\d*"),b("NUMERICIDENTIFIERLOOSE","\\d+"),b("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${m}*`),b("MAINVERSION",`(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})`),b("MAINVERSIONLOOSE",`(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})`),b("PRERELEASEIDENTIFIER",`(?:${c[l.NONNUMERICIDENTIFIER]}|${c[l.NUMERICIDENTIFIER]})`),b("PRERELEASEIDENTIFIERLOOSE",`(?:${c[l.NONNUMERICIDENTIFIER]}|${c[l.NUMERICIDENTIFIERLOOSE]})`),b("PRERELEASE",`(?:-(${c[l.PRERELEASEIDENTIFIER]}(?:\\.${c[l.PRERELEASEIDENTIFIER]})*))`),b("PRERELEASELOOSE",`(?:-?(${c[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[l.PRERELEASEIDENTIFIERLOOSE]})*))`),b("BUILDIDENTIFIER",`${m}+`),b("BUILD",`(?:\\+(${c[l.BUILDIDENTIFIER]}(?:\\.${c[l.BUILDIDENTIFIER]})*))`),b("FULLPLAIN",`v?${c[l.MAINVERSION]}${c[l.PRERELEASE]}?${c[l.BUILD]}?`),b("FULL",`^${c[l.FULLPLAIN]}$`),b("LOOSEPLAIN",`[v=\\s]*${c[l.MAINVERSIONLOOSE]}${c[l.PRERELEASELOOSE]}?${c[l.BUILD]}?`),b("LOOSE",`^${c[l.LOOSEPLAIN]}$`),b("GTLT","((?:<|>)?=?)"),b("XRANGEIDENTIFIERLOOSE",`${c[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),b("XRANGEIDENTIFIER",`${c[l.NUMERICIDENTIFIER]}|x|X|\\*`),b("XRANGEPLAIN",`[v=\\s]*(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:${c[l.PRERELEASE]})?${c[l.BUILD]}?)?)?`),b("XRANGEPLAINLOOSE",`[v=\\s]*(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:${c[l.PRERELEASELOOSE]})?${c[l.BUILD]}?)?)?`),b("XRANGE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAIN]}$`),b("XRANGELOOSE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAINLOOSE]}$`),b("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),b("COERCE",`${c[l.COERCEPLAIN]}(?:$|[^\\d])`),b("COERCEFULL",c[l.COERCEPLAIN]+`(?:${c[l.PRERELEASE]})?(?:${c[l.BUILD]})?(?:$|[^\\d])`),b("COERCERTL",c[l.COERCE],!0),b("COERCERTLFULL",c[l.COERCEFULL],!0),b("LONETILDE","(?:~>?)"),b("TILDETRIM",`(\\s*)${c[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",b("TILDE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAIN]}$`),b("TILDELOOSE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAINLOOSE]}$`),b("LONECARET","(?:\\^)"),b("CARETTRIM",`(\\s*)${c[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",b("CARET",`^${c[l.LONECARET]}${c[l.XRANGEPLAIN]}$`),b("CARETLOOSE",`^${c[l.LONECARET]}${c[l.XRANGEPLAINLOOSE]}$`),b("COMPARATORLOOSE",`^${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]})$|^$`),b("COMPARATOR",`^${c[l.GTLT]}\\s*(${c[l.FULLPLAIN]})$|^$`),b("COMPARATORTRIM",`(\\s*)${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]}|${c[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",b("HYPHENRANGE",`^\\s*(${c[l.XRANGEPLAIN]})\\s+-\\s+(${c[l.XRANGEPLAIN]})\\s*$`),b("HYPHENRANGELOOSE",`^\\s*(${c[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[l.XRANGEPLAINLOOSE]})\\s*$`),b("STAR","(<|>)?=?\\s*\\*"),b("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),b("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(vt,vt.exports)),vt.exports}var gr,Es;function vr(){if(Es)return gr;Es=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return gr=n=>n?typeof n!="object"?e:n:t,gr}var br,$s;function As(){if($s)return br;$s=1;const e=/^[0-9]+$/,t=(n,o)=>{if(typeof n=="number"&&typeof o=="number")return n===o?0:n<o?-1:1;const s=e.test(n),i=e.test(o);return s&&i&&(n=+n,o=+o),n===o?0:s&&!i?-1:i&&!s?1:n<o?-1:1};return br={compareIdentifiers:t,rcompareIdentifiers:(n,o)=>t(o,n)},br}var _r,Rs;function ne(){if(Rs)return _r;Rs=1;const e=_t(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:r}=bt(),{safeRe:n,t:o}=We(),s=vr(),{compareIdentifiers:i}=As();class a{constructor(u,l){if(l=s(l),u instanceof a){if(u.loose===!!l.loose&&u.includePrerelease===!!l.includePrerelease)return u;u=u.version}else if(typeof u!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof u}".`);if(u.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",u,l),this.options=l,this.loose=!!l.loose,this.includePrerelease=!!l.includePrerelease;const f=u.trim().match(l.loose?n[o.LOOSE]:n[o.FULL]);if(!f)throw new TypeError(`Invalid Version: ${u}`);if(this.raw=u,this.major=+f[1],this.minor=+f[2],this.patch=+f[3],this.major>r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");f[4]?this.prerelease=f[4].split(".").map(m=>{if(/^[0-9]+$/.test(m)){const g=+m;if(g>=0&&g<r)return g}return m}):this.prerelease=[],this.build=f[5]?f[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(u){if(e("SemVer.compare",this.version,this.options,u),!(u instanceof a)){if(typeof u=="string"&&u===this.version)return 0;u=new a(u,this.options)}return u.version===this.version?0:this.compareMain(u)||this.comparePre(u)}compareMain(u){return u instanceof a||(u=new a(u,this.options)),this.major<u.major?-1:this.major>u.major?1:this.minor<u.minor?-1:this.minor>u.minor?1:this.patch<u.patch?-1:this.patch>u.patch?1:0}comparePre(u){if(u instanceof a||(u=new a(u,this.options)),this.prerelease.length&&!u.prerelease.length)return-1;if(!this.prerelease.length&&u.prerelease.length)return 1;if(!this.prerelease.length&&!u.prerelease.length)return 0;let l=0;do{const f=this.prerelease[l],m=u.prerelease[l];if(e("prerelease compare",l,f,m),f===void 0&&m===void 0)return 0;if(m===void 0)return 1;if(f===void 0)return-1;if(f===m)continue;return i(f,m)}while(++l)}compareBuild(u){u instanceof a||(u=new a(u,this.options));let l=0;do{const f=this.build[l],m=u.build[l];if(e("build compare",l,f,m),f===void 0&&m===void 0)return 0;if(m===void 0)return 1;if(f===void 0)return-1;if(f===m)continue;return i(f,m)}while(++l)}inc(u,l,f){if(u.startsWith("pre")){if(!l&&f===!1)throw new Error("invalid increment argument: identifier is empty");if(l){const m=`-${l}`.match(this.options.loose?n[o.PRERELEASELOOSE]:n[o.PRERELEASE]);if(!m||m[1]!==l)throw new Error(`invalid identifier: ${l}`)}}switch(u){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",l,f);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",l,f);break;case"prepatch":this.prerelease.length=0,this.inc("patch",l,f),this.inc("pre",l,f);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",l,f),this.inc("pre",l,f);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const m=Number(f)?1:0;if(this.prerelease.length===0)this.prerelease=[m];else{let g=this.prerelease.length;for(;--g>=0;)typeof this.prerelease[g]=="number"&&(this.prerelease[g]++,g=-2);if(g===-1){if(l===this.prerelease.join(".")&&f===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(m)}}if(l){let g=[l,m];f===!1&&(g=[l]),i(this.prerelease[0],l)===0?isNaN(this.prerelease[1])&&(this.prerelease=g):this.prerelease=g}break}default:throw new Error(`invalid increment argument: ${u}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return _r=a,_r}var yr,ws;function qe(){if(ws)return yr;ws=1;const e=ne();return yr=(r,n,o=!1)=>{if(r instanceof e)return r;try{return new e(r,n)}catch(s){if(!o)return null;throw s}},yr}var Sr,Is;function fd(){if(Is)return Sr;Is=1;const e=qe();return Sr=(r,n)=>{const o=e(r,n);return o?o.version:null},Sr}var Er,ks;function md(){if(ks)return Er;ks=1;const e=qe();return Er=(r,n)=>{const o=e(r.trim().replace(/^[=v]+/,""),n);return o?o.version:null},Er}var $r,Cs;function dd(){if(Cs)return $r;Cs=1;const e=ne();return $r=(r,n,o,s,i)=>{typeof o=="string"&&(i=s,s=o,o=void 0);try{return new e(r instanceof e?r.version:r,o).inc(n,s,i).version}catch{return null}},$r}var Ar,Ps;function gd(){if(Ps)return Ar;Ps=1;const e=qe();return Ar=(r,n)=>{const o=e(r,null,!0),s=e(n,null,!0),i=o.compare(s);if(i===0)return null;const a=i>0,c=a?o:s,u=a?s:o,l=!!c.prerelease.length;if(!!u.prerelease.length&&!l){if(!u.patch&&!u.minor)return"major";if(u.compareMain(c)===0)return u.minor&&!u.patch?"minor":"patch"}const m=l?"pre":"";return o.major!==s.major?m+"major":o.minor!==s.minor?m+"minor":o.patch!==s.patch?m+"patch":"prerelease"},Ar}var Rr,Os;function vd(){if(Os)return Rr;Os=1;const e=ne();return Rr=(r,n)=>new e(r,n).major,Rr}var wr,Ns;function bd(){if(Ns)return wr;Ns=1;const e=ne();return wr=(r,n)=>new e(r,n).minor,wr}var Ir,zs;function _d(){if(zs)return Ir;zs=1;const e=ne();return Ir=(r,n)=>new e(r,n).patch,Ir}var kr,Ls;function yd(){if(Ls)return kr;Ls=1;const e=qe();return kr=(r,n)=>{const o=e(r,n);return o&&o.prerelease.length?o.prerelease:null},kr}var Cr,Ts;function ue(){if(Ts)return Cr;Ts=1;const e=ne();return Cr=(r,n,o)=>new e(r,o).compare(new e(n,o)),Cr}var Pr,xs;function Sd(){if(xs)return Pr;xs=1;const e=ue();return Pr=(r,n,o)=>e(n,r,o),Pr}var Or,qs;function Ed(){if(qs)return Or;qs=1;const e=ue();return Or=(r,n)=>e(r,n,!0),Or}var Nr,Zs;function zr(){if(Zs)return Nr;Zs=1;const e=ne();return Nr=(r,n,o)=>{const s=new e(r,o),i=new e(n,o);return s.compare(i)||s.compareBuild(i)},Nr}var Lr,js;function $d(){if(js)return Lr;js=1;const e=zr();return Lr=(r,n)=>r.sort((o,s)=>e(o,s,n)),Lr}var Tr,Ds;function Ad(){if(Ds)return Tr;Ds=1;const e=zr();return Tr=(r,n)=>r.sort((o,s)=>e(s,o,n)),Tr}var xr,Us;function yt(){if(Us)return xr;Us=1;const e=ue();return xr=(r,n,o)=>e(r,n,o)>0,xr}var qr,Bs;function Zr(){if(Bs)return qr;Bs=1;const e=ue();return qr=(r,n,o)=>e(r,n,o)<0,qr}var jr,Vs;function Fs(){if(Vs)return jr;Vs=1;const e=ue();return jr=(r,n,o)=>e(r,n,o)===0,jr}var Dr,Js;function Ms(){if(Js)return Dr;Js=1;const e=ue();return Dr=(r,n,o)=>e(r,n,o)!==0,Dr}var Ur,Ws;function Br(){if(Ws)return Ur;Ws=1;const e=ue();return Ur=(r,n,o)=>e(r,n,o)>=0,Ur}var Vr,Gs;function Fr(){if(Gs)return Vr;Gs=1;const e=ue();return Vr=(r,n,o)=>e(r,n,o)<=0,Vr}var Jr,Xs;function Hs(){if(Xs)return Jr;Xs=1;const e=Fs(),t=Ms(),r=yt(),n=Br(),o=Zr(),s=Fr();return Jr=(a,c,u,l)=>{switch(c){case"===":return typeof a=="object"&&(a=a.version),typeof u=="object"&&(u=u.version),a===u;case"!==":return typeof a=="object"&&(a=a.version),typeof u=="object"&&(u=u.version),a!==u;case"":case"=":case"==":return e(a,u,l);case"!=":return t(a,u,l);case">":return r(a,u,l);case">=":return n(a,u,l);case"<":return o(a,u,l);case"<=":return s(a,u,l);default:throw new TypeError(`Invalid operator: ${c}`)}},Jr}var Mr,Ys;function Rd(){if(Ys)return Mr;Ys=1;const e=ne(),t=qe(),{safeRe:r,t:n}=We();return Mr=(s,i)=>{if(s instanceof e)return s;if(typeof s=="number"&&(s=String(s)),typeof s!="string")return null;i=i||{};let a=null;if(!i.rtl)a=s.match(i.includePrerelease?r[n.COERCEFULL]:r[n.COERCE]);else{const g=i.includePrerelease?r[n.COERCERTLFULL]:r[n.COERCERTL];let P;for(;(P=g.exec(s))&&(!a||a.index+a[0].length!==s.length);)(!a||P.index+P[0].length!==a.index+a[0].length)&&(a=P),g.lastIndex=P.index+P[1].length+P[2].length;g.lastIndex=-1}if(a===null)return null;const c=a[2],u=a[3]||"0",l=a[4]||"0",f=i.includePrerelease&&a[5]?`-${a[5]}`:"",m=i.includePrerelease&&a[6]?`+${a[6]}`:"";return t(`${c}.${u}.${l}${f}${m}`,i)},Mr}var Wr,Ks;function wd(){if(Ks)return Wr;Ks=1;class e{constructor(){this.max=1e3,this.map=new Map}get(r){const n=this.map.get(r);if(n!==void 0)return this.map.delete(r),this.map.set(r,n),n}delete(r){return this.map.delete(r)}set(r,n){if(!this.delete(r)&&n!==void 0){if(this.map.size>=this.max){const s=this.map.keys().next().value;this.delete(s)}this.map.set(r,n)}return this}}return Wr=e,Wr}var Gr,Qs;function le(){if(Qs)return Gr;Qs=1;const e=/\s+/g;class t{constructor(_,k){if(k=o(k),_ instanceof t)return _.loose===!!k.loose&&_.includePrerelease===!!k.includePrerelease?_:new t(_.raw,k);if(_ instanceof s)return this.raw=_.value,this.set=[[_]],this.formatted=void 0,this;if(this.options=k,this.loose=!!k.loose,this.includePrerelease=!!k.includePrerelease,this.raw=_.trim().replace(e," "),this.set=this.raw.split("||").map(R=>this.parseRange(R.trim())).filter(R=>R.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const R=this.set[0];if(this.set=this.set.filter(C=>!b(C[0])),this.set.length===0)this.set=[R];else if(this.set.length>1){for(const C of this.set)if(C.length===1&&O(C[0])){this.set=[C];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let _=0;_<this.set.length;_++){_>0&&(this.formatted+="||");const k=this.set[_];for(let R=0;R<k.length;R++)R>0&&(this.formatted+=" "),this.formatted+=k[R].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(_){const R=((this.options.includePrerelease&&g)|(this.options.loose&&P))+":"+_,C=n.get(R);if(C)return C;const w=this.options.loose,N=w?c[u.HYPHENRANGELOOSE]:c[u.HYPHENRANGE];_=_.replace(N,fn(this.options.includePrerelease)),i("hyphen replace",_),_=_.replace(c[u.COMPARATORTRIM],l),i("comparator trim",_),_=_.replace(c[u.TILDETRIM],f),i("tilde trim",_),_=_.replace(c[u.CARETTRIM],m),i("caret trim",_);let D=_.split(" ").map(ee=>K(ee,this.options)).join(" ").split(/\s+/).map(ee=>hn(ee,this.options));w&&(D=D.filter(ee=>(i("loose invalid filter",ee,this.options),!!ee.match(c[u.COMPARATORLOOSE])))),i("range list",D);const T=new Map,F=D.map(ee=>new s(ee,this.options));for(const ee of F){if(b(ee))return[ee];T.set(ee.value,ee)}T.size>1&&T.has("")&&T.delete("");const oe=[...T.values()];return n.set(R,oe),oe}intersects(_,k){if(!(_ instanceof t))throw new TypeError("a Range is required");return this.set.some(R=>Z(R,k)&&_.set.some(C=>Z(C,k)&&R.every(w=>C.every(N=>w.intersects(N,k)))))}test(_){if(!_)return!1;if(typeof _=="string")try{_=new a(_,this.options)}catch{return!1}for(let k=0;k<this.set.length;k++)if(mn(this.set[k],_,this.options))return!0;return!1}}Gr=t;const r=wd(),n=new r,o=vr(),s=St(),i=_t(),a=ne(),{safeRe:c,t:u,comparatorTrimReplace:l,tildeTrimReplace:f,caretTrimReplace:m}=We(),{FLAG_INCLUDE_PRERELEASE:g,FLAG_LOOSE:P}=bt(),b=y=>y.value==="<0.0.0-0",O=y=>y.value==="",Z=(y,_)=>{let k=!0;const R=y.slice();let C=R.pop();for(;k&&R.length;)k=R.every(w=>C.intersects(w,_)),C=R.pop();return k},K=(y,_)=>(y=y.replace(c[u.BUILD],""),i("comp",y,_),y=W(y,_),i("caret",y),y=B(y,_),i("tildes",y),y=z(y,_),i("xrange",y),y=pn(y,_),i("stars",y),y),L=y=>!y||y.toLowerCase()==="x"||y==="*",B=(y,_)=>y.trim().split(/\s+/).map(k=>Q(k,_)).join(" "),Q=(y,_)=>{const k=_.loose?c[u.TILDELOOSE]:c[u.TILDE];return y.replace(k,(R,C,w,N,D)=>{i("tilde",y,R,C,w,N,D);let T;return L(C)?T="":L(w)?T=`>=${C}.0.0 <${+C+1}.0.0-0`:L(N)?T=`>=${C}.${w}.0 <${C}.${+w+1}.0-0`:D?(i("replaceTilde pr",D),T=`>=${C}.${w}.${N}-${D} <${C}.${+w+1}.0-0`):T=`>=${C}.${w}.${N} <${C}.${+w+1}.0-0`,i("tilde return",T),T})},W=(y,_)=>y.trim().split(/\s+/).map(k=>te(k,_)).join(" "),te=(y,_)=>{i("caret",y,_);const k=_.loose?c[u.CARETLOOSE]:c[u.CARET],R=_.includePrerelease?"-0":"";return y.replace(k,(C,w,N,D,T)=>{i("caret",y,C,w,N,D,T);let F;return L(w)?F="":L(N)?F=`>=${w}.0.0${R} <${+w+1}.0.0-0`:L(D)?w==="0"?F=`>=${w}.${N}.0${R} <${w}.${+N+1}.0-0`:F=`>=${w}.${N}.0${R} <${+w+1}.0.0-0`:T?(i("replaceCaret pr",T),w==="0"?N==="0"?F=`>=${w}.${N}.${D}-${T} <${w}.${N}.${+D+1}-0`:F=`>=${w}.${N}.${D}-${T} <${w}.${+N+1}.0-0`:F=`>=${w}.${N}.${D}-${T} <${+w+1}.0.0-0`):(i("no pr"),w==="0"?N==="0"?F=`>=${w}.${N}.${D}${R} <${w}.${N}.${+D+1}-0`:F=`>=${w}.${N}.${D}${R} <${w}.${+N+1}.0-0`:F=`>=${w}.${N}.${D} <${+w+1}.0.0-0`),i("caret return",F),F})},z=(y,_)=>(i("replaceXRanges",y,_),y.split(/\s+/).map(k=>Ge(k,_)).join(" ")),Ge=(y,_)=>{y=y.trim();const k=_.loose?c[u.XRANGELOOSE]:c[u.XRANGE];return y.replace(k,(R,C,w,N,D,T)=>{i("xRange",y,R,C,w,N,D,T);const F=L(w),oe=F||L(N),ee=oe||L(D),Xe=ee;return C==="="&&Xe&&(C=""),T=_.includePrerelease?"-0":"",F?C===">"||C==="<"?R="<0.0.0-0":R="*":C&&Xe?(oe&&(N=0),D=0,C===">"?(C=">=",oe?(w=+w+1,N=0,D=0):(N=+N+1,D=0)):C==="<="&&(C="<",oe?w=+w+1:N=+N+1),C==="<"&&(T="-0"),R=`${C+w}.${N}.${D}${T}`):oe?R=`>=${w}.0.0${T} <${+w+1}.0.0-0`:ee&&(R=`>=${w}.${N}.0${T} <${w}.${+N+1}.0-0`),i("xRange return",R),R})},pn=(y,_)=>(i("replaceStars",y,_),y.trim().replace(c[u.STAR],"")),hn=(y,_)=>(i("replaceGTE0",y,_),y.trim().replace(c[_.includePrerelease?u.GTE0PRE:u.GTE0],"")),fn=y=>(_,k,R,C,w,N,D,T,F,oe,ee,Xe)=>(L(R)?k="":L(C)?k=`>=${R}.0.0${y?"-0":""}`:L(w)?k=`>=${R}.${C}.0${y?"-0":""}`:N?k=`>=${k}`:k=`>=${k}${y?"-0":""}`,L(F)?T="":L(oe)?T=`<${+F+1}.0.0-0`:L(ee)?T=`<${F}.${+oe+1}.0-0`:Xe?T=`<=${F}.${oe}.${ee}-${Xe}`:y?T=`<${F}.${oe}.${+ee+1}-0`:T=`<=${T}`,`${k} ${T}`.trim()),mn=(y,_,k)=>{for(let R=0;R<y.length;R++)if(!y[R].test(_))return!1;if(_.prerelease.length&&!k.includePrerelease){for(let R=0;R<y.length;R++)if(i(y[R].semver),y[R].semver!==s.ANY&&y[R].semver.prerelease.length>0){const C=y[R].semver;if(C.major===_.major&&C.minor===_.minor&&C.patch===_.patch)return!0}return!1}return!0};return Gr}var Xr,ei;function St(){if(ei)return Xr;ei=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(l,f){if(f=r(f),l instanceof t){if(l.loose===!!f.loose)return l;l=l.value}l=l.trim().split(/\s+/).join(" "),i("comparator",l,f),this.options=f,this.loose=!!f.loose,this.parse(l),this.semver===e?this.value="":this.value=this.operator+this.semver.version,i("comp",this)}parse(l){const f=this.options.loose?n[o.COMPARATORLOOSE]:n[o.COMPARATOR],m=l.match(f);if(!m)throw new TypeError(`Invalid comparator: ${l}`);this.operator=m[1]!==void 0?m[1]:"",this.operator==="="&&(this.operator=""),m[2]?this.semver=new a(m[2],this.options.loose):this.semver=e}toString(){return this.value}test(l){if(i("Comparator.test",l,this.options.loose),this.semver===e||l===e)return!0;if(typeof l=="string")try{l=new a(l,this.options)}catch{return!1}return s(l,this.operator,this.semver,this.options)}intersects(l,f){if(!(l instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new c(l.value,f).test(this.value):l.operator===""?l.value===""?!0:new c(this.value,f).test(l.semver):(f=r(f),f.includePrerelease&&(this.value==="<0.0.0-0"||l.value==="<0.0.0-0")||!f.includePrerelease&&(this.value.startsWith("<0.0.0")||l.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&l.operator.startsWith(">")||this.operator.startsWith("<")&&l.operator.startsWith("<")||this.semver.version===l.semver.version&&this.operator.includes("=")&&l.operator.includes("=")||s(this.semver,"<",l.semver,f)&&this.operator.startsWith(">")&&l.operator.startsWith("<")||s(this.semver,">",l.semver,f)&&this.operator.startsWith("<")&&l.operator.startsWith(">")))}}Xr=t;const r=vr(),{safeRe:n,t:o}=We(),s=Hs(),i=_t(),a=ne(),c=le();return Xr}var Hr,ti;function Et(){if(ti)return Hr;ti=1;const e=le();return Hr=(r,n,o)=>{try{n=new e(n,o)}catch{return!1}return n.test(r)},Hr}var Yr,ri;function Id(){if(ri)return Yr;ri=1;const e=le();return Yr=(r,n)=>new e(r,n).set.map(o=>o.map(s=>s.value).join(" ").trim().split(" ")),Yr}var Kr,ni;function kd(){if(ni)return Kr;ni=1;const e=ne(),t=le();return Kr=(n,o,s)=>{let i=null,a=null,c=null;try{c=new t(o,s)}catch{return null}return n.forEach(u=>{c.test(u)&&(!i||a.compare(u)===-1)&&(i=u,a=new e(i,s))}),i},Kr}var Qr,oi;function Cd(){if(oi)return Qr;oi=1;const e=ne(),t=le();return Qr=(n,o,s)=>{let i=null,a=null,c=null;try{c=new t(o,s)}catch{return null}return n.forEach(u=>{c.test(u)&&(!i||a.compare(u)===1)&&(i=u,a=new e(i,s))}),i},Qr}var en,si;function Pd(){if(si)return en;si=1;const e=ne(),t=le(),r=yt();return en=(o,s)=>{o=new t(o,s);let i=new e("0.0.0");if(o.test(i)||(i=new e("0.0.0-0"),o.test(i)))return i;i=null;for(let a=0;a<o.set.length;++a){const c=o.set[a];let u=null;c.forEach(l=>{const f=new e(l.semver.version);switch(l.operator){case">":f.prerelease.length===0?f.patch++:f.prerelease.push(0),f.raw=f.format();case"":case">=":(!u||r(f,u))&&(u=f);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${l.operator}`)}}),u&&(!i||r(i,u))&&(i=u)}return i&&o.test(i)?i:null},en}var tn,ii;function Od(){if(ii)return tn;ii=1;const e=le();return tn=(r,n)=>{try{return new e(r,n).range||"*"}catch{return null}},tn}var rn,ai;function nn(){if(ai)return rn;ai=1;const e=ne(),t=St(),{ANY:r}=t,n=le(),o=Et(),s=yt(),i=Zr(),a=Fr(),c=Br();return rn=(l,f,m,g)=>{l=new e(l,g),f=new n(f,g);let P,b,O,Z,K;switch(m){case">":P=s,b=a,O=i,Z=">",K=">=";break;case"<":P=i,b=c,O=s,Z="<",K="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(o(l,f,g))return!1;for(let L=0;L<f.set.length;++L){const B=f.set[L];let Q=null,W=null;if(B.forEach(te=>{te.semver===r&&(te=new t(">=0.0.0")),Q=Q||te,W=W||te,P(te.semver,Q.semver,g)?Q=te:O(te.semver,W.semver,g)&&(W=te)}),Q.operator===Z||Q.operator===K||(!W.operator||W.operator===Z)&&b(l,W.semver))return!1;if(W.operator===K&&O(l,W.semver))return!1}return!0},rn}var on,ci;function Nd(){if(ci)return on;ci=1;const e=nn();return on=(r,n,o)=>e(r,n,">",o),on}var sn,ui;function zd(){if(ui)return sn;ui=1;const e=nn();return sn=(r,n,o)=>e(r,n,"<",o),sn}var an,li;function Ld(){if(li)return an;li=1;const e=le();return an=(r,n,o)=>(r=new e(r,o),n=new e(n,o),r.intersects(n,o)),an}var cn,pi;function Td(){if(pi)return cn;pi=1;const e=Et(),t=ue();return cn=(r,n,o)=>{const s=[];let i=null,a=null;const c=r.sort((m,g)=>t(m,g,o));for(const m of c)e(m,n,o)?(a=m,i||(i=m)):(a&&s.push([i,a]),a=null,i=null);i&&s.push([i,null]);const u=[];for(const[m,g]of s)m===g?u.push(m):!g&&m===c[0]?u.push("*"):g?m===c[0]?u.push(`<=${g}`):u.push(`${m} - ${g}`):u.push(`>=${m}`);const l=u.join(" || "),f=typeof n.raw=="string"?n.raw:String(n);return l.length<f.length?l:n},cn}var un,hi;function xd(){if(hi)return un;hi=1;const e=le(),t=St(),{ANY:r}=t,n=Et(),o=ue(),s=(f,m,g={})=>{if(f===m)return!0;f=new e(f,g),m=new e(m,g);let P=!1;e:for(const b of f.set){for(const O of m.set){const Z=c(b,O,g);if(P=P||Z!==null,Z)continue e}if(P)return!1}return!0},i=[new t(">=0.0.0-0")],a=[new t(">=0.0.0")],c=(f,m,g)=>{if(f===m)return!0;if(f.length===1&&f[0].semver===r){if(m.length===1&&m[0].semver===r)return!0;g.includePrerelease?f=i:f=a}if(m.length===1&&m[0].semver===r){if(g.includePrerelease)return!0;m=a}const P=new Set;let b,O;for(const z of f)z.operator===">"||z.operator===">="?b=u(b,z,g):z.operator==="<"||z.operator==="<="?O=l(O,z,g):P.add(z.semver);if(P.size>1)return null;let Z;if(b&&O){if(Z=o(b.semver,O.semver,g),Z>0)return null;if(Z===0&&(b.operator!==">="||O.operator!=="<="))return null}for(const z of P){if(b&&!n(z,String(b),g)||O&&!n(z,String(O),g))return null;for(const Ge of m)if(!n(z,String(Ge),g))return!1;return!0}let K,L,B,Q,W=O&&!g.includePrerelease&&O.semver.prerelease.length?O.semver:!1,te=b&&!g.includePrerelease&&b.semver.prerelease.length?b.semver:!1;W&&W.prerelease.length===1&&O.operator==="<"&&W.prerelease[0]===0&&(W=!1);for(const z of m){if(Q=Q||z.operator===">"||z.operator===">=",B=B||z.operator==="<"||z.operator==="<=",b){if(te&&z.semver.prerelease&&z.semver.prerelease.length&&z.semver.major===te.major&&z.semver.minor===te.minor&&z.semver.patch===te.patch&&(te=!1),z.operator===">"||z.operator===">="){if(K=u(b,z,g),K===z&&K!==b)return!1}else if(b.operator===">="&&!n(b.semver,String(z),g))return!1}if(O){if(W&&z.semver.prerelease&&z.semver.prerelease.length&&z.semver.major===W.major&&z.semver.minor===W.minor&&z.semver.patch===W.patch&&(W=!1),z.operator==="<"||z.operator==="<="){if(L=l(O,z,g),L===z&&L!==O)return!1}else if(O.operator==="<="&&!n(O.semver,String(z),g))return!1}if(!z.operator&&(O||b)&&Z!==0)return!1}return!(b&&B&&!O&&Z!==0||O&&Q&&!b&&Z!==0||te||W)},u=(f,m,g)=>{if(!f)return m;const P=o(f.semver,m.semver,g);return P>0?f:P<0||m.operator===">"&&f.operator===">="?m:f},l=(f,m,g)=>{if(!f)return m;const P=o(f.semver,m.semver,g);return P<0?f:P>0||m.operator==="<"&&f.operator==="<="?m:f};return un=s,un}var ln,fi;function qd(){if(fi)return ln;fi=1;const e=We(),t=bt(),r=ne(),n=As(),o=qe(),s=fd(),i=md(),a=dd(),c=gd(),u=vd(),l=bd(),f=_d(),m=yd(),g=ue(),P=Sd(),b=Ed(),O=zr(),Z=$d(),K=Ad(),L=yt(),B=Zr(),Q=Fs(),W=Ms(),te=Br(),z=Fr(),Ge=Hs(),pn=Rd(),hn=St(),fn=le(),mn=Et(),y=Id(),_=kd(),k=Cd(),R=Pd(),C=Od(),w=nn(),N=Nd(),D=zd(),T=Ld(),F=Td(),oe=xd();return ln={parse:o,valid:s,clean:i,inc:a,diff:c,major:u,minor:l,patch:f,prerelease:m,compare:g,rcompare:P,compareLoose:b,compareBuild:O,sort:Z,rsort:K,gt:L,lt:B,eq:Q,neq:W,gte:te,lte:z,cmp:Ge,coerce:pn,Comparator:hn,Range:fn,satisfies:mn,toComparators:y,maxSatisfying:_,minSatisfying:k,minVersion:R,validRange:C,outside:w,gtr:N,ltr:D,intersects:T,simplifyRange:F,subset:oe,SemVer:r,re:e.re,src:e.src,tokens:e.t,SEMVER_SPEC_VERSION:t.SEMVER_SPEC_VERSION,RELEASE_TYPES:t.RELEASE_TYPES,compareIdentifiers:n.compareIdentifiers,rcompareIdentifiers:n.rcompareIdentifiers},ln}var Zd=qd();const jd=(e,t)=>Dd(t)?t.hostnames.includes(new URL(e).hostname):Ud(t)?!!e.match(t.regexp):!1,Dd=e=>lr.safeParse(e).success,Ud=e=>pr.safeParse(e).success,Bd=(e,t)=>t?Zd.satisfies(e,t):!0,Vd=(e,t,r)=>Bd(t,r.libraryVersionRange)&&jd(e,r.matcher),Fd=(e,t)=>e.siteRegistrations.filter(r=>Vd(t,ur(),r)),Jd=(e,t)=>Fd(e,t).flatMap(({parsers:o,name:s})=>o.filter(i=>vs(i)&&i in cr).map(i=>({parser:cr[i],parserType:i,name:s}))),mi=(e,t)=>{const r=Jd(e,t.url);for(const{parser:n,parserType:o,name:s}of r){const i=n(t);if(lt(i)||jo(i)||Do(i))return{...i,meta:{parserName:s,parserType:o,uri:t.url,referrer:t.url}}}return{...xo(),meta:{parserName:null,parserType:x.NoResourceFound,uri:t.url,referrer:t.url}}},Md=(e,t)=>{const r=mi(e,t),{uri:n,...o}=r.meta;return{...r,meta:o}},Wd=(e,t)=>{switch(t){case _e.CA:return new URL(`https://${e}.rl.ca.talis.com`);default:return new URL(`https://${e}.rl.talis.com`)}},Gd=(e,t)=>{const r=Wd(e,t);return new URL("/ui/forms/bookmarklet.html",r)},Xd=(e,t,r)=>{const n=go(t);n.append("fast","true"),n.append("breakout","true"),r&&(r.parserName&&n.append("targetTitle",r.parserName),n.append("referrer",r.referrer));const o=new URL(e.toString());return o.search=n.toString(),o};v.BookGenresSchema=Rl,v.CustomerListSchema=So,v.CustomerSchema=Zt,v.DirectLinkOnlyResultSchema=Bt,v.Genre=E,v.HostnamesMatcherSchema=lr,v.JournalGenresSchema=wl,v.NON_OPENURL_PROPERTIES=xt,v.NonOpenUrlPropertiesSchema=Tt,v.NothingParsedResultSchema=Ut,v.OPENURL_KEYS=fo,v.OpenUrlAudioVisualResourceSchema=Cl,v.OpenUrlBookResourceSchema=Il,v.OpenUrlDocumentResourceSchema=Ol,v.OpenUrlImageResourceSchema=Pl,v.OpenUrlJournalResourceSchema=kl,v.OpenUrlResourceSchema=fe,v.OpenUrlResultSchema=Vt,v.OpenUrlWebpageResourceSchema=Nl,v.PARSERS=cr,v.ParserRegistrySchema=gs,v.ParserType=x,v.ParsingMetadataSchema=jt,v.ParsingMetadataV2Schema=Dt,v.ParsingRequestSchema=yo,v.ParsingResponseSchema=Ro,v.ParsingResponseV2Schema=wo,v.ParsingResultSchema=ct,v.REGISTRY=ad,v.RegExpMatcherSchema=pr,v.ResourceDataSchema=bs,v.ResourceSchema=uo,v.SiteRegistrationSchema=fr,v.SummonSearchResultSchema=Jt,v.TenantRegion=_e,v.TenantRegistrySchema=Zl,v.TenantSchema=qt,v.UrlMatcherSchema=hr,v.Z3988SearchResultSchema=Ft,v.convertCustomerListToTenantRegistry=Ul,v.createAudioVisual=me,v.createBook=Y,v.createDocument=po,v.createImage=lo,v.createJournal=j,v.createWebpage=at,v.directLinkOnly=Vl,v.fromOpenUrl=bo,v.getBaseBookmarkingUrl=Gd,v.getLibraryVersion=ur,v.isCustomer=Eo,v.isCustomerList=$o,v.isDirectLinkOnlyResult=nh,v.isGenre=ql,v.isNothingParsedResult=oh,v.isOpenUrlResult=lt,v.isParserRegistry=cd,v.isParserType=vs,v.isParsingMetadata=th,v.isParsingMetadataV2=rh,v.isParsingRequest=jl,v.isParsingResponse=Qp,v.isParsingResponseV2=eh,v.isParsingResult=Kp,v.isResourceData=hd,v.isSiteRegistration=ud,v.isSummonSearchResult=Do,v.isTenant=Ao,v.isTenantRegion=Dl,v.isUrlMatcher=ld,v.isZ3988SearchResult=jo,v.nothingParsed=q,v.openUrlResource=A,v.parseResource=mi,v.parseResourceV2=Md,v.summonSearchResult=ko,v.toBookmarkingWorkflowUrl=Xd,v.toOpenUrl=go,v.z3988SearchResult=Io,Object.defineProperty(v,Symbol.toStringTag,{value:"Module"})}));
20
+ `)}g.write("payload.value = newResult;"),g.write("return payload;");const K=g.compile();return(x,B)=>K(d,x,B)};let s;const i=Ke,a=!$n.jitless,u=a&&$i.value,l=t.catchall;let f;e._zod.parse=(d,g)=>{f??(f=n.value);const P=d.value;return i(P)?a&&u&&g?.async===!1&&g.jitless!==!0?(s||(s=o(t.shape)),d=s(d,g),l?Bn([],P,d,g,f,e):d):r(d,g):(d.issues.push({expected:"object",code:"invalid_type",input:P,inst:e}),d)}});function Vn(e,t,r,n){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const o=e.filter(s=>!ze(s));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(s=>s.issues.map(i=>be(i,n,ge())))}),t)}const pc=m("$ZodUnion",(e,t)=>{X.init(e,t),V(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),V(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),V(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),V(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>Pt(s.source)).join("|")})$`)}});const r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(o,s)=>{if(r)return n(o,s);let i=!1;const a=[];for(const c of t.options){const u=c._zod.run({value:o.value,issues:[]},s);if(u instanceof Promise)a.push(u),i=!0;else{if(u.issues.length===0)return u;a.push(u)}}return i?Promise.all(a).then(c=>Vn(c,o,e,s)):Vn(a,o,e,s)}}),hc=m("$ZodIntersection",(e,t)=>{X.init(e,t),e._zod.parse=(r,n)=>{const o=r.value,s=t.left._zod.run({value:o,issues:[]},n),i=t.right._zod.run({value:o,issues:[]},n);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([c,u])=>Fn(r,c,u)):Fn(r,s,i)}});function xt(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Oe(e)&&Oe(t)){const r=Object.keys(t),n=Object.keys(e).filter(s=>r.indexOf(s)!==-1),o={...e,...t};for(const s of n){const i=xt(e[s],t[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};o[s]=i.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let n=0;n<e.length;n++){const o=e[n],s=t[n],i=xt(o,s);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};r.push(i.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Fn(e,t,r){if(t.issues.length&&e.issues.push(...t.issues),r.issues.length&&e.issues.push(...r.issues),ze(e))return e;const n=xt(t.value,r.value);if(!n.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return e.value=n.data,e}const fc=m("$ZodRecord",(e,t)=>{X.init(e,t),e._zod.parse=(r,n)=>{const o=r.value;if(!Oe(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;const s=[];if(t.keyType._zod.values){const i=t.keyType._zod.values;r.value={};for(const c of i)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){const u=t.valueType._zod.run({value:o[c],issues:[]},n);u instanceof Promise?s.push(u.then(l=>{l.issues.length&&r.issues.push(...Le(c,l.issues)),r.value[c]=l.value})):(u.issues.length&&r.issues.push(...Le(c,u.issues)),r.value[c]=u.value)}let a;for(const c in o)i.has(c)||(a=a??[],a.push(c));a&&a.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:a})}else{r.value={};for(const i of Reflect.ownKeys(o)){if(i==="__proto__")continue;const a=t.keyType._zod.run({value:i,issues:[]},n);if(a instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(a.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:a.issues.map(u=>be(u,n,ge())),input:i,path:[i],inst:e}),r.value[a.value]=a.value;continue}const c=t.valueType._zod.run({value:o[i],issues:[]},n);c instanceof Promise?s.push(c.then(u=>{u.issues.length&&r.issues.push(...Le(i,u.issues)),r.value[a.value]=u.value})):(c.issues.length&&r.issues.push(...Le(i,c.issues)),r.value[a.value]=c.value)}}return s.length?Promise.all(s).then(()=>r):r}}),dc=m("$ZodEnum",(e,t)=>{X.init(e,t);const r=Si(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(o=>Ai.has(typeof o)).map(o=>typeof o=="string"?Ne(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{const i=o.value;return n.has(i)||o.issues.push({code:"invalid_value",values:r,input:i,inst:e}),o}}),mc=m("$ZodLiteral",(e,t)=>{if(X.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?Ne(r):r?Ne(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,n)=>{const o=r.value;return e._zod.values.has(o)||r.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),r}}),gc=m("$ZodTransform",(e,t)=>{X.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new En(e.constructor.name);const o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(i=>(r.value=i,r));if(o instanceof Promise)throw new Pe;return r.value=o,r}});function Jn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const vc=m("$ZodOptional",(e,t)=>{X.init(e,t),e._zod.optin="optional",e._zod.optout="optional",V(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),V(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${Pt(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>Jn(s,r.value)):Jn(o,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}}),bc=m("$ZodNullable",(e,t)=>{X.init(e,t),V(e._zod,"optin",()=>t.innerType._zod.optin),V(e._zod,"optout",()=>t.innerType._zod.optout),V(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${Pt(r.source)}|null)$`):void 0}),V(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)}),_c=m("$ZodDefault",(e,t)=>{X.init(e,t),e._zod.optin="optional",V(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>Mn(s,t)):Mn(o,t)}});function Mn(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const yc=m("$ZodPrefault",(e,t)=>{X.init(e,t),e._zod.optin="optional",V(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n))}),Sc=m("$ZodNonOptional",(e,t)=>{X.init(e,t),V(e._zod,"values",()=>{const r=t.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),e._zod.parse=(r,n)=>{const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>Wn(s,e)):Wn(o,e)}});function Wn(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Ec=m("$ZodCatch",(e,t)=>{X.init(e,t),V(e._zod,"optin",()=>t.innerType._zod.optin),V(e._zod,"optout",()=>t.innerType._zod.optout),V(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>(r.value=s.value,s.issues.length&&(r.value=t.catchValue({...r,error:{issues:s.issues.map(i=>be(i,n,ge()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(s=>be(s,n,ge()))},input:r.value}),r.issues=[]),r)}}),$c=m("$ZodPipe",(e,t)=>{X.init(e,t),V(e._zod,"values",()=>t.in._zod.values),V(e._zod,"optin",()=>t.in._zod.optin),V(e._zod,"optout",()=>t.out._zod.optout),V(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){const s=t.out._zod.run(r,n);return s instanceof Promise?s.then(i=>ot(i,t.in,n)):ot(s,t.in,n)}const o=t.in._zod.run(r,n);return o instanceof Promise?o.then(s=>ot(s,t.out,n)):ot(o,t.out,n)}});function ot(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const Ac=m("$ZodReadonly",(e,t)=>{X.init(e,t),V(e._zod,"propValues",()=>t.innerType._zod.propValues),V(e._zod,"values",()=>t.innerType._zod.values),V(e._zod,"optin",()=>t.innerType._zod.optin),V(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(Gn):Gn(o)}});function Gn(e){return e.value=Object.freeze(e.value),e}const Rc=m("$ZodCustom",(e,t)=>{se.init(e,t),X.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{const n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(s=>Xn(s,r,n,e));Xn(o,r,n,e)}});function Xn(e,t,r,n){if(!e){const o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(De(o))}}class wc{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){const n=r[0];if(this._map.set(t,n),n&&typeof n=="object"&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,t)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){const r=t._zod.parent;if(r){const n={...this.get(r)??{}};delete n.id;const o={...n,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function Ic(){return new wc}const st=Ic();function kc(e,t){return new e({type:"string",...A(t)})}function Cc(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...A(t)})}function Hn(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...A(t)})}function Pc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...A(t)})}function Oc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...A(t)})}function Nc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...A(t)})}function zc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...A(t)})}function Yn(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...A(t)})}function Lc(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...A(t)})}function xc(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...A(t)})}function Tc(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...A(t)})}function qc(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...A(t)})}function Dc(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...A(t)})}function Zc(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...A(t)})}function jc(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...A(t)})}function Uc(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...A(t)})}function Bc(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...A(t)})}function Vc(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...A(t)})}function Fc(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...A(t)})}function Jc(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...A(t)})}function Mc(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...A(t)})}function Wc(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...A(t)})}function Gc(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...A(t)})}function Xc(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...A(t)})}function Hc(e,t){return new e({type:"string",format:"date",check:"string_format",...A(t)})}function Yc(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...A(t)})}function Kc(e,t){return new e({type:"string",format:"duration",check:"string_format",...A(t)})}function Qc(e,t){return new e({type:"number",checks:[],...A(t)})}function eu(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...A(t)})}function tu(e,t){return new e({type:"null",...A(t)})}function ru(e){return new e({type:"unknown"})}function nu(e,t){return new e({type:"never",...A(t)})}function Kn(e,t){return new Tn({check:"less_than",...A(t),value:e,inclusive:!1})}function Tt(e,t){return new Tn({check:"less_than",...A(t),value:e,inclusive:!0})}function Qn(e,t){return new qn({check:"greater_than",...A(t),value:e,inclusive:!1})}function qt(e,t){return new qn({check:"greater_than",...A(t),value:e,inclusive:!0})}function eo(e,t){return new _a({check:"multiple_of",...A(t),value:e})}function to(e,t){return new Sa({check:"max_length",...A(t),maximum:e})}function it(e,t){return new Ea({check:"min_length",...A(t),minimum:e})}function ro(e,t){return new $a({check:"length_equals",...A(t),length:e})}function ou(e,t){return new Aa({check:"string_format",format:"regex",...A(t),pattern:e})}function su(e){return new Ra({check:"string_format",format:"lowercase",...A(e)})}function iu(e){return new wa({check:"string_format",format:"uppercase",...A(e)})}function au(e,t){return new Ia({check:"string_format",format:"includes",...A(t),includes:e})}function cu(e,t){return new ka({check:"string_format",format:"starts_with",...A(t),prefix:e})}function uu(e,t){return new Ca({check:"string_format",format:"ends_with",...A(t),suffix:e})}function Ze(e){return new Pa({check:"overwrite",tx:e})}function lu(e){return Ze(t=>t.normalize(e))}function pu(){return Ze(e=>e.trim())}function hu(){return Ze(e=>e.toLowerCase())}function fu(){return Ze(e=>e.toUpperCase())}function du(e,t,r){return new e({type:"array",element:t,...A(r)})}function mu(e,t,r){const n=A(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}function gu(e,t,r){return new e({type:"custom",check:"custom",fn:t,...A(r)})}function vu(e){const t=bu(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(De(n,r.value,t._zod.def));else{const o=n;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),r.issues.push(De(o))}},e(r.value,r)));return t}function bu(e,t){const r=new se({check:"custom",...A(t)});return r._zod.check=e,r}const _u=m("ZodISODateTime",(e,t)=>{Fa.init(e,t),H.init(e,t)});function yu(e){return Xc(_u,e)}const Su=m("ZodISODate",(e,t)=>{Ja.init(e,t),H.init(e,t)});function Eu(e){return Hc(Su,e)}const $u=m("ZodISOTime",(e,t)=>{Ma.init(e,t),H.init(e,t)});function Au(e){return Yc($u,e)}const Ru=m("ZodISODuration",(e,t)=>{Wa.init(e,t),H.init(e,t)});function wu(e){return Kc(Ru,e)}const ae=m("ZodError",(e,t)=>{Cn.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>xi(e,r)},flatten:{value:r=>Li(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,It,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,It,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Iu=Nt(ae),ku=zt(ae),Cu=et(ae),Pu=tt(ae),Ou=Di(ae),Nu=Zi(ae),zu=ji(ae),Lu=Ui(ae),xu=Bi(ae),Tu=Vi(ae),qu=Fi(ae),Du=Ji(ae),Y=m("ZodType",(e,t)=>(X.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(Re(t,{checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]})),e.clone=(r,n)=>ve(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.parse=(r,n)=>Iu(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>Cu(e,r,n),e.parseAsync=async(r,n)=>ku(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>Pu(e,r,n),e.spa=e.safeParseAsync,e.encode=(r,n)=>Ou(e,r,n),e.decode=(r,n)=>Nu(e,r,n),e.encodeAsync=async(r,n)=>zu(e,r,n),e.decodeAsync=async(r,n)=>Lu(e,r,n),e.safeEncode=(r,n)=>xu(e,r,n),e.safeDecode=(r,n)=>Tu(e,r,n),e.safeEncodeAsync=async(r,n)=>qu(e,r,n),e.safeDecodeAsync=async(r,n)=>Du(e,r,n),e.refine=(r,n)=>e.check(Cl(r,n)),e.superRefine=r=>e.check(Pl(r)),e.overwrite=r=>e.check(Ze(r)),e.optional=()=>he(e),e.nullable=()=>ho(e),e.nullish=()=>he(ho(e)),e.nonoptional=r=>El(e,r),e.array=()=>U(e),e.or=r=>pe([e,r]),e.and=r=>hl(e,r),e.transform=r=>mo(e,gl(r)),e.default=r=>_l(e,r),e.prefault=r=>Sl(e,r),e.catch=r=>Al(e,r),e.pipe=r=>mo(e,r),e.readonly=()=>Il(e),e.describe=r=>{const n=e.clone();return st.add(n,{description:r}),n},Object.defineProperty(e,"description",{get(){return st.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return st.get(e);const n=e.clone();return st.add(n,r[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),no=m("_ZodString",(e,t)=>{Lt.init(e,t),Y.init(e,t);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...n)=>e.check(ou(...n)),e.includes=(...n)=>e.check(au(...n)),e.startsWith=(...n)=>e.check(cu(...n)),e.endsWith=(...n)=>e.check(uu(...n)),e.min=(...n)=>e.check(it(...n)),e.max=(...n)=>e.check(to(...n)),e.length=(...n)=>e.check(ro(...n)),e.nonempty=(...n)=>e.check(it(1,...n)),e.lowercase=n=>e.check(su(n)),e.uppercase=n=>e.check(iu(n)),e.trim=()=>e.check(pu()),e.normalize=(...n)=>e.check(lu(...n)),e.toLowerCase=()=>e.check(hu()),e.toUpperCase=()=>e.check(fu())}),Zu=m("ZodString",(e,t)=>{Lt.init(e,t),no.init(e,t),e.email=r=>e.check(Cc(ju,r)),e.url=r=>e.check(Yn(so,r)),e.jwt=r=>e.check(Gc(rl,r)),e.emoji=r=>e.check(Lc(Bu,r)),e.guid=r=>e.check(Hn(oo,r)),e.uuid=r=>e.check(Pc(at,r)),e.uuidv4=r=>e.check(Oc(at,r)),e.uuidv6=r=>e.check(Nc(at,r)),e.uuidv7=r=>e.check(zc(at,r)),e.nanoid=r=>e.check(xc(Vu,r)),e.guid=r=>e.check(Hn(oo,r)),e.cuid=r=>e.check(Tc(Fu,r)),e.cuid2=r=>e.check(qc(Ju,r)),e.ulid=r=>e.check(Dc(Mu,r)),e.base64=r=>e.check(Jc(Qu,r)),e.base64url=r=>e.check(Mc(el,r)),e.xid=r=>e.check(Zc(Wu,r)),e.ksuid=r=>e.check(jc(Gu,r)),e.ipv4=r=>e.check(Uc(Xu,r)),e.ipv6=r=>e.check(Bc(Hu,r)),e.cidrv4=r=>e.check(Vc(Yu,r)),e.cidrv6=r=>e.check(Fc(Ku,r)),e.e164=r=>e.check(Wc(tl,r)),e.datetime=r=>e.check(yu(r)),e.date=r=>e.check(Eu(r)),e.time=r=>e.check(Au(r)),e.duration=r=>e.check(wu(r))});function h(e){return kc(Zu,e)}const H=m("ZodStringFormat",(e,t)=>{J.init(e,t),no.init(e,t)}),ju=m("ZodEmail",(e,t)=>{xa.init(e,t),H.init(e,t)}),oo=m("ZodGUID",(e,t)=>{za.init(e,t),H.init(e,t)}),at=m("ZodUUID",(e,t)=>{La.init(e,t),H.init(e,t)}),so=m("ZodURL",(e,t)=>{Ta.init(e,t),H.init(e,t)});function Uu(e){return Yn(so,e)}const Bu=m("ZodEmoji",(e,t)=>{qa.init(e,t),H.init(e,t)}),Vu=m("ZodNanoID",(e,t)=>{Da.init(e,t),H.init(e,t)}),Fu=m("ZodCUID",(e,t)=>{Za.init(e,t),H.init(e,t)}),Ju=m("ZodCUID2",(e,t)=>{ja.init(e,t),H.init(e,t)}),Mu=m("ZodULID",(e,t)=>{Ua.init(e,t),H.init(e,t)}),Wu=m("ZodXID",(e,t)=>{Ba.init(e,t),H.init(e,t)}),Gu=m("ZodKSUID",(e,t)=>{Va.init(e,t),H.init(e,t)}),Xu=m("ZodIPv4",(e,t)=>{Ga.init(e,t),H.init(e,t)}),Hu=m("ZodIPv6",(e,t)=>{Xa.init(e,t),H.init(e,t)}),Yu=m("ZodCIDRv4",(e,t)=>{Ha.init(e,t),H.init(e,t)}),Ku=m("ZodCIDRv6",(e,t)=>{Ya.init(e,t),H.init(e,t)}),Qu=m("ZodBase64",(e,t)=>{Ka.init(e,t),H.init(e,t)}),el=m("ZodBase64URL",(e,t)=>{ec.init(e,t),H.init(e,t)}),tl=m("ZodE164",(e,t)=>{tc.init(e,t),H.init(e,t)}),rl=m("ZodJWT",(e,t)=>{nc.init(e,t),H.init(e,t)}),io=m("ZodNumber",(e,t)=>{Zn.init(e,t),Y.init(e,t),e.gt=(n,o)=>e.check(Qn(n,o)),e.gte=(n,o)=>e.check(qt(n,o)),e.min=(n,o)=>e.check(qt(n,o)),e.lt=(n,o)=>e.check(Kn(n,o)),e.lte=(n,o)=>e.check(Tt(n,o)),e.max=(n,o)=>e.check(Tt(n,o)),e.int=n=>e.check(co(n)),e.safe=n=>e.check(co(n)),e.positive=n=>e.check(Qn(0,n)),e.nonnegative=n=>e.check(qt(0,n)),e.negative=n=>e.check(Kn(0,n)),e.nonpositive=n=>e.check(Tt(0,n)),e.multipleOf=(n,o)=>e.check(eo(n,o)),e.step=(n,o)=>e.check(eo(n,o)),e.finite=()=>e;const r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function ao(e){return Qc(io,e)}const nl=m("ZodNumberFormat",(e,t)=>{oc.init(e,t),io.init(e,t)});function co(e){return eu(nl,e)}const ol=m("ZodNull",(e,t)=>{sc.init(e,t),Y.init(e,t)});function ct(e){return tu(ol,e)}const sl=m("ZodUnknown",(e,t)=>{ic.init(e,t),Y.init(e,t)});function uo(){return ru(sl)}const il=m("ZodNever",(e,t)=>{ac.init(e,t),Y.init(e,t)});function al(e){return nu(il,e)}const cl=m("ZodArray",(e,t)=>{cc.init(e,t),Y.init(e,t),e.element=t.element,e.min=(r,n)=>e.check(it(r,n)),e.nonempty=r=>e.check(it(1,r)),e.max=(r,n)=>e.check(to(r,n)),e.length=(r,n)=>e.check(ro(r,n)),e.unwrap=()=>e.element});function U(e,t){return du(cl,e,t)}const ul=m("ZodObject",(e,t)=>{lc.init(e,t),Y.init(e,t),V(e,"shape",()=>t.shape),e.keyof=()=>je(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:uo()}),e.loose=()=>e.clone({...e._zod.def,catchall:uo()}),e.strict=()=>e.clone({...e._zod.def,catchall:al()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>Ci(e,r),e.safeExtend=r=>Pi(e,r),e.merge=r=>Oi(e,r),e.pick=r=>Ii(e,r),e.omit=r=>ki(e,r),e.partial=(...r)=>Ni(po,e,r[0]),e.required=(...r)=>zi(fo,e,r[0])});function I(e,t){const r={type:"object",shape:e??{},...A(t)};return new ul(r)}const ll=m("ZodUnion",(e,t)=>{pc.init(e,t),Y.init(e,t),e.options=t.options});function pe(e,t){return new ll({type:"union",options:e,...A(t)})}const pl=m("ZodIntersection",(e,t)=>{hc.init(e,t),Y.init(e,t)});function hl(e,t){return new pl({type:"intersection",left:e,right:t})}const fl=m("ZodRecord",(e,t)=>{fc.init(e,t),Y.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function lo(e,t,r){return new fl({type:"record",keyType:e,valueType:t,...A(r)})}const Dt=m("ZodEnum",(e,t)=>{dc.init(e,t),Y.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(n,o)=>{const s={};for(const i of n)if(r.has(i))s[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new Dt({...t,checks:[],...A(o),entries:s})},e.exclude=(n,o)=>{const s={...t.entries};for(const i of n)if(r.has(i))delete s[i];else throw new Error(`Key ${i} not found in enum`);return new Dt({...t,checks:[],...A(o),entries:s})}});function je(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Dt({type:"enum",entries:r,...A(t)})}const dl=m("ZodLiteral",(e,t)=>{mc.init(e,t),Y.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function M(e,t){return new dl({type:"literal",values:Array.isArray(e)?e:[e],...A(t)})}const ml=m("ZodTransform",(e,t)=>{gc.init(e,t),Y.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new En(e.constructor.name);r.addIssue=s=>{if(typeof s=="string")r.issues.push(De(s,r.value,t));else{const i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=r.value),i.inst??(i.inst=e),r.issues.push(De(i))}};const o=t.transform(r.value,r);return o instanceof Promise?o.then(s=>(r.value=s,r)):(r.value=o,r)}});function gl(e){return new ml({type:"transform",transform:e})}const po=m("ZodOptional",(e,t)=>{vc.init(e,t),Y.init(e,t),e.unwrap=()=>e._zod.def.innerType});function he(e){return new po({type:"optional",innerType:e})}const vl=m("ZodNullable",(e,t)=>{bc.init(e,t),Y.init(e,t),e.unwrap=()=>e._zod.def.innerType});function ho(e){return new vl({type:"nullable",innerType:e})}const bl=m("ZodDefault",(e,t)=>{_c.init(e,t),Y.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function _l(e,t){return new bl({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():In(t)}})}const yl=m("ZodPrefault",(e,t)=>{yc.init(e,t),Y.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Sl(e,t){return new yl({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():In(t)}})}const fo=m("ZodNonOptional",(e,t)=>{Sc.init(e,t),Y.init(e,t),e.unwrap=()=>e._zod.def.innerType});function El(e,t){return new fo({type:"nonoptional",innerType:e,...A(t)})}const $l=m("ZodCatch",(e,t)=>{Ec.init(e,t),Y.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Al(e,t){return new $l({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Rl=m("ZodPipe",(e,t)=>{$c.init(e,t),Y.init(e,t),e.in=t.in,e.out=t.out});function mo(e,t){return new Rl({type:"pipe",in:e,out:t})}const wl=m("ZodReadonly",(e,t)=>{Ac.init(e,t),Y.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Il(e){return new wl({type:"readonly",innerType:e})}const go=m("ZodCustom",(e,t)=>{Rc.init(e,t),Y.init(e,t)});function kl(e,t){return mu(go,e??(()=>!0),t)}function Cl(e,t={}){return gu(go,e,t)}function Pl(e){return vu(e)}var S=(e=>(e.Article="article",e.AudioDocument="audiodocument",e.AudioVisualDocument="audiovisualdocument",e.Book="book",e.Bookitem="bookitem",e.Conference="conference",e.Document="document",e.Image="image",e.Issue="issue",e.Journal="journal",e.Preprint="preprint",e.Proceeding="proceeding",e.Report="report",e.Unknown="unknown",e.Webpage="webpage",e))(S||{});const Ol=pe([M("book"),M("bookitem"),M("conference"),M("document"),M("report"),M("proceeding"),M("unknown")]),Nl=pe([M("article"),M("conference"),M("issue"),M("journal"),M("preprint"),M("proceeding"),M("unknown")]),de=I({artnum:h(),atitle:h(),aufirst:h(),aulast:h(),auinit:h(),auinit1:h(),auinitm:h(),ausuffix:h(),au:U(h()),aucorp:h(),bici:h(),btitle:h(),chron:h(),coden:h(),date:h(),edition:h(),eissn:h(),epage:h(),externalDBID:h(),externalDocID:h(),genre:je(S),id:h(),isbn:h(),issn:h(),issue:h(),jtitle:h(),pages:h(),part:h(),place:h(),pub:h(),quarter:h(),rft_id:U(h()),series:h(),sici:h(),spage:h(),ssn:h(),stitle:h(),title:h(),tpages:h(),volume:h()}).partial(),Zt=I({bibid:h(),doi:h(),uri:h()}).partial(),zl=de.pick({atitle:!0,aufirst:!0,aulast:!0,auinit:!0,auinit1:!0,auinitm:!0,ausuffix:!0,au:!0,aucorp:!0,bici:!0,btitle:!0,date:!0,edition:!0,epage:!0,id:!0,isbn:!0,issn:!0,pages:!0,place:!0,pub:!0,rft_id:!0,title:!0,tpages:!0,series:!0,spage:!0}).partial(),Ll=de.pick({artnum:!0,atitle:!0,aufirst:!0,aulast:!0,auinit:!0,auinit1:!0,auinitm:!0,ausuffix:!0,au:!0,aucorp:!0,chron:!0,coden:!0,date:!0,epage:!0,id:!0,isbn:!0,eissn:!0,issn:!0,issue:!0,title:!0,jtitle:!0,pages:!0,part:!0,pub:!0,rft_id:!0,sici:!0,spage:!0,stitle:!0,ssn:!0,quarter:!0,volume:!0}).partial(),xl=de.pick({au:!0,date:!0,isbn:!0,pub:!0,title:!0}).partial(),Tl=de.pick({au:!0,date:!0,pub:!0,title:!0}).partial(),ql=de.pick({au:!0,date:!0,pub:!0,title:!0,spage:!0,epage:!0}).partial(),Dl=de.pick({au:!0,date:!0,title:!0}).partial(),vo=I({...de.shape,...Zt.shape}),W=(e,t)=>({...t,genre:e}),Z=(e,t)=>({...t,genre:e}),fe=e=>({...e,genre:S.AudioVisualDocument}),bo=e=>({...e,genre:S.Image}),jt=e=>({...e,genre:S.Document}),ut=e=>({...e,genre:S.Webpage}),_o=e=>Object.keys(e.shape),yo=_o(de),Ut=_o(Zt),Zl=(e,t,r)=>{if(r.length>0&&typeof r[0]=="string"){const n=t.startsWith("rft_")?t:`rft.${t}`;e.append(n,r[0])}},jl=(e,t,r)=>{e.append(t,r)},Ul=(e,t,r)=>{e.append(`rft.${t}`,r)},So=e=>Ut.includes(e),Eo=e=>{const t=new URLSearchParams;return Object.entries(e).forEach(([r,n])=>{Array.isArray(n)?Zl(t,r,n):typeof n=="string"&&n&&(So(r)?jl(t,r,n):Ul(t,r,n))}),t},$o=(e,t,r,n)=>{const o=t.getAll(r).filter(s=>!!s).map(s=>s.trim());return o.length===0?e:{...e,[n]:o}},Ao=e=>{const t=Bl(e),r=(o,s)=>{if(s==="au")return $o(o,t,"rft.au","au");if(s==="rft_id")return $o(o,t,"rft_id","rft_id");const i=So(s)?s:`rft.${s}`,a=t.get(i);return a?{...o,[s]:a.trim()}:o},n=[...yo,...Ut].reduce(r,{});return Object.keys(n).length===0?null:n},Bl=e=>URL.canParse(e)?new URL(e).searchParams:new URLSearchParams(e);function Vl(e){return typeof e!="string"?!1:Object.values(S).includes(e)}var _e=(e=>(e.CA="CA",e.EUAPAC="EUAPAC",e))(_e||{});const Bt=I({id:h(),name:h(),region:je(_e)}),Fl=I({tenants:U(Bt)}),Ro=9*1024*1024,wo=I({url:Uu({error:e=>e.input===void 0?'should have the required string property "url"':'"url" must be a string'}),html:h({error:e=>e.input===void 0?'should have the required string property "html"':void 0}).max(Ro,{error:`"html" should be a string with a MAX Length of ${Ro}`}),tenantCode:h({error:e=>e.input===void 0?'should have the required string property "tenantCode"':void 0}).min(1,{error:'"tenantCode" must be a string'}),region:je([_e.EUAPAC,_e.CA],{error:e=>e.input===void 0?'should have the required string property "region"':'"region" must be a string of EUAPAC or CA'})});function Jl(e){return wo.safeParse(e).success}const Vt=I({name:h(),region:je(_e),apps:lo(h(),h())}),Io=lo(h(),Vt),ko=e=>Vt.safeParse(e).success,Co=e=>Io.safeParse(e).success;function Po(e){return Bt.safeParse(e).success}function Ml(e){return typeof e=="string"&&Object.keys(_e).includes(e)}const Wl=e=>{if(!Co(e))throw new Error("Error: the customer list data is invalid.");return{tenants:Object.entries(e).map(([r,n])=>Gl(r,n))}},Gl=(e,t)=>{if(!ko(t))throw new Error(`Invalid customer: ${t}`);const{name:r,region:n}=t,o={id:e,name:r,region:n};if(!Po(o))throw new Error(`Invalid tenant: ${JSON.stringify(o)}`);return o},Ft=I({parserType:h(),parserName:h().nullable(),uri:h(),referrer:h()}),Jt=I({parserType:h(),parserName:h().nullable(),referrer:h()}),Mt=I({bookmarkingWorkflowUrl:ct(),resource:ct()}),Wt=I({bookmarkingWorkflowUrl:h(),resource:ct()}),Gt=I({bookmarkingWorkflowUrl:ct(),resource:vo}),Xt=I({z3988SearchResult:M(!0)}),Ht=I({summonSearchResult:M(!0)}),lt=pe([Wt,Mt,Gt,Xt,Ht]),Oo=I({meta:Ft}).and(lt),No=I({meta:Jt}).and(lt);function Xl(e){return{bookmarkingWorkflowUrl:e,resource:null}}function q(){return{bookmarkingWorkflowUrl:null,resource:null}}function $(e){return{bookmarkingWorkflowUrl:null,resource:e}}function zo(){return{z3988SearchResult:!0}}function Lo(){return{summonSearchResult:!0}}const Hl=e=>{const t=e.getAttribute("title");return t?Ao(t):null},Yt=({document:e})=>{const t=Array.from(e.querySelectorAll(".Z3988"));if(t.length===0)return q();const r=t.map(Hl).find(n=>n!==null);return r?$(r):q()},Yl=e=>{const t=Array.from(e.querySelectorAll(".author > a")).map(r=>r.textContent.trim()).filter(Boolean);return t.length?t:void 0},Kl=e=>e.querySelector("#rpi-attribute-book_details-edition > .rpi-attribute-value > span")?.textContent??void 0,Ql=e=>{const t=e.querySelector("#rpi-attribute-book_details-isbn10 > .rpi-attribute-value > span")?.textContent??void 0,r=e.querySelector("#rpi-attribute-book_details-isbn13 > .rpi-attribute-value > span")?.textContent??void 0;if(t&&r)return`${t},${r}`;if(t)return t;if(r)return r},ep=e=>e.querySelector("#rpi-attribute-book_details-publication_date > .rpi-attribute-value > span")?.textContent??void 0,tp=e=>e.querySelector("#rpi-attribute-book_details-publisher > .rpi-attribute-value > span")?.textContent??void 0,rp=e=>e.querySelector("#rpi-attribute-book_details-series > .rpi-attribute-value > a")?.textContent??void 0,np=e=>{const t=e.querySelector("#rpi-attribute-book_details-fiona_pages > .rpi-attribute-value > span")?.textContent??void 0;return(t?/\d+/.exec(t)?.[0]:null)??void 0},op=({url:e,document:t})=>{const r=Yl(t),n=Kl(t),o=Ql(t),s=ep(t),i=tp(t),a=rp(t),c=t.getElementById("productTitle")?.textContent.trim()??void 0,u=np(t);return{bookmarkingWorkflowUrl:null,resource:W(S.Book,{au:r,date:s,edition:n,isbn:o,pub:i,series:a,title:c,tpages:u,uri:e})}},p=(e,t,r)=>{const n=re(e,t,r);return n.length>0?n[0]:void 0},re=(e,t,r)=>Array.from(e.querySelectorAll(`meta[${t}='${r}']`)).map(n=>n.getAttribute("content")).filter(n=>!!n?.trim()),xo=e=>{const t=new Map,r=e.split(";").filter(n=>!!n);for(const n of r){const[o,s,i]=n.split(":");t.set(o,{type:s,value:i})}return t};var _=(e=>(e[e.None=0]="None",e[e.Book=1]="Book",e[e.Chapter=2]="Chapter",e[e.Journal=3]="Journal",e[e.Article=4]="Article",e[e.AudioVisual=5]="AudioVisual",e[e.Webpage=6]="Webpage",e[e.Document=7]="Document",e))(_||{});const sp=e=>{if(!e)return;const t=/\b\d{4}\b/.exec(e);return t?t[0]:void 0},Ue=e=>{const t=e.querySelector("#publication_date p")?.textContent.trim()??p(e,"name","bepress_citation_date");return sp(t)},ip=e=>{const t=p(e,"name","bepress_citation_firstpage"),r=p(e,"name","bepress_citation_lastpage");return{spage:t,epage:r}},Kt=e=>{const t=/https?:\/\/doi\.org\/(.+)/i,n=e.querySelector("#source p")?.textContent.trim()?.match(t);if(n&&n.length===2)return n[1];const s=e.querySelector("#recommended_citation p a")?.textContent.trim()?.match(t);if(s&&s.length===2)return s[1]},ap=e=>{const t=[],r=e.querySelectorAll("tbody td");for(const n of r){const o=n.querySelector("strong");if(o&&!o.querySelector("a")){const s=o.textContent.trim();s&&t.push(s)}}return t},Be=e=>p(e,"name","bepress_citation_title")??e.querySelector("title")?.textContent.trim(),pt=e=>re(e,"name","author"),ht=e=>p(e,"name","bepress_citation_publisher"),Qt=e=>p(e,"name","bepress_citation_pdf_url"),cp=(e,t)=>{if(t.includes("/etd/"))return _.Document;if(t.includes("/sophpm_music/")||t.includes("/streaming/"))return _.AudioVisual;if(t.includes("/vol"))return _.Article;if(t.includes("/facpub")||t.includes("/studentpub/")){const r={"book chapter":_.Book,"conference paper":_.Book,"peer-reviewed article":_.Article,other:_.Document},n=e.querySelector("#document_type p")?.textContent.toLowerCase().trim();return n?r[n]:void 0}return _.Journal},up=e=>{const t=Be(e),r=pt(e),n=Ue(e),o=p(e,"name","bepress_citation_journal_title"),s=p(e,"name","bepress_citation_volume"),i=p(e,"name","bepress_citation_issue"),{epage:a,spage:c}=ip(e),u=Qt(e),l=Kt(e);return Z(S.Article,{atitle:t,jtitle:o,au:r,date:n,volume:s,issue:i,epage:a,spage:c,doi:l,uri:u})},lp=(e,t)=>{const r=e.querySelector(".inherit-title a")?.textContent.trim()??Be(e),n=ap(e),o=Ue(e),s=ht(e),i=Kt(e);return Z(S.Journal,{jtitle:r,au:n,date:o,pub:s,doi:i,uri:t})},pp=e=>{const t=Be(e),r=pt(e),n=Ue(e),o=ht(e),s=Qt(e),i=e.querySelector("#document_type p")?.textContent.toLowerCase().trim();if(i==="book chapter"){const c=e.querySelector("#source p")?.textContent.trim();return W(S.Bookitem,{pub:o,atitle:t,btitle:c,au:r,date:n,uri:s})}const a=Kt(e);return i==="conference paper"?W(S.Conference,{pub:o,title:t,au:r,date:n,doi:a,uri:s}):W(S.Document,{pub:o,title:t,au:r,date:n,doi:a,uri:s})},hp=(e,t)=>{const r=Be(e),n=pt(e),o=Ue(e),s=ht(e);return fe({title:r,au:n,date:o,pub:s,uri:t})},fp=e=>{const t=Be(e),r=pt(e),n=Ue(e),o=ht(e),s=Qt(e);return jt({pub:o,title:t,au:r,date:n,uri:s})},dp=({url:e,document:t})=>{switch(cp(t,e)){case _.Article:return $(up(t));case _.Journal:return $(lp(t,e));case _.Book:return $(pp(t));case _.AudioVisual:return $(hp(t,e));case _.Document:return $(fp(t));default:return q()}},me=e=>{if(e)return e.replace(/[^0-9]/g,"")},To=e=>Array.from(e.querySelectorAll(".author-source-list li a")).filter(t=>t.childNodes.length>0).map(t=>t.childNodes[0].textContent?.trim()).filter(t=>!!t),qo=e=>e.querySelector(".article-header")?.querySelector("h1 span")?.textContent.trim(),Do=e=>({date:e?.textContent.match(/\d{4}/)?.[0],pub:"Elsevier Inc."}),mp=e=>{const t=e.querySelector(".article-meta");if(!t)return{};const r=t.querySelector(".issue")?.textContent??void 0,n=t.querySelector(".title")?.textContent.trim()??void 0,[o,s]=(r?.split(",")??[]).map(i=>i.trim());return{volume:me(o),issue:me(s),jtitle:n}},gp=e=>{const t=e.querySelector(".article-header .source")?.textContent,r=t?.match(/\d{4}-\d{2}-\d{2}/)?.[0],n=t?.match(/Pages (\d+-\d+)/),[o,s]=(n?.[1].split("-")??[]).map(u=>u.trim()),{jtitle:i,volume:a,issue:c}=mp(e);return $(Z(S.Article,{au:To(e),atitle:qo(e),spage:o,epage:s,date:r,jtitle:i,volume:a,issue:c}))},vp=e=>{const[t,r]=e.querySelectorAll(".source"),{date:n,pub:o}=Do(r),s=e.querySelector(".browse__book-toc"),[i,a]=(s?.querySelector("h1")?.textContent.split(",")??[]).map(c=>c.trim());return $(W(S.Book,{btitle:i,edition:a,pub:o,au:t.textContent?[t.textContent]:void 0,date:n}))},bp=e=>{const t=e.querySelector(".article-meta");if(!t)return{};const r=t.querySelector(".edition")?.textContent??void 0,n=t.querySelector(".title")?.textContent.trim()??void 0,o=t.querySelector(".copyright"),{date:s,pub:i}=Do(o);return{edition:r,btitle:n,date:s,pub:i}},_p=e=>{const{edition:t,btitle:r,date:n,pub:o}=bp(e),s=e.querySelector(".article-header .source")?.textContent,i=/(\d+-\d+|[IVXLCDM]+-[IVXLCDM]+)/i,a=s?.match(i),[c,u]=(a?.[1].split("-")??[]).map(l=>l.trim());return $(W(S.Bookitem,{au:To(e),atitle:qo(e),btitle:r,edition:t,pub:o,date:n,spage:c,epage:u}))},yp=/^[0-9X]$/,er=e=>{if(!e)return;let t="";for(const r of e)yp.test(r)&&(t+=r);if(t)return t},Sp=(e,t)=>{const r=e.querySelector(".c-cksc-content-header__title")?.textContent.trim(),n=e.querySelector(".c-cksc-content-nice__button")?.textContent.trim(),o=e.querySelector(".c-cksc-content-nice__date")?.textContent.trim(),s=e.evaluate('//p[contains(text(), "ISBN")]',e,null,XPathResult.ANY_TYPE),i=er(s.iterateNext()?.textContent);return $({genre:S.Document,title:r,pub:n,date:o,uri:t,isbn:i})},Zo=e=>e.querySelector(".browse-toc")??e.querySelector(".browse__journal"),Ep=e=>Zo(e)?.querySelector("h1")?.firstElementChild?.textContent.trim(),$p=e=>{const t=Zo(e),r=t?.querySelector("figure figcaption.source");if(r){const[a,c,u]=r.textContent.split(",").map(l=>l.trim());return{date:a,volume:me(c),issue:me(u)}}const n=t?.querySelector("p")?.textContent,[o,s]=n?.split(",")??[];return{date:t?.querySelector(".source span")?.textContent??void 0,volume:me(o),issue:me(s)}},Ap=e=>{const{date:t,volume:r,issue:n}=$p(e);return $(Z(S.Journal,{jtitle:Ep(e),date:t,volume:r,issue:n}))};var jo=(e=>(e.Book="Book",e.Chapter="Book Chapter",e.Article="Full Text Article",e.Journal="Journal",e.Guideline="Guideline",e))(jo||{});const Rp=e=>Object.values(jo).includes(e),wp=(e,t)=>{const r=e.querySelector(".content-type")??e.querySelector(".c-cksc-content-header__content-type");if(!r)return t.includes("journal")?"Journal":void 0;const n=r.textContent;if(n&&Rp(n))return n},Ip=({url:e,document:t})=>{switch(wp(t,e)){case"Book":return vp(t);case"Book Chapter":return _p(t);case"Full Text Article":return gp(t);case"Journal":return Ap(t);case"Guideline":return Sp(t,e);case void 0:return q()}},we=I({"@context":h()}),kp=e=>we.safeParse(e).success,Uo='script[type="application/ld+json"]',Bo=e=>Array.from(e.querySelectorAll(Uo)),ft=e=>e.querySelector(Uo),Ve=e=>{const t=e.textContent;if(!t)return null;try{const r=JSON.parse(t);if(kp(r))return r}catch{return null}return null},Cp=I({"@id":h(),"@type":h(),author:I({"@id":h()}).optional(),datePublished:h().optional(),dateModified:h().optional(),description:h().optional(),inLanguage:h().optional(),isPartOf:I({"@id":h()}).optional(),name:h().optional(),url:h().optional()}),Pp=we.extend({"@graph":U(Cp)}),Op=e=>Pp.safeParse(e).success,Np=e=>{const t=Bo(e);if(t.length===0)return null;const r=t.map(Ve).filter(Op).map(n=>n["@graph"]);return r.length!==1?null:r[0]},zp=(e,t)=>e.find(r=>r["@type"]===t)??null,Lp=(e,t)=>e.find(r=>r["@id"]===t)??null,xp=e=>{const t=zp(e,"WebPage");if(!t)return null;const r=t.author?Lp(e,t.author["@id"]):void 0;return ut({au:r?.name?[r.name]:void 0,date:t.datePublished,title:t.name})},Tp=({document:e})=>{const t=Np(e);return t?{bookmarkingWorkflowUrl:null,resource:xp(t)}:q()},Vo=()=>q(),qp=e=>{const{pathname:t}=new URL(e);return t.startsWith("/toc/")?"journal":t.startsWith("/article/")?"article":void 0},Dp=e=>{const t=e.querySelector("header h1 span")?.firstChild?.textContent?.trim(),r=e.querySelector("header p span")?.textContent.trim(),n=/\d{4}-\d{3}[\dX]/g,o=r?.match(n)??[],[s,i]=[o[0],o[1]],a=e.evaluate('//dt[contains(text(), "Publisher")]/following-sibling::dd/a',e,null,XPathResult.STRING_TYPE).stringValue.trim();return $(Z(S.Journal,{pub:a,jtitle:t,issn:s,eissn:i}))},Zp=e=>{let t,r;const n=re(e,"name","citation_issn");return n.length===2?(t=n[1],r=n[0]):t=n[0],{eissn:t,issn:r}},jp=e=>{const t=p(e,"name","citation_journal_title"),r=p(e,"name","citation_title"),n=re(e,"name","citation_author"),o=p(e,"name","citation_doi"),{eissn:s,issn:i}=Zp(e),a=p(e,"name","citation_publisher"),c=p(e,"name","citation_publication_date"),u=p(e,"name","citation_volume"),l=p(e,"name","citation_issue"),f=p(e,"name","citation_firstpage"),d=p(e,"name","citation_lastpage");return $(Z(S.Article,{jtitle:t,atitle:r,au:n,doi:o,eissn:s,issn:i,pub:a,date:c,volume:u,issue:l,spage:f,epage:d}))},Up=({document:e,url:t})=>{switch(qp(t)){case"journal":return Dp(e);case"article":return jp(e);case void 0:return q()}},Bp=e=>{const t=p(e,"name","pbContext");if(!t)return _.None;const r=xo(t);switch(r.has("page")?r.get("page")?.value:null){case"Article/Chapter View":return _.Article;case"Table of Contents":return _.Journal;default:return _.None}},Vp=e=>{const t=e.querySelector('meta[property="article:author"]')?.getAttribute("content")?.split(",").map(r=>r.trim());return t&&t.length>0?t:void 0},Fo=e=>{const t=new Map,r=Array.from(e.querySelectorAll(".rlist>li>span")).map(s=>s.textContent.trim()).join(""),n=/^ISSN:\s(\d{4}-\d{3}(?:\d|X))/.exec(r);n&&t.set("issn",n[1]);const o=/Online ISSN:\s(\d{4}-\d{3}(?:\d|X))/.exec(r);return o&&t.set("eissn",o[1]),t},Fp=e=>e.querySelector('span[property="isPartOf"][typeof="PublicationVolume"] > span[property="volumeNumber"]')?.textContent??void 0,Jp=e=>e.querySelector('span[property="isPartOf"][typeof="PublicationIssue"] > span[property="issueNumber"]')?.textContent??void 0,Mp=e=>e.querySelector('meta[name="dc.Identifier"][scheme="doi"]')?.getAttribute("content")??void 0,Wp=e=>e.querySelector("h1")?.textContent??void 0,Gp=e=>{const t=new Map,r=e.querySelector("h2.heading-m")?.textContent,n=r?.match(/Issue\s+(\d+(?:-\d+)?)/);n&&t.set("issue",n[1]);const o=r?.match(/Volume\s+(\d+)/);o&&t.set("volume",o[1]);const s=r?.match(/(\d{4})$/);return s&&t.set("date",s[1]),t},Xp=e=>{const t=Vp(e.document),r=p(e.document,"name","dc.Date"),n=Mp(e.document),o=Fo(e.document),s=o.get("issn"),i=o.get("eissn"),a=Jp(e.document),c=p(e.document,"name","citation_journal_title"),u=p(e.document,"name","dc.Publisher"),l=p(e.document,"name","dc.Title"),f=Fp(e.document);return Z(S.Article,{au:t,date:r,eissn:i,issn:s,issue:a,jtitle:c,pub:u,title:l,volume:f,doi:n})},Hp=e=>{const t=Fo(e.document),r=t.get("issn"),n=t.get("eissn"),o=Wp(e.document),s=Gp(e.document),i=s.get("issue"),a=s.get("volume"),c=s.get("date");return Z(S.Journal,{eissn:n,issn:r,jtitle:o,title:o,issue:i,volume:a,date:c})},Yp=e=>{switch(Bp(e.document)){case _.Article:return $(Xp(e));case _.Journal:return $(Hp(e));default:return q()}},Kp=e=>{const t=p(e,"name","citation_type"),r=p(e,"name","citation_article_type");return t==="JOUR"&&r?_.Article:t==="CHP"?_.Chapter:e.querySelector(".book-edition-year")?.textContent.includes("Book")?_.Book:e.getElementById("journal-title")?_.Journal:_.None},tr=e=>p(e,"name","citation_doi")??p(e,"name","dc.identifier")??e.querySelector(".doi .anchor-text")?.textContent??void 0,Qp=e=>{const t=Array.from(e.querySelectorAll(".kf-details .kf-detail-item:has(h3)")),r=new Map;for(const n of t){const o=n.querySelector("h3")?.textContent,s=n.querySelector("p")?.textContent;o&&s&&r.set(o,s)}return r},rr=(e,t)=>{const r=Array.from(e.querySelectorAll(t)).map(n=>n.textContent).filter(n=>!!n);return r.length>0?r:void 0},eh=e=>{const t=e.querySelector(".js-issn")?.textContent;if(t)return t.replace("Online ISSN: ","")},th=e=>{const t=e.get("DOI");if(t)return URL.canParse(t)?new URL(t).pathname.substring(1):t},rh=e=>{const t=Qp(e),r=p(e,"property","og:title"),n=p(e,"property","og:book:isbn"),o=t.get("Published"),s=rr(e,".authors-container .author-detail h3"),i=tr(e)??th(t);return W(S.Book,{au:s,date:o,doi:i,isbn:n,title:r})},nh=e=>{const t=p(e,"property","og:title"),r=p(e,"property","og:book:isbn"),n=p(e,"name","citation_publication_date"),o=rr(e,".author-group .button-link-text"),s=p(e,"name","citation_firstpage"),i=p(e,"name","citation_lastpage"),a=p(e,"name","citation_publisher"),c=tr(e),u=p(e,"name","citation_inbook_title")??e.querySelector(".publication-title")?.textContent??void 0;return W(S.Bookitem,{au:o,btitle:u,date:n,doi:c,epage:i,isbn:r,pub:a,spage:s,title:t})},oh=e=>{const t=p(e,"property","og:title"),r=p(e,"name","citation_issn"),n=p(e,"name","citation_publication_date"),o=rr(e,".author-group .button-link-text"),s=p(e,"name","citation_publisher"),i=p(e,"name","citation_firstpage"),a=p(e,"name","citation_issue"),c=p(e,"name","citation_volume"),u=tr(e),l=p(e,"name","citation_journal_title")??e.querySelector(".publication-title")?.textContent??void 0;return Z(S.Article,{au:o,jtitle:l,date:n,doi:u,issn:r,issue:a,pub:s,spage:i,title:t,volume:c})},sh=e=>{const t=e.getElementById("journal-title")?.textContent??void 0,r=eh(e);return Z(S.Journal,{issn:r,title:t})},ih=({document:e})=>{switch(Kp(e)){case _.Book:return $(rh(e));case _.Chapter:return $(nh(e));case _.Article:return $(oh(e));case _.Journal:return $(sh(e));default:return q()}},ah=e=>{const t=p(e,"name","pbContext");return t&&xo(t).has("article")?_.Article:_.Journal},ch=e=>{const t=e.querySelector(".itemPageRangeHistory");if(!t)return;const n=Array.from(t.childNodes).find(o=>o.textContent?.trim().startsWith("Page"));if(n)return n.textContent?.replace(/Pages?/,"").trim()??void 0},uh=e=>{const t=e.querySelector(".issue-heading")?.textContent;return t?t.split(",")[0]?.replace("Volume","").trim():void 0},lh=e=>{const t=e.querySelector(".issue-heading .nav-toc-list")?.textContent;return t?t.replace("Issue","").trim():void 0},ph=e=>{const t=p(e,"property","og:title"),r=p(e,"name","dc.Publisher"),n=p(e,"name","dc.Date"),o=p(e,"name","publication_doi"),s=p(e,"name","citation_journal_title"),i=re(e,"name","dc.Creator"),a=uh(e),c=lh(e),u=ch(e),l=u?.includes("-")?u.split("-")[0]:u,f=u?.includes("-")?u.split("-")[1]:u;return Z(S.Article,{au:i,jtitle:s,date:n,doi:o,issue:c,pub:r,spage:l,epage:f,title:t,volume:a})},hh=e=>{const t=p(e,"property","og:title"),r=p(e,"name","publication_doi");return Z(S.Journal,{doi:r,title:t})},fh=({document:e})=>{switch(ah(e)){case _.Article:return $(ph(e));case _.Journal:return $(hh(e));default:return q()}},dh=e=>lt.safeParse(e).success,mh=e=>Oo.safeParse(e).success,gh=e=>No.safeParse(e).success,vh=e=>Ft.safeParse(e).success,bh=e=>Jt.safeParse(e).success;function _h(e){return Wt.safeParse(e).success}function dt(e){return Gt.safeParse(e).success}function Jo(e){return Xt.safeParse(e).success}function Mo(e){return Ht.safeParse(e).success}function yh(e){return Mt.safeParse(e).success}const Sh=e=>Array.from(e.querySelectorAll("tr th")).find(n=>n.textContent.trim()==="DOI:")?.nextElementSibling?.querySelector('span[property="identifier"]')?.textContent??void 0,Eh=e=>{const t=/Record\/(\d+)/.exec(e);if(t&&t.length>1)return t[1]},$h=e=>{const{url:t,document:r}=e,n=Yt(e);if(!dt(n))return n;const o=Sh(r);return o&&(n.resource.rft_id=[`info:doi/${o}`]),n.resource.bibid=Eh(t),n},Ah=we.extend({"@type":M("VideoObject"),name:h(),author:h(),genre:h(),description:h(),uploadDate:h(),duration:h(),thumbnailUrl:U(h())}),Rh=e=>Ah.safeParse(e).success,wh=e=>{const t=Bo(e);if(t.length===0)return null;const r=t.map(Ve).filter(Rh);return r.length!==1?null:r[0]},Ih=({url:e,document:t})=>{const r=wh(t);return r?{bookmarkingWorkflowUrl:null,resource:fe({au:[r.author],date:r.uploadDate,title:r.name,uri:e})}:q()},Wo=e=>p(e,"name","doi")??p(e,"name","DOI")??p(e,"name","citation_doi")??p(e,"name","dc.identifier")??p(e,"name","prism.doi")??void 0,Go=e=>{const t=e.editor?.map(o=>o.name)??[],n=[...e.author?.map(o=>o.name)??[],...t];if(n.length!==0)return n};var Fe=(e=>(e.Book="Book",e.Journal="Journal",e.Periodical="Periodical",e.PublicationVolume="PublicationVolume",e.ScholarlyArticle="ScholarlyArticle",e.VideoObject="VideoObject",e.WebPage="WebPage",e))(Fe||{}),ye=(e=>(e.Article="article",e.Book="book",e.Paper="Paper",e.Video="video.other",e.Website="website",e))(ye||{}),ce=(e=>(e.Article="/article/",e.Book="/book/",e.Chapter="/chapter/",e.Video="/video/",e.ReferenceWorkEntry="/referenceworkentry/",e.ReferenceWork="/referencework/",e.Protocol="/protocol/",e.Collections="/collections/",e.Journal="/journal/",e.JournalIssue="/volumes-and-issues/",e))(ce||{});const Xo=I({"@type":M(Fe.ScholarlyArticle),author:U(I({"@type":h(),name:h()})).optional(),editor:U(I({"@type":h(),name:h()})).optional(),datePublished:h().optional(),headline:h().optional(),issn:U(h()).optional(),pageStart:h().optional(),pageEnd:h().optional(),isPartOf:I({"@type":pe([h(),U(h())]),name:h(),issn:U(h()).optional(),volumeNumber:h().optional(),isbn:U(h()).optional()}),publisher:I({"@type":h(),name:h()}).optional()}),Ho=e=>Xo.safeParse(e).success,kh=we.extend({"@type":M(Fe.WebPage),mainEntity:Xo}),Ch=e=>kh.safeParse(e).success,Ph=I({"@type":U(h()),name:h().optional(),issn:U(h()),volumeNumber:h().optional()}),Yo=e=>Ph.safeParse(e).success,Oh=(e,t)=>p(e,"name","citation_issn")??p(e,"name","prism.issn")??(Ho(t.isPartOf)?t.isPartOf.issn?.[0]:void 0),Ko=(e,t)=>{const r=Go(t),n=p(e,"name","citation_online_date"),o=Wo(e),s=p(e,"name","citation_issue"),i=Oh(e,t),a=Yo(t.isPartOf)&&t.isPartOf.issn.length>0?t.isPartOf.issn[1]:void 0,c=t.pageStart,u=t.pageEnd,l=t.headline,f=t.isPartOf.name,d=Yo(t.isPartOf)?t.isPartOf.volumeNumber:void 0;return Z(S.Article,{au:r,date:n,doi:o,issue:s,eissn:i,issn:a,spage:c,epage:u,atitle:l,jtitle:f,volume:d})},Nh=we.extend({"@type":M(Fe.Book),copyrightYear:h().optional(),author:U(I({"@type":h(),name:h()})).optional(),editor:U(I({"@type":h(),name:h()})).optional(),isbn:h().optional(),name:h().optional(),numberOfPages:ao().optional(),publisher:I({"@type":h(),name:h()}).optional()}),zh=e=>Nh.safeParse(e).success,Lh=e=>{const t=e.querySelectorAll(".c-bibliographic-information__list-item"),r=new Map;return t.forEach(n=>{const o=n.querySelector(".u-text-bold")?.textContent.trim(),s=n.querySelector(".c-bibliographic-information__value")?.textContent.trim();o&&s&&r.set(o,s)}),r},xh=(e,t)=>{const r=Lh(e),n=Go(t),o=t.copyrightYear?.toString(),s=Wo(e)??r.get("DOI"),i=t.name??r.get("Book Title"),a=t.isbn??r.get("Softcover ISBN"),c=t.numberOfPages?.toString()??r.get("Number of Pages"),u=t.publisher?.name??r.get("Publisher");return W(S.Book,{au:n,date:o,doi:s,title:i,isbn:a,tpages:c,pub:u})},Th=I({"@type":M("Periodical"),name:h(),url:h(),issn:U(h()),editor:U(I({givenName:h(),familyName:h()})),publisher:I({name:h()}),description:h()}),qh=e=>Th.safeParse(e).success,Dh=e=>{const t=e.editor.map(({givenName:i,familyName:a})=>`${i} ${a}`),r=e.name,[n,o]=e.issn,s=e.publisher.name;return Z(S.Journal,{au:t,jtitle:r,eissn:n,issn:o,pub:s})},Zh=I({"@type":M(Fe.VideoObject),name:h().optional(),description:h().optional(),thumbnailUrl:h().optional(),uploadDate:h().optional(),contentUrl:h().optional(),duration:h().optional()}),jh=e=>Zh.safeParse(e).success,Uh=(e,t)=>{const r=Array.from(e.querySelectorAll('dd[data-test="video-segment-author"]')).map(i=>i.textContent.trim()).filter(i=>!!i),n=t?.uploadDate?new Date(t.uploadDate).getFullYear().toString():void 0,o=t?.name??p(e,"property","og:title")??void 0,s=e.querySelector("video-about-doi")?.textContent??void 0;return fe({au:r.length>0?r:void 0,date:n,doi:s,title:o})},Bh=e=>{const t=p(e,"property","og:title");return ut({title:t})},Vh=(e,t)=>{const r=p(t,"property","og:type");return r===ye.Article&&e.includes(ce.Article)?_.Article:r===ye.Book&&(e.includes(ce.Book)||e.includes(ce.ReferenceWork))?_.Book:r===ye.Paper&&e.includes(ce.Chapter)?_.Chapter:r===ye.Paper&&(e.includes(ce.ReferenceWorkEntry)||e.includes(ce.Protocol))?_.Article:r===ye.Video&&e.includes(ce.Video)?_.AudioVisual:r===ye.Website&&(e.includes(ce.Collections)||e.includes(ce.JournalIssue))?_.Webpage:r===ye.Website&&e.includes(ce.Journal)?_.Journal:_.None},Fh=(e,t,r)=>e===_.AudioVisual&&jh(r)?$(Uh(t,r)):e===_.Book&&zh(r)?$(xh(t,r)):(e===_.Chapter||e===_.Article)&&Ho(r)?$(Ko(t,r)):e===_.Article&&Ch(r)?$(Ko(t,r.mainEntity)):e===_.Journal&&qh(r)?$(Dh(r)):q(),Jh=({url:e,document:t})=>{const r=Vh(e,t);if(r===_.Webpage)return $(Bh(t));const n=ft(t);if(!n)return q();const o=Ve(n);return o?Fh(r,t,o):q()},Mh=new Set(["Print ISBN","Online ISBN","DOI","First published","Online ISSN","Print ISSN"]),Wh=I({content:I({item:I({title:h(),"published-date":h()}),group:I({volume:h(),issue:h()}),series:I({title:h(),type:h(),eissn:h()})}).optional()}),Qo=(e,t)=>{if(!e)return;const r=e.indexOf(t);return r>-1?e.substring(0,r):e},nr=e=>{const r=/\d+/.exec(e);if(r?.[0])return r[0]},Gh=e=>{const t=e.querySelectorAll("script"),n=Array.from(t).find(o=>o.textContent.includes("adobeDataLayerJson"))?.textContent.match(/var adobeDataLayerJson = (\{.*?});/s);if(!(!n||n.length!==2))try{const o=JSON.parse(n[1]);return Wh.parse(o)}catch{return}},Xh=(e,t)=>{const r=p(e,"property","og:type"),n=t.includes("epdf");return r==="Book"||r==="books.book"?_.Book:r==="Chapter"?_.Chapter:r==="Journal"?_.Journal:r==="Article"||n?_.Article:_.None},mt=e=>{const t=re(e,"name","citation_author"),r=Array.from(e.querySelectorAll("#product-details-content .product-authors")).map(o=>o.textContent).filter(o=>!!o),n=new Set([...t,...r]);return n.size>0?[...n]:void 0},Hh=e=>{const t=Array.from(e.querySelectorAll("#product-details-content .text-piped p")).map(r=>r.textContent).find(r=>r.endsWith(" pages"));if(t)return nr(t)},gt=e=>{const t=new Map,r=Array.from(e.querySelectorAll(".journal-info-container .info-block")).flatMap(n=>Array.from(n.querySelectorAll(".info_label")));for(const n of r){const o=n.nextElementSibling;if(!o?.classList.contains("info_value"))continue;const s=Qo(n.textContent,":"),i=Qo(o.textContent,":");!s||!i||Mh.has(s)&&t.set(s,i)}return t},vt=(e,t)=>p(e,"property","books:release_date")??p(e,"name","citation_online_date")??t.get("First published")??void 0,or=(e,t)=>p(e,"name","dc.identifier")??p(e,"name","citation_doi")??p(e,"name","publication_doi")??t.get("DOI")??void 0,es=(e,t)=>{const r=new Set([p(e,"property","books:isbn"),t.get("Print ISBN"),t.get("Online ISBN")].filter(n=>!!n));return r.size>0?[...r].join(","):void 0},Yh=e=>{let t,r;const n=e.querySelector(".cover-image__details div:first-of-type");if(n&&n.childNodes.length===2){const[o,s]=n.childNodes;o.textContent&&(t=nr(o.textContent)),s.textContent&&(r=nr(s.textContent))}return{volume:t,issue:r}},Kh=e=>{const r=Array.from(e.querySelectorAll(".authors .author")).map(n=>n.textContent.trim().replace(",","")).filter(n=>!!n);return r.length>0?r:void 0},Qh=e=>{const t=Array.from(e.querySelectorAll(".details-section .details-entry")),r=t.find(i=>i.querySelector(".details-label")?.textContent.trim()==="ISSN"),n=t.find(i=>i.querySelector(".details-label")?.textContent.trim()==="eISSN");let o,s;return r&&(o=r.querySelector(".details-value")?.textContent.trim()),n&&(s=n.querySelector(".details-value")?.textContent.trim()),{issn:o,eissn:s}},ef=e=>{if(!e?.content?.group)return{volume:void 0,issue:void 0};const t=e.content.group.volume,r=e.content.group.issue;return r==="0"&&t==="0"?{volume:void 0,issue:void 0}:{volume:t,issue:r}},tf=e=>{const n=Array.from(e.querySelectorAll(".details-section .details-entry")).find(i=>i.querySelector(".details-label")?.textContent.trim()==="Pages")?.querySelector(".details-value")?.textContent.trim(),[o,s]=(n?.split("-")??[void 0,void 0]).map(i=>i?.trim());return o?.toLowerCase()==="n/a"&&s?.toLowerCase()==="n/a"?{spage:void 0,epage:void 0}:{spage:o,epage:s}},rf=e=>{const t=gt(e),r=mt(e),n=p(e,"property","og:title"),o=vt(e,t),s=or(e,t),i=es(e,t),a=Hh(e);return W(S.Book,{au:r,date:o,doi:s,isbn:i,pages:a,title:n})},nf=e=>{const t=gt(e),r=mt(e),n=p(e,"name","citation_book_title"),o=vt(e,t),s=or(e,t),i=es(e,t),a=p(e,"name","citation_publisher"),c=p(e,"property","og:title");return W(S.Bookitem,{au:r,btitle:n,date:o,doi:s,isbn:i,pub:a,title:c})},of=e=>{const t=gt(e),r=mt(e),n=vt(e,t),o=t.get("Online ISSN"),s=t.get("Print ISSN"),i=p(e,"property","og:title"),{volume:a,issue:c}=Yh(e);return Z(S.Journal,{au:r,date:n,eissn:o,issn:s,issue:c,title:i,volume:a})},sf=e=>{const t=gt(e),r=Gh(e),n=mt(e)??Kh(e),o=vt(e,t)??r?.content?.item["published-date"],s=or(e,t),{issn:i,eissn:a}=Qh(e),{volume:c,issue:u}=ef(r),l=p(e,"property","og:title")??r?.content?.item.title,f=p(e,"name","citation_journal_title")??r?.content?.series.title,{spage:d,epage:g}=tf(e);return Z(S.Article,{au:n,date:o,doi:s,eissn:a,issn:i??p(e,"name","citation_issn"),issue:u,jtitle:f,title:l,volume:c,spage:d,epage:g})},af=({document:e,url:t})=>{switch(Xh(e,t)){case _.Book:return $(rf(e));case _.Chapter:return $(nf(e));case _.Journal:return $(of(e));case _.Article:return $(sf(e));default:return q()}},cf=e=>{const t=re(e,"name","citation_author");return t.length>0?t:void 0},uf=({document:e})=>{const t=cf(e),r=p(e,"name","citation_publication_date"),n=p(e,"name","citation_doi"),o=p(e,"name","citation_isbn"),s=p(e,"name","citation_publisher"),i=p(e,"name","citation_title")??e.title,a=fe({au:t,date:r,doi:n,isbn:o,pub:s,title:i});return $(a)},lf=({document:e})=>Array.from(e.querySelectorAll(".Z3988")).length<=1?q():zo(),sr=e=>{if(!(!e||e.length===0))return e[0]};function ir(e,t){const r=t.map(n=>{const o=e.querySelector(n)?.textContent??null;if(o&&o.trim()!=="")return o}).filter(n=>n);return sr(r)??null}const Je=(e,t)=>ir(e,[t])?.trim(),pf=e=>{const t=e.querySelector(".content-meta-data__authors")?.textContent;if(t)return t.split(/,\s+|\s+and\s+/).filter(r=>!!r)},hf=e=>{const t=Array.from(e.querySelectorAll('.tombstone-metadata [data-qa="item-authors"]')).map(r=>r.textContent).filter(r=>!!r);return t.length?t:void 0},ff=e=>{const t=Array.from(e.querySelectorAll('.item-authors [data-qa="item-contributors"], .item-authors [data-qa="item-creators"]')).map(r=>r.textContent).filter(r=>!!r);return t.length?t:void 0},df=e=>{const t=Array.from(e.querySelectorAll(".contrib-type-author .name")).map(r=>r.textContent).filter(r=>!!r);return t.length?t:void 0},Ie=e=>{const t=new Set([...ff(e)??[],...pf(e)??[],...df(e)??[],...hf(e)??[]]);return t.size?[...t]:void 0},ke=(e,t)=>e.querySelector('[data-qa="published-date"]')?.textContent??e.querySelector(".summary-image")?.textContent??xe(t?.get("date"))??xe(t?.get("copyright date"))??xe(t?.get("published date")),ts=e=>{const t=e.find(r=>r.startsWith("https://doi.org/"));if(t)return t.replace("https://doi.org/","")},rs=e=>{const t=e.get("local identifier");if(t?.length)return ts(t)},mf=e=>e.querySelector(".doi")?.getAttribute("href")??void 0,xe=e=>{if(e?.length)return e[0]},Ce=e=>{const t=new Map;return Array.from(e.querySelectorAll(".metadata-element, .metadata")).map(r=>{const o=r.querySelector(".metadata-label")?.textContent.trim().toLowerCase(),s=Array.from(r.querySelectorAll(".metadata-value")).map(i=>i.textContent).filter(i=>!!i);return{name:o,values:s}}).forEach(({name:r,values:n})=>{!r||!n.length||t.set(r,n)}),t},ns=e=>{const t=Ce(e),r=e.querySelector(".summary-journal"),n=Array.from(r?.childNodes??[]),o=n[0]?.textContent??e.querySelector(".journal-link")?.textContent??void 0,s=n[2]?.textContent?.replace(/Published By:\s+?/i,"")??xe(t.get("publisher"))??e.querySelector(".publisher-link")?.textContent??void 0;return{pub:s&&s.trim()!==""?s:void 0,jtitle:o&&o.trim()!==""?o:void 0}},gf=e=>{const t=ir(e,['[data-qa="journal"]:first-child cite','[data-qa="copyright-statement"] > cite','[data-qa="collection-links"] mfe-content-details-pharos-link']);return t&&t.trim()!==""?t:void 0},bt=e=>me(e.querySelector('[data-qa="page-count"]')?.textContent),Me=(e,t)=>e.querySelector(".publisher-link")?.textContent??xe(t?.get("publisher")),Se=e=>e.querySelector('[data-qa="item-title"]')?.textContent.trim()??e.querySelector("mfe-turnaway-pharos-heading")?.textContent.trim()??e.querySelector(".metadata mfe-toc-pharos-heading")?.textContent.trim()??e.querySelector(".journal_header-title")?.textContent.trim()??void 0,Ee=e=>{if(!URL.canParse(e))return;const t=new URL(e);return t.origin+t.pathname},vf=e=>{const t=e.querySelector(".ccda-container > :first-child");let r,n;if(t?.textContent.includes("Volume")||t?.textContent.includes("Issue")){const o=t.textContent.trim().split(/,\s+/);for(const s of o)s.startsWith("Volume")?n=me(s):s.startsWith("Issue")&&(r=me(s))}return{issue:r,volume:n}},bf=e=>{const t=e.querySelector('[data-qa="item-src-info"]')?.textContent??p(e,"property","og:description")??p(e,"name","description");if(!t)return{};const r=/Vol\.\s*(\d+)/.exec(t),n=r?r[1]:void 0,o=/No\.\s*(\d+)/.exec(t),s=o?o[1]:void 0,i=/pp\.\s*(\d+)-(\d+)/.exec(t),a=i?i[1]:void 0,c=i?i[2]:void 0,u=/pp\.\s*\d+-\d+\s*\((\d+)\s*pages\)/.exec(t),l=u?u[1]:void 0;return{issue:s,volume:n,spage:a,epage:c,pages:l}},_f=e=>{const t=ir(e,["mfe-turnaway-pharos-link",'[data-qa="item-src-info"]']);if(!t)return;const n=/\(.+\)/.exec(t)?.map(o=>{const s=/\d{4}/.exec(o);return s?s[0]:void 0});return sr(n)},yf=(e,t)=>{const r=Se(e),n=Ie(e),o=ke(e)??_f(e),s=ns(e),i=s.jtitle??gf(e)??void 0,a=s.pub,c=vf(e),u=bf(e),l=c.issue??u.issue,f=c.volume??u.volume,d=bt(e)??u.pages,g=u.spage,P=u.epage,b=Ee(t),O=ts(Array.from(e.querySelector(".content-meta-data-stables")?.childNodes??[]).map(D=>D.textContent??""))??mf(e);return Z(S.Article,{atitle:r,au:n,date:o,doi:O,epage:P,issue:l,jtitle:i,pages:d,pub:a,spage:g,uri:b,volume:f})},Sf=(e,t)=>{const r=Ce(e),n=Ie(e),o=ke(e,r),s=Se(e),i=Me(e,r),a=Ee(t);return fe({au:n,date:o,pub:i,title:s,uri:a})},Ef=(e,t)=>{const r=Ce(e),n=Ie(e),o=Se(e),s=ke(e),i=bt(e),a=Me(e,r),c=Ee(t),u=rs(r);return W(S.Book,{au:n,date:s,doi:u,pages:i,pub:a,title:o,uri:c})},$f=(e,t)=>{const r=Ce(e),n=Ie(e),o=Se(e),s=e.querySelector(".book-title-link")?.textContent??void 0,i=ke(e,r),a=Array.from(e.querySelectorAll('[data-qa="book"] > span')).map(d=>d.textContent),c=bt(e),u=a.find(d=>d.includes("pp."))?.match(/(\d+)-(\d+)/)??void 0,l=Me(e,r),f=Ee(t);return W(S.Bookitem,{atitle:o,au:n,btitle:s,date:i,epage:u?.[2],pub:l,pages:c,spage:u?.[1],uri:f})},Af=(e,t)=>{const r=Ce(e),n=Ie(e),o=Se(e),s=ke(e),i=bt(e),a=Me(e,r),c=Ee(t),u=rs(r);return W(S.Document,{au:n,date:s,doi:u,pages:i,pub:a,title:o,uri:c})},Rf=(e,t)=>{const r=Ce(e),n=Ie(e),o=ke(e,r),s=Se(e),i=Ee(t);return bo({au:n,date:o,title:s,uri:i})},wf=(e,t)=>{const{pub:r}=ns(e),n=Se(e),o=e.querySelector(".eissn")?.textContent.replace(/EISSN\s+/,"").trim()??void 0,s=e.querySelector(".issn")?.textContent.replace(/ISSN\s+/,"").trim()??void 0,i=Ee(t);return Z(S.Journal,{eissn:o,issn:s,jtitle:n,pub:r,uri:i})};var ie=(e=>(e.Article="journal article",e.Audio="audio",e.Book="book",e.Chapter="book chapter",e.Document="document",e.Image="image",e.Journal="journal",e.ResearchReport="research report",e.Serial="serial",e.Video="video",e))(ie||{});const If=(e,t)=>{const r=Ce(e),n=Ie(e),o=ke(e,r),s=Se(e),i=Me(e,r),a=Ee(t);return fe({au:n,date:o,pub:i,title:s,uri:a})},kf=e=>Object.values(ie).includes(e),Cf=e=>{if(e.querySelector(".journal_header-title"))return ie.Journal;if(e.querySelector(".journal-link"))return ie.Article;const n=e.querySelector(".content-type > span")?.textContent.toLowerCase().trim()??e.querySelector(".content-meta-data-label")?.textContent.toLowerCase().trim();return kf(n)?n:null},Pf=(e,t)=>{switch(Cf(e)){case ie.Article:case ie.Serial:return yf(e,t);case ie.Audio:return Sf(e,t);case ie.Book:return Ef(e,t);case ie.Chapter:case ie.ResearchReport:return $f(e,t);case ie.Document:return Af(e,t);case ie.Image:return Rf(e,t);case ie.Journal:return wf(e,t);case ie.Video:return If(e,t);default:return null}},Of=({document:e,url:t})=>{const r=Pf(e,t);return r?$(r):q()},We=e=>{if(e){if(typeof e=="string")return e;if(e.length>0)return e[0]}else return},os=e=>{if(e)return typeof e=="string"?e:Array.isArray(e)?e.length===0?void 0:We(e[0].name):We(e.name)},_t=(...e)=>{const t=new Set(e.filter(r=>!!r));if(t.size!==0)return[...t]},Nf=e=>{const t=os(e.mainEntity.creator);return t?[t]:void 0},Ge=({lcn:e,title:t})=>({bibid:e,title:t}),zf=(e,t)=>{const r=_t(...(e&&Nf(e))??[],...t.authors??[]),n=_t(...t.eissns??[]),o=_t(e?.mainEntity.isbn?er(e.mainEntity.isbn):void 0,...t.isbns??[]),s=_t(...e?.mainEntity.issn??[],...t.issns??[]),[i,a]=e?.mainEntity.pagination?.split("-")??[];return{authors:r,date:t.date,doi:We(t.dois),edition:e?.mainEntity.edition??t.edition,epage:a,eissn:We(n),lcn:t.lcn??e?.identifier.value,isbn:o?.join(","),issn:We(s),issue:e?.mainEntity.issueNumber,jtitle:t.jtitle,publisher:t.publisher??os(e?.mainEntity.publisher),spage:i,title:e?.name??t.title,volume:e?.mainEntity.volumeNumber}},Lf=e=>Z(S.Article,{...Ge(e),au:e.authors,doi:e.doi,eissn:e.eissn,epage:e.epage,issn:e.issn,issue:e.issue,jtitle:e.jtitle,pub:e.publisher,spage:e.spage,volume:e.volume}),xf=e=>fe({...Ge(e),au:e.authors,date:e.date,pub:e.publisher}),Tf=e=>W(S.Book,{...Ge(e),au:e.authors,date:e.date,doi:e.doi,edition:e.edition,epage:e.epage,isbn:e.isbn,pub:e.publisher,spage:e.spage}),qf=e=>Z(S.Journal,{...Ge(e),date:e.date,doi:e.doi,eissn:e.eissn,issn:e.issn,pub:e.publisher}),ss=I({"@type":M("Organization"),name:pe([h(),U(h())])}),is=I({"@type":M("Person"),name:pe([h(),U(h())])}),Df=we.extend({identifier:I({"@type":h(),propertyID:h(),value:h()}),mainEntity:I({"@type":h(),"@id":h(),creator:he(pe([h(),is,U(is)])),edition:he(h()),isbn:he(h()),issn:he(U(h())),issueNumber:he(h()),pagination:he(h()),publisher:he(pe([h(),ss,U(ss)])),volumeNumber:he(h())}),name:h()}),Zf=e=>{const t=ft(e);if(!t)return null;const r=Ve(t),n=Df.safeParse(r);return n.success?n.data:null},jf=e=>fe({...Ge(e),au:e.authors,date:e.date,pub:e.publisher}),Uf=/([0-9]{4}-[0-9]{1,2}-[0-9]{1,2}|[0-9]{4}-[0-9]{1,2}|[0-9]{4})/,as=/(E?ISBN|E?ISSN|DOI)\s*:\s*/g,ar=e=>`*:has([title*="${e}" i]) + .item-details-element-container prm-highlight`,Bf=e=>{if(!e)return;const t=Uf.exec(e);if(t)return t.length>1?t[1]:void 0},Vf=e=>{const t=Array.from(e.querySelectorAll(ar("Identifier"))),r={};return t.map(n=>n.textContent).filter(n=>!!n).forEach(n=>{const o=[];let s;for(;(s=as.exec(n))!==null;)o.push({id:s[1].toLowerCase(),index:s.index,start:as.lastIndex});o.forEach(({id:i,start:a},c)=>{r[i]??=[],r[i].push(n.substring(a,o[c+1]?.index))})}),r},Ff=e=>Array.from(e.querySelectorAll(ar("Author"))).filter(t=>!!t.textContent&&t.parentElement!==null&&t.parentElement.getAttribute("aria-hidden")!=="true").map(t=>t.textContent.trim()),$e=(e,t)=>e.querySelector(ar(t))?.textContent.trim(),Jf=e=>{const t=$e(e,"Creation Date"),r=$e(e,"Edition"),n=$e(e,"Publication Date"),o=$e(e,"Is Part Of"),s=$e(e,"Publisher"),i=$e(e,"Title"),a=$e(e,"MMS ID")??$e(e,"Record ID"),c=Ff(e),u=Vf(e),[l]=o?.split(",")??[],f=Bf(n??t),d=[...u.isbn??[],...u.eisbn??[]].map(g=>er(g)).filter(g=>!!g);return{authors:c,date:f,dois:u.doi,edition:r,eissns:u.eissn,isbns:d,issns:u.issn,jtitle:l,lcn:a,publisher:s,title:i}};var cs=(e=>(e.Article="Article",e.Book="Book",e.Periodical="Periodical",e.Journal="Journal",e.AudioCD="Audio CD",e.CreativeWork="CreativeWork",e.Movie="Movie",e.Video="Video",e))(cs||{});const Mf=e=>Object.values(cs).includes(e),Wf=(e,t)=>{const r=t?.mainEntity["@type"]??e.querySelector(".media-content-type")?.textContent??void 0;if(Mf(r))return r},Gf=({document:e})=>{const t=Zf(e),r=Jf(e),n=zf(t,r);switch(Wf(e,t)){case"Article":return $(Lf(n));case"Book":return $(Tf(n));case"Periodical":case"Journal":return $(qf(n));case"Audio CD":case"CreativeWork":return $(xf(n));case"Movie":case"Video":return $(jf(n));default:return q()}},Xf=e=>{const t=e.querySelectorAll('[id="Info"] > p'),n=Array.from(t).find(s=>s.textContent.includes("Document Type"))?.textContent,o=p(e,"name","DC.identifier");return o?.startsWith("info:doi/")||n?.includes("Article")?_.Article:o?.startsWith("urn:issn:")?_.Journal:void 0},Hf=e=>{const t=p(e,"name","DCTERMS.bibliographicCitation"),[r,n,o,s]=t?.split(",")??[];return{journalTitle:r,volume:n,issue:o,pages:s}},Yf=e=>{const t=p(e,"name","DC.identifier");return(t?t.split("info:doi/"):null)?.[1]??void 0},Kf=e=>e.evaluate('//*[@id="altLayoutPublisherLogo"]/p/a[1]',e,null,XPathResult.STRING_TYPE,null).stringValue,Qf=e=>{const[t,r]=e?e.trim().split("-"):[void 0,void 0],n=r?.replace(/\(\d+\)/,"").trim();return{spage:t,epage:n}},ed=e=>{const t=p(e,"name","DCTERMS.issued");if(!t)return;const n=/\d{4}/.exec(t);return n?n[0]:void 0},td=e=>{const t=p(e,"name","DC.title"),r=p(e,"name","DC.publisher"),n=ed(e),o=Hf(e),s=o.journalTitle?.trim(),i=o.volume?.trim(),a=o.issue?.trim(),c=o.pages?Qf(o.pages):void 0,u=c?.spage,l=c?.epage,f=re(e,"name","DC.creator"),d=Yf(e);return Z(S.Article,{au:f,jtitle:s,date:n,doi:d,issue:a,pub:r,spage:u,epage:l,atitle:t,volume:i})},rd=e=>{const t=p(e,"name","DC.title"),r=p(e,"name","DC.publisher"),n=Kf(e);return Z(S.Journal,{issn:n,title:t,pub:r})},nd=({document:e})=>{switch(Xf(e)){case _.Article:return $(td(e));case _.Journal:return $(rd(e));default:return q()}},od=/^\d{4}-\d{3}[\dX]$/i,sd=e=>od.test(e),us=e=>{const t=e.filter(sd);return t.length?t:void 0},cr=e=>{const t=re(e,"name","citation_author");return t.length?t:void 0},ur=e=>p(e,"name","citation_publication_date")?.match(/^\d{4}/)?.[0],id=e=>p(e,"name","citation_doi"),ls=e=>{const t=re(e,"name","citation_isbn");return t.length?t.join(","):void 0},ps=e=>us(re(e,"name","citation_issn")),lr=e=>p(e,"name","citation_journal_title"),pr=e=>p(e,"name","citation_publisher"),yt=e=>p(e,"name","citation_title"),ad=e=>p(e,"name","citation_doi"),hr=e=>p(e,"name","citation_firstpage"),fr=e=>p(e,"name","citation_lastpage"),cd=e=>p(e,"name","citation_issue"),ud=e=>p(e,"name","citation_volume"),ld=e=>Z(S.Article,{atitle:yt(e),au:cr(e),date:ur(e),doi:id(e),issn:ps(e)?.[0],issue:cd(e),jtitle:lr(e),pub:pr(e),volume:ud(e),spage:hr(e),epage:fr(e)}),pd=e=>W(S.Bookitem,{atitle:yt(e),au:cr(e),btitle:lr(e),date:ur(e),isbn:ls(e),pub:pr(e),spage:hr(e),epage:fr(e)}),hd=e=>jt({title:yt(e),au:cr(e),date:ur(e),pub:pr(e),spage:hr(e),epage:fr(e)}),hs=e=>!!e.isbn,fd=e=>!!e.issn||e.type==="Article"&&!!e.journalTitle||!hs(e)&&!!e.journalTitle,dd=e=>!!e.title,md=e=>{const t={type:ad(e),isbn:ls(e),issn:ps(e),journalTitle:lr(e),title:yt(e)};return hs(t)?pd(e):fd(t)?ld(e):dd(t)?hd(e):null},gd=({document:e})=>{const t=md(e);return t?$(t):q()},vd=I({"@content":h(),datePublished:h().optional(),mainEntity:I({type:h().optional(),name:h().optional(),author:U(I({name:h()})).optional(),publisher:I({type:h(),name:h()}).optional(),isbn:h().optional()})}),bd=e=>vd.safeParse(e).success,_d=e=>{const t=e.textContent;if(!t)return null;try{const r=JSON.parse(t);if(bd(r))return r}catch{return null}return null},yd=({document:e})=>{const t=ft(e);if(!t)return q();const r=_d(t);if(!r)return q();const n=r.mainEntity.type,o=r.mainEntity.author?.map(u=>u.name),s=r.datePublished?.substring(0,4),i=r.mainEntity.name,a=r.mainEntity.isbn,c=r.mainEntity.publisher?.name;switch(n){case"Book":return $(W(S.Book,{au:o,date:s,title:i,isbn:a,pub:c}));default:return q()}},Sd=we.extend({"@type":h().optional(),name:h().optional(),copyrightYear:ao().optional(),author:U(I({name:h()})).optional(),publisher:U(I({name:h()})).optional()}),Ed=e=>Sd.safeParse(e).success,$d=({document:e,url:t})=>{const r=ft(e);if(!r)return q();const n=Ve(r);if(!n||!Ed(n))return q();const o=n["@type"],s=n.author?.map(l=>l.name),i=n.copyrightYear?.toString()??p(e,"property","og:book:release_date"),a=n.name,c=sr(n.publisher?.map(l=>l.name)),u=p(e,"property","og:book:isbn");switch(o){case"Book":return $(W(S.Book,{au:s,date:i,title:a,isbn:u,pub:c,uri:t}));default:return q()}},Ad=e=>{const t=Array.from(e.querySelectorAll("a[rel=author]")).map(r=>r.textContent.trim()).filter(Boolean);return t.length?t:void 0},Rd=e=>{const t=Array.from(e.querySelectorAll("strong")).filter(r=>r.textContent.startsWith("ISBN")).map(r=>r.nextElementSibling?.textContent.trim());if(t.length!==0)return t[0]?.replace(/\s+/,",")},wd=({url:e,document:t})=>{const r=t.querySelector("h3.page-title")?.textContent.trim()??void 0,n=Ad(t),o=p(t,"property","article:published_time"),s=Rd(t),i=W(S.Book,{au:n,date:o?.substring(0,4),isbn:s,pub:"Milne Open Textbooks",title:r,uri:e});return $(i)},Id=({document:e,url:t})=>{switch(kd(t)){case _.Chapter:return $(zd(e));case _.Book:return $(Ld(e));case _.Article:return $(Cd(e));case _.Journal:return $(Pd(e));default:return q()}},kd=e=>{const{pathname:t}=new URL(e);return t.includes("/books/abs/")?_.Chapter:t.includes("/books/")?_.Book:/\/journals\/.+\/article\//.exec(t)!=null?_.Article:t.includes("/journals/")?_.Journal:_.None},Cd=e=>{const t=p(e,"name","citation_title"),r=p(e,"name","citation_journal_title"),n=p(e,"name","citation_doi"),o=p(e,"name","citation_volume"),s=p(e,"name","citation_issue"),i=p(e,"name","citation_firstpage"),a=p(e,"name","citation_lastpage"),c=p(e,"name","citation_publication_date")?.substring(0,4),u=p(e,"name","citation_publisher"),l=fs(e),f=us(re(e,"name","citation_issn"));return Z(S.Article,{atitle:t,au:l,jtitle:r,doi:n,volume:o,issue:s,issn:f?.[0],spage:i,epage:a,date:c,pub:u})},Pd=e=>{const t=Od(e),r=Nd(e),n=r.find(a=>a.type==="Print"),o=r.find(a=>a.type==="Online"),s=n?n.value:void 0,i=o?o.value:void 0;return Z(S.Journal,{title:t,issn:s,eissn:i})},Od=e=>e.querySelector("h1.title")?.textContent.trim()??void 0,Nd=e=>{const r=Array.from(e.querySelectorAll("span.bold")).find(s=>s.textContent.trim()==="ISSN:"),n=/^([0-9]{4}-[0-9]{3}[0-9X]) \((Print|Online)\)/,o=[];return r&&r.parentElement?.querySelectorAll("span.value")?.forEach(i=>{const a=i.textContent.trim(),c=n.exec(a);c&&o.push({value:c[1],type:c[2]})}),o},zd=e=>{const t=p(e,"name","citation_title"),r=p(e,"name","citation_inbook_title"),n=p(e,"name","citation_doi"),o=p(e,"name","citation_publication_date")?.substring(0,4),s=p(e,"name","citation_publisher");return W(S.Bookitem,{atitle:t,btitle:r,doi:n,date:o,pub:s})},Ld=e=>{const t=p(e,"name","citation_title"),r=p(e,"name","citation_doi"),n=p(e,"name","citation_isbn"),o=p(e,"name","citation_publication_date")?.substring(0,4),s=p(e,"name","citation_publisher"),i=fs(e);return W(S.Book,{title:t,au:i,doi:r,isbn:n,date:o,pub:s})},fs=e=>{const t=re(e,"name","citation_author");return t.length?t:void 0},xd=e=>{switch(p(e,"property","og:type")){case"Article":return"Article";case"Journal":return"Journal";default:return}};function Td(e){const t=p(e,"property","og:title"),r=p(e,"name","dc.Publisher"),n=p(e,"name","publication_doi");return $(Z(S.Journal,{jtitle:t,pub:r,doi:n}))}function qd(e){const t=p(e,"name","dc.Title"),r=re(e,"name","dc.Creator"),n=p(e,"name","dc.Date")?.substring(0,4),o=p(e,"name","publication_doi"),s=p(e,"name","citation_journal_title"),i=p(e,"name","dc.Publisher");return $(Z(S.Article,{atitle:t,au:r,date:n,doi:o,jtitle:s,pub:i}))}const Dd=({document:e})=>{switch(xd(e)){case"Journal":return Td(e);case"Article":return qd(e);default:return q()}},Zd=e=>{if(!e)return;const[t,r]=e.trim().split("-");return{spage:t,epage:r}},jd=e=>{const{pathname:t}=new URL(e);if(t.includes("/article/"))return _.Article},Ud=e=>{const t=p(e,"name","DC.Source"),r=p(e,"name","DC.Title"),n=re(e,"name","DC.Creator.PersonalName"),o=p(e,"name","DC.Source.ISSN"),s=p(e,"name","citation_date")?.substring(0,4),i=p(e,"name","DC.Source.Volume"),a=p(e,"name","DC.Source.Issue"),c=p(e,"name","DC.Identifier.URI"),u=p(e,"name","DC.Identifier.pageNumber"),l=u?Zd(u):void 0,f=l?.spage,d=l?.epage;return Z(S.Article,{jtitle:t,atitle:r,au:n,issn:o,date:s,spage:f,epage:d,volume:i,issue:a,uri:c})},Bd=({document:e,url:t})=>{switch(jd(t)){case _.Article:return $(Ud(e));default:return q()}},Vd=e=>{switch(Fd(e)){case"eBook":return"Book";case"Reference":return"Chapter";default:return}},Fd=e=>e.querySelector("#vol-contentType a")?.textContent??void 0;function Jd(e,t){const r=ds(e),n=dr(e),o=gs(e),s=vs(e),i=bs(e),a=_s(e),c=dr(e),u=t,{startPage:l,endPage:f}=ys(e)??{};return $(W(S.Book,{au:r,btitle:n,date:o,doi:s,epage:f,isbn:i,pub:a,spage:l,title:c,uri:u}))}function Md(e,t){const r=ds(e),n=ms(e),o=dr(e),s=gs(e),i=vs(e),a=bs(e),c=_s(e),u=ms(e),l=t,{startPage:f,endPage:d}=ys(e)??{};return $(W(S.Book,{au:r,atitle:n,btitle:o,date:s,doi:i,epage:d,isbn:a,pub:c,spage:f,title:u,uri:l}))}const ds=e=>{const t=e.querySelectorAll("div#article_author p.author-bio b"),r=Array.from(t).map(n=>n.textContent).filter(n=>!!n).map(n=>n.trim());return r.length>0?r:void 0},Te=(e,t)=>e.querySelector(`input#${t}`)?.getAttribute("value")??void 0,Wd=e=>p(e,"property","og:title"),dr=e=>Te(e,"titlevalue")??Wd(e),ms=e=>Te(e,"chapter-title-squid"),gs=e=>Te(e,"pubdate-squid"),vs=e=>Te(e,"doi-squid"),bs=e=>Te(e,"isbn-squid"),_s=e=>Te(e,"pubname-squid"),ys=e=>{const t=e.querySelector("#pageRange")?.textContent??void 0;if(!t)return;const n=/(\d+)–(\d+)/.exec(t);if(n)return{startPage:n[1],endPage:n[2]}},Gd=({document:e,url:t})=>{switch(Vd(e)){case"Book":return Jd(e,t);case"Chapter":return Md(e,t);default:return q()}},Xd=(e,t)=>e.evaluate(`//*[@class="singleRecord_view_label"][contains(text(), "${t}")]/following-sibling::*[@class="singleRecord_view_data"]`,e,null,XPathResult.STRING_TYPE).stringValue.toLowerCase().trim(),Hd=e=>{switch(Xd(e,"Medium")){case"book":case"e-book":return S.Book;case"e-journal":return S.Journal;default:return S.Unknown}},Yd=e=>{delete e.rft_id},Kd=e=>{const t=Yt(e);if(dt(t)){const r=Hd(e.document);t.resource.genre=r,Yd(t.resource)}return t},Qd=e=>{const t=p(e,"name","type")?.toLowerCase(),r=p(e,"name","og:type")?.toLowerCase(),n=p(e,"name","citation_article_type")?.toLowerCase();if(t==="article"||n==="article"||r==="article")return _.Article;const o=p(e,"name","twitter:title")?.trim(),s=p(e,"name","description")?.trim();if(o||s)return _.Webpage},em=e=>{const t=p(e,"name","DC.Title"),r=p(e,"name","DC.Publisher"),n=p(e,"name","DC.Date"),o=p(e,"name","DC.Identifier"),s=p(e,"name","citation_journal_title"),i=p(e,"name","citation_volume"),a=p(e,"name","citation_issn"),c=re(e,"name","citation_author");return Z(S.Article,{au:c,jtitle:s,date:n,doi:o,issn:a,pub:r,title:t,volume:i})},tm=(e,t)=>{const r=p(t,"name","twitter:title");return ut({uri:e,title:r})},rm=({url:e,document:t})=>{switch(Qd(t)){case _.Article:return $(em(t));case _.Webpage:return $(tm(e,t))}return q()},nm=({document:e})=>Array.from(e.querySelectorAll(".availability.documentSummaryAvailability.availabilityContent")).length<=1?q():Lo(),om=/([0-9]{4})\s+at/;function sm(e){if(!e)return;const t=om.exec(e);if(t&&t.length>1)return t[1]}function Ss(e,t){const r=e.getElementsByClassName(t);if(r.length!==0)return r[0].textContent}function im(e){const t={};return Array.from(e.getElementsByTagName("li")).reduce((r,n)=>{const o=Ss(n,"title"),s=Ss(n,"content");return o&&s&&(r[o]=s),r},t)}function am(e){const t=e.getElementsByClassName("information");if(t.length===0)return{};const r=im(t[0]),n=sm(r.Published),o=r.Show;return{date:n,series:o}}const cm=({url:e,document:t})=>{if(!new URL(e).searchParams.has("i"))return q();const n=S.AudioDocument,o=p(t,"property","og:site_name"),s=p(t,"property","og:title"),i=am(t);return $({genre:n,pub:o,title:s,uri:e,...i})},um=e=>{const t=p(e,"name","citation_date");return t?t.split("/").find(o=>/^\d{4}/.test(o))??void 0:void 0},lm=e=>{const t=e.querySelector("#arxiv-doi-link")?.textContent;return t?t.replace("https://doi.org/","").trim():void 0},pm=({document:e})=>{const t=p(e,"name","citation_title"),r=p(e,"name","citation_pdf_url"),n=re(e,"name","citation_author"),o=um(e),s=lm(e);return!t&&n.length===0&&!o&&!s?q():$(Z(S.Article,{au:n,date:o,doi:s,title:t,uri:r}))},hm=e=>{const t=Je(e,"div.director-section div.term-info-section-items");if(!t)return;const r=t.split(",").map(n=>n.replace(/\s+/g," ").trim()).filter(n=>n.length>0);return r.length>0?r:void 0},fm=e=>{const t=new Map;return Array.from(e.querySelectorAll(".info-section-container")).forEach(r=>{const n=r.querySelector(".info-section-header .info-section-title")?.textContent.trim().toLowerCase();if(!n)return;const o=Array.from(r.querySelectorAll(".term-info-section-item")).map(s=>s.textContent.replace(",","").trim()).filter(s=>!!s);o.length&&t.set(n,o)}),t},dm=({url:e,document:t})=>{const r=fm(t),n=hm(t)??r.get("director"),o=Je(t,"div.product-release-year"),s=Je(t,"div.studio-section div.term-info-section-item")??xe(r.get("supplier")),i=Je(t,".product-title")??Je(t,".movie-title"),a=fe({au:n,date:o,pub:s,title:i,uri:e});return $(a)},mm=e=>{if(p(e,"property","og:type")==="article")return _.Article};function gm(e){const t={},r=e.querySelector("[data-id=layout-form]");return r&&Array.from(r.getElementsByTagName("h2")).forEach(o=>{const s=o.textContent.toLowerCase(),a=Array.from(o.parentElement?.getElementsByTagName("span")??[]).map(c=>c.textContent||"");s&&(t[s]=a[0])}),t}function vm(e,t,r){return r.includes("publisher")?t.publisher:r.includes("place of publication, exhibition, or creation")?t["place of publication, exhibition, or creation"]:p(e,"name","DC.publisher")}function bm(e){const t=p(e,"name","citation_publication_date");return t?t.substring(0,4):p(e,"name","citation_online_date")?.substring(0,4)}const _m=e=>{const t=gm(e),r=p(e,"name","DataCite.title"),n=re(e,"name","DataCite.contributor"),o=bm(e),s=p(e,"name","DC.identifier.DOI"),i=Object.keys(t),a=vm(e,t,i),c=i.includes("journal")?t.journal:void 0,u=i.includes("volume")?t.volume:void 0,l=i.includes("issue")?t.issue:void 0,f=i.includes("issn")?t.issn:void 0,d=i.includes("electronic location (url)")?t["electronic location (url)"]:void 0;return Z(S.Article,{jtitle:c,atitle:r,pub:a,au:n,date:o,doi:s,volume:u,issue:l,issn:f,uri:d})},ym=({document:e})=>{switch(mm(e)){case _.Article:return $(_m(e));default:return q()}};var L=(e=>(e.NoResourceFound="NoResourceFound",e.Z3988="Z3988",e.Z3988SearchResult="Z3988SearchResult",e.Amazon="Amazon",e.CupOfJo="CupOfJo",e.IngentaConnect="IngentaConnect",e.Jstor="Jstor",e.Milne="Milne",e.Primo="Primo",e.SagePub="SagePub",e.SageVideo="SageVideo",e.ScienceDirect="ScienceDirect",e.Springer="Springer",e.Youtube="Youtube",e.TaylorFrancis="TaylorFrancis",e.Wiley="Wiley",e.VuFind="VuFind",e.ClinicalKey="ClinicalKey",e.DOAJ="DOAJ",e.Ebscohost="Ebscohost",e.OpenStax="OpenStax",e.CambridgeJournalsOnline="CambridgeJournalsOnline",e.OpenTextbook="OpenTextbook",e.AhaJournals="AhaJournals",e.Ijees="Ijees",e.BloomsburyCollections="BloomsburyCollections",e.HeritageCirqa="HeritageCirqa",e.BritishMedicalJournal="BritishMedicalJournal",e.SummonSearchResult="SummonSearchResult",e.ApplePodcasts="ApplePodcasts",e.Arxiv="Arxiv",e.KanopyVideo="KanopyVideo",e.LaTrobeOpal="LaTrobeOpal",e.BYUScholarsArchive="BYUScholarsArchive",e))(L||{});const mr={NoResourceFound:Vo,Z3988:Yt,Z3988SearchResult:lf,Amazon:op,CupOfJo:Tp,Jstor:Of,Youtube:Ih,SagePub:Yp,SageVideo:uf,ScienceDirect:ih,Springer:Jh,TaylorFrancis:fh,Wiley:af,VuFind:$h,ClinicalKey:Ip,DOAJ:Up,Primo:Gf,IngentaConnect:nd,Ebscohost:gd,OpenStax:yd,OpenTextbook:$d,Milne:wd,CambridgeJournalsOnline:Id,AhaJournals:Dd,Ijees:Bd,BloomsburyCollections:Gd,HeritageCirqa:Kd,BritishMedicalJournal:rm,SummonSearchResult:nm,ApplePodcasts:cm,Arxiv:pm,KanopyVideo:dm,LaTrobeOpal:ym,BYUScholarsArchive:dp},Sm="5.30.0",gr=()=>Sm,Em=["com.au","com","ca","co.uk","de","fr","nl"].flatMap(e=>[`amazon.${e}`,`www.amazon.${e}`]),$m={version:gr(),siteRegistrations:[{matcher:{regexp:"^https://[a-z0-9\\-]+\\.on\\.worldcat\\.org/search"},name:"Worldcat Search Results",parsers:[L.Z3988SearchResult]},{matcher:{regexp:"^https://[a-z0-9\\-]+\\.summon\\.serialssolutions\\.com/"},name:"Summon Search Results",parsers:[L.SummonSearchResult]},{matcher:{regexp:"cupofjo[.-]com"},name:"Cup of Jo",parsers:[L.CupOfJo]},{matcher:{hostnames:["youtube.com","www.youtube.com"]},name:"Youtube",parsers:[L.Youtube]},{matcher:{regexp:"www[-.]sciencedirect[.-]com"},name:"Science Direct",parsers:[L.ScienceDirect]},{matcher:{hostnames:Em},name:"Amazon",parsers:[L.Amazon]},{matcher:{regexp:"^https://sk\\.sagepub\\.com/video/"},name:"Sage Video",parsers:[L.SageVideo]},{matcher:{regexp:"[/.-]((www|journals)[.-])?sagepub[.-]com"},name:"Sage Publishing",parsers:[L.SagePub]},{matcher:{regexp:"www[.-]tandfonline[.-]com"},name:"Taylor & Francis",parsers:[L.TaylorFrancis]},{matcher:{regexp:"[/.-]((www|onlinelibrary)[.-])?wiley[.-]com"},name:"Wiley",parsers:[L.Wiley]},{matcher:{regexp:"^https://[a-z0-9\\-]+\\.on\\.worldcat\\.org/"},name:"Worldcat",parsers:[L.Z3988]},{matcher:{hostnames:["catalogue.rau.ac.uk"]},name:"Royal Agricultural University Library",parsers:[L.Z3988]},{matcher:{regexp:"link[.-]springer[.-]com"},name:"Springer",parsers:[L.Springer]},{matcher:{regexp:"^https://vufind\\.lboro\\.ac\\.uk/(Record|PrimoRecord)"},name:"VuFind",parsers:[L.VuFind]},{matcher:{regexp:"www[.-]clinicalkey[.-]com"},name:"ClinicalKey",parsers:[L.ClinicalKey]},{matcher:{regexp:"www[.-]jstor[.-]org"},name:"JSTOR",parsers:[L.Jstor]},{matcher:{regexp:"doaj[.-]org"},name:"DOAJ",parsers:[L.DOAJ]},{matcher:{regexp:"[/.-]ingentaconnect[.-]com"},name:"IngentaConnect",parsers:[L.IngentaConnect]},{matcher:{regexp:"research[.-]ebsco[.-]com"},name:"EBSCOHost",parsers:[L.Ebscohost]},{matcher:{regexp:"openstax[-.]org"},name:"OpenStax",parsers:[L.OpenStax]},{matcher:{regexp:"open[.-]umn[.-]edu"},name:"OpenTextbook",parsers:[L.OpenTextbook]},{matcher:{regexp:"milneopentextbooks[-.]org"},name:"Milne Open Textbooks",parsers:[L.Milne]},{matcher:{regexp:"www[.-]perlego[.-]com"},name:"Perlego",parsers:[L.Z3988]},{matcher:{regexp:"www[.-]ahajournals[.-]org"},name:"AHA Journals",parsers:[L.AhaJournals]},{matcher:{regexp:"www[.-]cambridge[.-]org"},name:"Cambridge Journals Online",parsers:[L.CambridgeJournalsOnline]},{matcher:{regexp:"www[.-]nieindia[.-]org"},name:"International Journal of Ecology and Environmental Sciences",parsers:[L.Ijees]},{matcher:{regexp:"www[.-]bloomsburycollections[.-]com"},name:"Bloomsbury Collections",parsers:[L.BloomsburyCollections]},{matcher:{regexp:"cirqahosting[.-]com"},name:"Heritage Cirqa",parsers:[L.HeritageCirqa]},{matcher:{regexp:"www[.-]bmj[.-]com"},name:"British Medical Journal",parsers:[L.BritishMedicalJournal]},{matcher:{regexp:"podcasts[.-]apple[.-]com"},name:"Apple Podcasts",parsers:[L.ApplePodcasts]},{matcher:{regexp:"arxiv[.-]org"},name:"arxiv",parsers:[L.Arxiv]},{matcher:{regexp:"kanopy[.-]com"},name:"Kanopy Video",parsers:[L.KanopyVideo]},{matcher:{regexp:"opal[.-]latrobe[.-]edu[.-]au"},name:"La Trobe Opal",parsers:[L.LaTrobeOpal]},{matcher:{hostnames:["scholarsarchive.byu.edu"]},name:"BYU Scholars Archive",parsers:[L.BYUScholarsArchive]}]},vr=I({hostnames:U(h()).min(1)}),br=I({regexp:h()}),_r=pe([vr,br]),yr=I({matcher:_r,name:h(),parsers:U(h()),libraryVersionRange:h().optional()}),Es=I({siteRegistrations:U(yr),version:h()}),Am=e=>Es.safeParse(e).success,Rm=e=>yr.safeParse(e).success,wm=e=>_r.safeParse(e).success,$s=e=>Object.values(L).includes(e),Im=e=>typeof e=="object"&&e!==null,As=I({url:h(),document:kl(Im)}),km=e=>As.safeParse(e).success;var St={exports:{}},Sr,Rs;function Et(){if(Rs)return Sr;Rs=1;const e="2.0.0",t=256,r=Number.MAX_SAFE_INTEGER||9007199254740991,n=16,o=t-6;return Sr={MAX_LENGTH:t,MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:o,MAX_SAFE_INTEGER:r,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Sr}var Er,ws;function $t(){return ws||(ws=1,Er=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{}),Er}var Is;function Xe(){return Is||(Is=1,(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:o}=Et(),s=$t();t=e.exports={};const i=t.re=[],a=t.safeRe=[],c=t.src=[],u=t.safeSrc=[],l=t.t={};let f=0;const d="[a-zA-Z0-9-]",g=[["\\s",1],["\\d",o],[d,n]],P=O=>{for(const[D,K]of g)O=O.split(`${D}*`).join(`${D}{0,${K}}`).split(`${D}+`).join(`${D}{1,${K}}`);return O},b=(O,D,K)=>{const x=P(D),B=f++;s(O,B,D),l[O]=B,c[B]=D,u[B]=x,i[B]=new RegExp(D,K?"g":void 0),a[B]=new RegExp(x,K?"g":void 0)};b("NUMERICIDENTIFIER","0|[1-9]\\d*"),b("NUMERICIDENTIFIERLOOSE","\\d+"),b("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${d}*`),b("MAINVERSION",`(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})`),b("MAINVERSIONLOOSE",`(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})`),b("PRERELEASEIDENTIFIER",`(?:${c[l.NONNUMERICIDENTIFIER]}|${c[l.NUMERICIDENTIFIER]})`),b("PRERELEASEIDENTIFIERLOOSE",`(?:${c[l.NONNUMERICIDENTIFIER]}|${c[l.NUMERICIDENTIFIERLOOSE]})`),b("PRERELEASE",`(?:-(${c[l.PRERELEASEIDENTIFIER]}(?:\\.${c[l.PRERELEASEIDENTIFIER]})*))`),b("PRERELEASELOOSE",`(?:-?(${c[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[l.PRERELEASEIDENTIFIERLOOSE]})*))`),b("BUILDIDENTIFIER",`${d}+`),b("BUILD",`(?:\\+(${c[l.BUILDIDENTIFIER]}(?:\\.${c[l.BUILDIDENTIFIER]})*))`),b("FULLPLAIN",`v?${c[l.MAINVERSION]}${c[l.PRERELEASE]}?${c[l.BUILD]}?`),b("FULL",`^${c[l.FULLPLAIN]}$`),b("LOOSEPLAIN",`[v=\\s]*${c[l.MAINVERSIONLOOSE]}${c[l.PRERELEASELOOSE]}?${c[l.BUILD]}?`),b("LOOSE",`^${c[l.LOOSEPLAIN]}$`),b("GTLT","((?:<|>)?=?)"),b("XRANGEIDENTIFIERLOOSE",`${c[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),b("XRANGEIDENTIFIER",`${c[l.NUMERICIDENTIFIER]}|x|X|\\*`),b("XRANGEPLAIN",`[v=\\s]*(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:${c[l.PRERELEASE]})?${c[l.BUILD]}?)?)?`),b("XRANGEPLAINLOOSE",`[v=\\s]*(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:${c[l.PRERELEASELOOSE]})?${c[l.BUILD]}?)?)?`),b("XRANGE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAIN]}$`),b("XRANGELOOSE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAINLOOSE]}$`),b("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),b("COERCE",`${c[l.COERCEPLAIN]}(?:$|[^\\d])`),b("COERCEFULL",c[l.COERCEPLAIN]+`(?:${c[l.PRERELEASE]})?(?:${c[l.BUILD]})?(?:$|[^\\d])`),b("COERCERTL",c[l.COERCE],!0),b("COERCERTLFULL",c[l.COERCEFULL],!0),b("LONETILDE","(?:~>?)"),b("TILDETRIM",`(\\s*)${c[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",b("TILDE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAIN]}$`),b("TILDELOOSE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAINLOOSE]}$`),b("LONECARET","(?:\\^)"),b("CARETTRIM",`(\\s*)${c[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",b("CARET",`^${c[l.LONECARET]}${c[l.XRANGEPLAIN]}$`),b("CARETLOOSE",`^${c[l.LONECARET]}${c[l.XRANGEPLAINLOOSE]}$`),b("COMPARATORLOOSE",`^${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]})$|^$`),b("COMPARATOR",`^${c[l.GTLT]}\\s*(${c[l.FULLPLAIN]})$|^$`),b("COMPARATORTRIM",`(\\s*)${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]}|${c[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",b("HYPHENRANGE",`^\\s*(${c[l.XRANGEPLAIN]})\\s+-\\s+(${c[l.XRANGEPLAIN]})\\s*$`),b("HYPHENRANGELOOSE",`^\\s*(${c[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[l.XRANGEPLAINLOOSE]})\\s*$`),b("STAR","(<|>)?=?\\s*\\*"),b("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),b("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(St,St.exports)),St.exports}var $r,ks;function Ar(){if(ks)return $r;ks=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return $r=n=>n?typeof n!="object"?e:n:t,$r}var Rr,Cs;function Ps(){if(Cs)return Rr;Cs=1;const e=/^[0-9]+$/,t=(n,o)=>{if(typeof n=="number"&&typeof o=="number")return n===o?0:n<o?-1:1;const s=e.test(n),i=e.test(o);return s&&i&&(n=+n,o=+o),n===o?0:s&&!i?-1:i&&!s?1:n<o?-1:1};return Rr={compareIdentifiers:t,rcompareIdentifiers:(n,o)=>t(o,n)},Rr}var wr,Os;function ne(){if(Os)return wr;Os=1;const e=$t(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:r}=Et(),{safeRe:n,t:o}=Xe(),s=Ar(),{compareIdentifiers:i}=Ps();class a{constructor(u,l){if(l=s(l),u instanceof a){if(u.loose===!!l.loose&&u.includePrerelease===!!l.includePrerelease)return u;u=u.version}else if(typeof u!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof u}".`);if(u.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",u,l),this.options=l,this.loose=!!l.loose,this.includePrerelease=!!l.includePrerelease;const f=u.trim().match(l.loose?n[o.LOOSE]:n[o.FULL]);if(!f)throw new TypeError(`Invalid Version: ${u}`);if(this.raw=u,this.major=+f[1],this.minor=+f[2],this.patch=+f[3],this.major>r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");f[4]?this.prerelease=f[4].split(".").map(d=>{if(/^[0-9]+$/.test(d)){const g=+d;if(g>=0&&g<r)return g}return d}):this.prerelease=[],this.build=f[5]?f[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(u){if(e("SemVer.compare",this.version,this.options,u),!(u instanceof a)){if(typeof u=="string"&&u===this.version)return 0;u=new a(u,this.options)}return u.version===this.version?0:this.compareMain(u)||this.comparePre(u)}compareMain(u){return u instanceof a||(u=new a(u,this.options)),this.major<u.major?-1:this.major>u.major?1:this.minor<u.minor?-1:this.minor>u.minor?1:this.patch<u.patch?-1:this.patch>u.patch?1:0}comparePre(u){if(u instanceof a||(u=new a(u,this.options)),this.prerelease.length&&!u.prerelease.length)return-1;if(!this.prerelease.length&&u.prerelease.length)return 1;if(!this.prerelease.length&&!u.prerelease.length)return 0;let l=0;do{const f=this.prerelease[l],d=u.prerelease[l];if(e("prerelease compare",l,f,d),f===void 0&&d===void 0)return 0;if(d===void 0)return 1;if(f===void 0)return-1;if(f===d)continue;return i(f,d)}while(++l)}compareBuild(u){u instanceof a||(u=new a(u,this.options));let l=0;do{const f=this.build[l],d=u.build[l];if(e("build compare",l,f,d),f===void 0&&d===void 0)return 0;if(d===void 0)return 1;if(f===void 0)return-1;if(f===d)continue;return i(f,d)}while(++l)}inc(u,l,f){if(u.startsWith("pre")){if(!l&&f===!1)throw new Error("invalid increment argument: identifier is empty");if(l){const d=`-${l}`.match(this.options.loose?n[o.PRERELEASELOOSE]:n[o.PRERELEASE]);if(!d||d[1]!==l)throw new Error(`invalid identifier: ${l}`)}}switch(u){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",l,f);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",l,f);break;case"prepatch":this.prerelease.length=0,this.inc("patch",l,f),this.inc("pre",l,f);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",l,f),this.inc("pre",l,f);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const d=Number(f)?1:0;if(this.prerelease.length===0)this.prerelease=[d];else{let g=this.prerelease.length;for(;--g>=0;)typeof this.prerelease[g]=="number"&&(this.prerelease[g]++,g=-2);if(g===-1){if(l===this.prerelease.join(".")&&f===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(d)}}if(l){let g=[l,d];f===!1&&(g=[l]),i(this.prerelease[0],l)===0?isNaN(this.prerelease[1])&&(this.prerelease=g):this.prerelease=g}break}default:throw new Error(`invalid increment argument: ${u}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return wr=a,wr}var Ir,Ns;function qe(){if(Ns)return Ir;Ns=1;const e=ne();return Ir=(r,n,o=!1)=>{if(r instanceof e)return r;try{return new e(r,n)}catch(s){if(!o)return null;throw s}},Ir}var kr,zs;function Cm(){if(zs)return kr;zs=1;const e=qe();return kr=(r,n)=>{const o=e(r,n);return o?o.version:null},kr}var Cr,Ls;function Pm(){if(Ls)return Cr;Ls=1;const e=qe();return Cr=(r,n)=>{const o=e(r.trim().replace(/^[=v]+/,""),n);return o?o.version:null},Cr}var Pr,xs;function Om(){if(xs)return Pr;xs=1;const e=ne();return Pr=(r,n,o,s,i)=>{typeof o=="string"&&(i=s,s=o,o=void 0);try{return new e(r instanceof e?r.version:r,o).inc(n,s,i).version}catch{return null}},Pr}var Or,Ts;function Nm(){if(Ts)return Or;Ts=1;const e=qe();return Or=(r,n)=>{const o=e(r,null,!0),s=e(n,null,!0),i=o.compare(s);if(i===0)return null;const a=i>0,c=a?o:s,u=a?s:o,l=!!c.prerelease.length;if(!!u.prerelease.length&&!l){if(!u.patch&&!u.minor)return"major";if(u.compareMain(c)===0)return u.minor&&!u.patch?"minor":"patch"}const d=l?"pre":"";return o.major!==s.major?d+"major":o.minor!==s.minor?d+"minor":o.patch!==s.patch?d+"patch":"prerelease"},Or}var Nr,qs;function zm(){if(qs)return Nr;qs=1;const e=ne();return Nr=(r,n)=>new e(r,n).major,Nr}var zr,Ds;function Lm(){if(Ds)return zr;Ds=1;const e=ne();return zr=(r,n)=>new e(r,n).minor,zr}var Lr,Zs;function xm(){if(Zs)return Lr;Zs=1;const e=ne();return Lr=(r,n)=>new e(r,n).patch,Lr}var xr,js;function Tm(){if(js)return xr;js=1;const e=qe();return xr=(r,n)=>{const o=e(r,n);return o&&o.prerelease.length?o.prerelease:null},xr}var Tr,Us;function ue(){if(Us)return Tr;Us=1;const e=ne();return Tr=(r,n,o)=>new e(r,o).compare(new e(n,o)),Tr}var qr,Bs;function qm(){if(Bs)return qr;Bs=1;const e=ue();return qr=(r,n,o)=>e(n,r,o),qr}var Dr,Vs;function Dm(){if(Vs)return Dr;Vs=1;const e=ue();return Dr=(r,n)=>e(r,n,!0),Dr}var Zr,Fs;function jr(){if(Fs)return Zr;Fs=1;const e=ne();return Zr=(r,n,o)=>{const s=new e(r,o),i=new e(n,o);return s.compare(i)||s.compareBuild(i)},Zr}var Ur,Js;function Zm(){if(Js)return Ur;Js=1;const e=jr();return Ur=(r,n)=>r.sort((o,s)=>e(o,s,n)),Ur}var Br,Ms;function jm(){if(Ms)return Br;Ms=1;const e=jr();return Br=(r,n)=>r.sort((o,s)=>e(s,o,n)),Br}var Vr,Ws;function At(){if(Ws)return Vr;Ws=1;const e=ue();return Vr=(r,n,o)=>e(r,n,o)>0,Vr}var Fr,Gs;function Jr(){if(Gs)return Fr;Gs=1;const e=ue();return Fr=(r,n,o)=>e(r,n,o)<0,Fr}var Mr,Xs;function Hs(){if(Xs)return Mr;Xs=1;const e=ue();return Mr=(r,n,o)=>e(r,n,o)===0,Mr}var Wr,Ys;function Ks(){if(Ys)return Wr;Ys=1;const e=ue();return Wr=(r,n,o)=>e(r,n,o)!==0,Wr}var Gr,Qs;function Xr(){if(Qs)return Gr;Qs=1;const e=ue();return Gr=(r,n,o)=>e(r,n,o)>=0,Gr}var Hr,ei;function Yr(){if(ei)return Hr;ei=1;const e=ue();return Hr=(r,n,o)=>e(r,n,o)<=0,Hr}var Kr,ti;function ri(){if(ti)return Kr;ti=1;const e=Hs(),t=Ks(),r=At(),n=Xr(),o=Jr(),s=Yr();return Kr=(a,c,u,l)=>{switch(c){case"===":return typeof a=="object"&&(a=a.version),typeof u=="object"&&(u=u.version),a===u;case"!==":return typeof a=="object"&&(a=a.version),typeof u=="object"&&(u=u.version),a!==u;case"":case"=":case"==":return e(a,u,l);case"!=":return t(a,u,l);case">":return r(a,u,l);case">=":return n(a,u,l);case"<":return o(a,u,l);case"<=":return s(a,u,l);default:throw new TypeError(`Invalid operator: ${c}`)}},Kr}var Qr,ni;function Um(){if(ni)return Qr;ni=1;const e=ne(),t=qe(),{safeRe:r,t:n}=Xe();return Qr=(s,i)=>{if(s instanceof e)return s;if(typeof s=="number"&&(s=String(s)),typeof s!="string")return null;i=i||{};let a=null;if(!i.rtl)a=s.match(i.includePrerelease?r[n.COERCEFULL]:r[n.COERCE]);else{const g=i.includePrerelease?r[n.COERCERTLFULL]:r[n.COERCERTL];let P;for(;(P=g.exec(s))&&(!a||a.index+a[0].length!==s.length);)(!a||P.index+P[0].length!==a.index+a[0].length)&&(a=P),g.lastIndex=P.index+P[1].length+P[2].length;g.lastIndex=-1}if(a===null)return null;const c=a[2],u=a[3]||"0",l=a[4]||"0",f=i.includePrerelease&&a[5]?`-${a[5]}`:"",d=i.includePrerelease&&a[6]?`+${a[6]}`:"";return t(`${c}.${u}.${l}${f}${d}`,i)},Qr}var en,oi;function Bm(){if(oi)return en;oi=1;class e{constructor(){this.max=1e3,this.map=new Map}get(r){const n=this.map.get(r);if(n!==void 0)return this.map.delete(r),this.map.set(r,n),n}delete(r){return this.map.delete(r)}set(r,n){if(!this.delete(r)&&n!==void 0){if(this.map.size>=this.max){const s=this.map.keys().next().value;this.delete(s)}this.map.set(r,n)}return this}}return en=e,en}var tn,si;function le(){if(si)return tn;si=1;const e=/\s+/g;class t{constructor(y,k){if(k=o(k),y instanceof t)return y.loose===!!k.loose&&y.includePrerelease===!!k.includePrerelease?y:new t(y.raw,k);if(y instanceof s)return this.raw=y.value,this.set=[[y]],this.formatted=void 0,this;if(this.options=k,this.loose=!!k.loose,this.includePrerelease=!!k.includePrerelease,this.raw=y.trim().replace(e," "),this.set=this.raw.split("||").map(R=>this.parseRange(R.trim())).filter(R=>R.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const R=this.set[0];if(this.set=this.set.filter(C=>!b(C[0])),this.set.length===0)this.set=[R];else if(this.set.length>1){for(const C of this.set)if(C.length===1&&O(C[0])){this.set=[C];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let y=0;y<this.set.length;y++){y>0&&(this.formatted+="||");const k=this.set[y];for(let R=0;R<k.length;R++)R>0&&(this.formatted+=" "),this.formatted+=k[R].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(y){const R=((this.options.includePrerelease&&g)|(this.options.loose&&P))+":"+y,C=n.get(R);if(C)return C;const w=this.options.loose,N=w?c[u.HYPHENRANGELOOSE]:c[u.HYPHENRANGE];y=y.replace(N,yn(this.options.includePrerelease)),i("hyphen replace",y),y=y.replace(c[u.COMPARATORTRIM],l),i("comparator trim",y),y=y.replace(c[u.TILDETRIM],f),i("tilde trim",y),y=y.replace(c[u.CARETTRIM],d),i("caret trim",y);let j=y.split(" ").map(ee=>K(ee,this.options)).join(" ").split(/\s+/).map(ee=>_n(ee,this.options));w&&(j=j.filter(ee=>(i("loose invalid filter",ee,this.options),!!ee.match(c[u.COMPARATORLOOSE])))),i("range list",j);const T=new Map,F=j.map(ee=>new s(ee,this.options));for(const ee of F){if(b(ee))return[ee];T.set(ee.value,ee)}T.size>1&&T.has("")&&T.delete("");const oe=[...T.values()];return n.set(R,oe),oe}intersects(y,k){if(!(y instanceof t))throw new TypeError("a Range is required");return this.set.some(R=>D(R,k)&&y.set.some(C=>D(C,k)&&R.every(w=>C.every(N=>w.intersects(N,k)))))}test(y){if(!y)return!1;if(typeof y=="string")try{y=new a(y,this.options)}catch{return!1}for(let k=0;k<this.set.length;k++)if(Sn(this.set[k],y,this.options))return!0;return!1}}tn=t;const r=Bm(),n=new r,o=Ar(),s=Rt(),i=$t(),a=ne(),{safeRe:c,t:u,comparatorTrimReplace:l,tildeTrimReplace:f,caretTrimReplace:d}=Xe(),{FLAG_INCLUDE_PRERELEASE:g,FLAG_LOOSE:P}=Et(),b=E=>E.value==="<0.0.0-0",O=E=>E.value==="",D=(E,y)=>{let k=!0;const R=E.slice();let C=R.pop();for(;k&&R.length;)k=R.every(w=>C.intersects(w,y)),C=R.pop();return k},K=(E,y)=>(E=E.replace(c[u.BUILD],""),i("comp",E,y),E=G(E,y),i("caret",E),E=B(E,y),i("tildes",E),E=z(E,y),i("xrange",E),E=bn(E,y),i("stars",E),E),x=E=>!E||E.toLowerCase()==="x"||E==="*",B=(E,y)=>E.trim().split(/\s+/).map(k=>Q(k,y)).join(" "),Q=(E,y)=>{const k=y.loose?c[u.TILDELOOSE]:c[u.TILDE];return E.replace(k,(R,C,w,N,j)=>{i("tilde",E,R,C,w,N,j);let T;return x(C)?T="":x(w)?T=`>=${C}.0.0 <${+C+1}.0.0-0`:x(N)?T=`>=${C}.${w}.0 <${C}.${+w+1}.0-0`:j?(i("replaceTilde pr",j),T=`>=${C}.${w}.${N}-${j} <${C}.${+w+1}.0-0`):T=`>=${C}.${w}.${N} <${C}.${+w+1}.0-0`,i("tilde return",T),T})},G=(E,y)=>E.trim().split(/\s+/).map(k=>te(k,y)).join(" "),te=(E,y)=>{i("caret",E,y);const k=y.loose?c[u.CARETLOOSE]:c[u.CARET],R=y.includePrerelease?"-0":"";return E.replace(k,(C,w,N,j,T)=>{i("caret",E,C,w,N,j,T);let F;return x(w)?F="":x(N)?F=`>=${w}.0.0${R} <${+w+1}.0.0-0`:x(j)?w==="0"?F=`>=${w}.${N}.0${R} <${w}.${+N+1}.0-0`:F=`>=${w}.${N}.0${R} <${+w+1}.0.0-0`:T?(i("replaceCaret pr",T),w==="0"?N==="0"?F=`>=${w}.${N}.${j}-${T} <${w}.${N}.${+j+1}-0`:F=`>=${w}.${N}.${j}-${T} <${w}.${+N+1}.0-0`:F=`>=${w}.${N}.${j}-${T} <${+w+1}.0.0-0`):(i("no pr"),w==="0"?N==="0"?F=`>=${w}.${N}.${j}${R} <${w}.${N}.${+j+1}-0`:F=`>=${w}.${N}.${j}${R} <${w}.${+N+1}.0-0`:F=`>=${w}.${N}.${j} <${+w+1}.0.0-0`),i("caret return",F),F})},z=(E,y)=>(i("replaceXRanges",E,y),E.split(/\s+/).map(k=>He(k,y)).join(" ")),He=(E,y)=>{E=E.trim();const k=y.loose?c[u.XRANGELOOSE]:c[u.XRANGE];return E.replace(k,(R,C,w,N,j,T)=>{i("xRange",E,R,C,w,N,j,T);const F=x(w),oe=F||x(N),ee=oe||x(j),Ye=ee;return C==="="&&Ye&&(C=""),T=y.includePrerelease?"-0":"",F?C===">"||C==="<"?R="<0.0.0-0":R="*":C&&Ye?(oe&&(N=0),j=0,C===">"?(C=">=",oe?(w=+w+1,N=0,j=0):(N=+N+1,j=0)):C==="<="&&(C="<",oe?w=+w+1:N=+N+1),C==="<"&&(T="-0"),R=`${C+w}.${N}.${j}${T}`):oe?R=`>=${w}.0.0${T} <${+w+1}.0.0-0`:ee&&(R=`>=${w}.${N}.0${T} <${w}.${+N+1}.0-0`),i("xRange return",R),R})},bn=(E,y)=>(i("replaceStars",E,y),E.trim().replace(c[u.STAR],"")),_n=(E,y)=>(i("replaceGTE0",E,y),E.trim().replace(c[y.includePrerelease?u.GTE0PRE:u.GTE0],"")),yn=E=>(y,k,R,C,w,N,j,T,F,oe,ee,Ye)=>(x(R)?k="":x(C)?k=`>=${R}.0.0${E?"-0":""}`:x(w)?k=`>=${R}.${C}.0${E?"-0":""}`:N?k=`>=${k}`:k=`>=${k}${E?"-0":""}`,x(F)?T="":x(oe)?T=`<${+F+1}.0.0-0`:x(ee)?T=`<${F}.${+oe+1}.0-0`:Ye?T=`<=${F}.${oe}.${ee}-${Ye}`:E?T=`<${F}.${oe}.${+ee+1}-0`:T=`<=${T}`,`${k} ${T}`.trim()),Sn=(E,y,k)=>{for(let R=0;R<E.length;R++)if(!E[R].test(y))return!1;if(y.prerelease.length&&!k.includePrerelease){for(let R=0;R<E.length;R++)if(i(E[R].semver),E[R].semver!==s.ANY&&E[R].semver.prerelease.length>0){const C=E[R].semver;if(C.major===y.major&&C.minor===y.minor&&C.patch===y.patch)return!0}return!1}return!0};return tn}var rn,ii;function Rt(){if(ii)return rn;ii=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(l,f){if(f=r(f),l instanceof t){if(l.loose===!!f.loose)return l;l=l.value}l=l.trim().split(/\s+/).join(" "),i("comparator",l,f),this.options=f,this.loose=!!f.loose,this.parse(l),this.semver===e?this.value="":this.value=this.operator+this.semver.version,i("comp",this)}parse(l){const f=this.options.loose?n[o.COMPARATORLOOSE]:n[o.COMPARATOR],d=l.match(f);if(!d)throw new TypeError(`Invalid comparator: ${l}`);this.operator=d[1]!==void 0?d[1]:"",this.operator==="="&&(this.operator=""),d[2]?this.semver=new a(d[2],this.options.loose):this.semver=e}toString(){return this.value}test(l){if(i("Comparator.test",l,this.options.loose),this.semver===e||l===e)return!0;if(typeof l=="string")try{l=new a(l,this.options)}catch{return!1}return s(l,this.operator,this.semver,this.options)}intersects(l,f){if(!(l instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new c(l.value,f).test(this.value):l.operator===""?l.value===""?!0:new c(this.value,f).test(l.semver):(f=r(f),f.includePrerelease&&(this.value==="<0.0.0-0"||l.value==="<0.0.0-0")||!f.includePrerelease&&(this.value.startsWith("<0.0.0")||l.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&l.operator.startsWith(">")||this.operator.startsWith("<")&&l.operator.startsWith("<")||this.semver.version===l.semver.version&&this.operator.includes("=")&&l.operator.includes("=")||s(this.semver,"<",l.semver,f)&&this.operator.startsWith(">")&&l.operator.startsWith("<")||s(this.semver,">",l.semver,f)&&this.operator.startsWith("<")&&l.operator.startsWith(">")))}}rn=t;const r=Ar(),{safeRe:n,t:o}=Xe(),s=ri(),i=$t(),a=ne(),c=le();return rn}var nn,ai;function wt(){if(ai)return nn;ai=1;const e=le();return nn=(r,n,o)=>{try{n=new e(n,o)}catch{return!1}return n.test(r)},nn}var on,ci;function Vm(){if(ci)return on;ci=1;const e=le();return on=(r,n)=>new e(r,n).set.map(o=>o.map(s=>s.value).join(" ").trim().split(" ")),on}var sn,ui;function Fm(){if(ui)return sn;ui=1;const e=ne(),t=le();return sn=(n,o,s)=>{let i=null,a=null,c=null;try{c=new t(o,s)}catch{return null}return n.forEach(u=>{c.test(u)&&(!i||a.compare(u)===-1)&&(i=u,a=new e(i,s))}),i},sn}var an,li;function Jm(){if(li)return an;li=1;const e=ne(),t=le();return an=(n,o,s)=>{let i=null,a=null,c=null;try{c=new t(o,s)}catch{return null}return n.forEach(u=>{c.test(u)&&(!i||a.compare(u)===1)&&(i=u,a=new e(i,s))}),i},an}var cn,pi;function Mm(){if(pi)return cn;pi=1;const e=ne(),t=le(),r=At();return cn=(o,s)=>{o=new t(o,s);let i=new e("0.0.0");if(o.test(i)||(i=new e("0.0.0-0"),o.test(i)))return i;i=null;for(let a=0;a<o.set.length;++a){const c=o.set[a];let u=null;c.forEach(l=>{const f=new e(l.semver.version);switch(l.operator){case">":f.prerelease.length===0?f.patch++:f.prerelease.push(0),f.raw=f.format();case"":case">=":(!u||r(f,u))&&(u=f);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${l.operator}`)}}),u&&(!i||r(i,u))&&(i=u)}return i&&o.test(i)?i:null},cn}var un,hi;function Wm(){if(hi)return un;hi=1;const e=le();return un=(r,n)=>{try{return new e(r,n).range||"*"}catch{return null}},un}var ln,fi;function pn(){if(fi)return ln;fi=1;const e=ne(),t=Rt(),{ANY:r}=t,n=le(),o=wt(),s=At(),i=Jr(),a=Yr(),c=Xr();return ln=(l,f,d,g)=>{l=new e(l,g),f=new n(f,g);let P,b,O,D,K;switch(d){case">":P=s,b=a,O=i,D=">",K=">=";break;case"<":P=i,b=c,O=s,D="<",K="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(o(l,f,g))return!1;for(let x=0;x<f.set.length;++x){const B=f.set[x];let Q=null,G=null;if(B.forEach(te=>{te.semver===r&&(te=new t(">=0.0.0")),Q=Q||te,G=G||te,P(te.semver,Q.semver,g)?Q=te:O(te.semver,G.semver,g)&&(G=te)}),Q.operator===D||Q.operator===K||(!G.operator||G.operator===D)&&b(l,G.semver))return!1;if(G.operator===K&&O(l,G.semver))return!1}return!0},ln}var hn,di;function Gm(){if(di)return hn;di=1;const e=pn();return hn=(r,n,o)=>e(r,n,">",o),hn}var fn,mi;function Xm(){if(mi)return fn;mi=1;const e=pn();return fn=(r,n,o)=>e(r,n,"<",o),fn}var dn,gi;function Hm(){if(gi)return dn;gi=1;const e=le();return dn=(r,n,o)=>(r=new e(r,o),n=new e(n,o),r.intersects(n,o)),dn}var mn,vi;function Ym(){if(vi)return mn;vi=1;const e=wt(),t=ue();return mn=(r,n,o)=>{const s=[];let i=null,a=null;const c=r.sort((d,g)=>t(d,g,o));for(const d of c)e(d,n,o)?(a=d,i||(i=d)):(a&&s.push([i,a]),a=null,i=null);i&&s.push([i,null]);const u=[];for(const[d,g]of s)d===g?u.push(d):!g&&d===c[0]?u.push("*"):g?d===c[0]?u.push(`<=${g}`):u.push(`${d} - ${g}`):u.push(`>=${d}`);const l=u.join(" || "),f=typeof n.raw=="string"?n.raw:String(n);return l.length<f.length?l:n},mn}var gn,bi;function Km(){if(bi)return gn;bi=1;const e=le(),t=Rt(),{ANY:r}=t,n=wt(),o=ue(),s=(f,d,g={})=>{if(f===d)return!0;f=new e(f,g),d=new e(d,g);let P=!1;e:for(const b of f.set){for(const O of d.set){const D=c(b,O,g);if(P=P||D!==null,D)continue e}if(P)return!1}return!0},i=[new t(">=0.0.0-0")],a=[new t(">=0.0.0")],c=(f,d,g)=>{if(f===d)return!0;if(f.length===1&&f[0].semver===r){if(d.length===1&&d[0].semver===r)return!0;g.includePrerelease?f=i:f=a}if(d.length===1&&d[0].semver===r){if(g.includePrerelease)return!0;d=a}const P=new Set;let b,O;for(const z of f)z.operator===">"||z.operator===">="?b=u(b,z,g):z.operator==="<"||z.operator==="<="?O=l(O,z,g):P.add(z.semver);if(P.size>1)return null;let D;if(b&&O){if(D=o(b.semver,O.semver,g),D>0)return null;if(D===0&&(b.operator!==">="||O.operator!=="<="))return null}for(const z of P){if(b&&!n(z,String(b),g)||O&&!n(z,String(O),g))return null;for(const He of d)if(!n(z,String(He),g))return!1;return!0}let K,x,B,Q,G=O&&!g.includePrerelease&&O.semver.prerelease.length?O.semver:!1,te=b&&!g.includePrerelease&&b.semver.prerelease.length?b.semver:!1;G&&G.prerelease.length===1&&O.operator==="<"&&G.prerelease[0]===0&&(G=!1);for(const z of d){if(Q=Q||z.operator===">"||z.operator===">=",B=B||z.operator==="<"||z.operator==="<=",b){if(te&&z.semver.prerelease&&z.semver.prerelease.length&&z.semver.major===te.major&&z.semver.minor===te.minor&&z.semver.patch===te.patch&&(te=!1),z.operator===">"||z.operator===">="){if(K=u(b,z,g),K===z&&K!==b)return!1}else if(b.operator===">="&&!n(b.semver,String(z),g))return!1}if(O){if(G&&z.semver.prerelease&&z.semver.prerelease.length&&z.semver.major===G.major&&z.semver.minor===G.minor&&z.semver.patch===G.patch&&(G=!1),z.operator==="<"||z.operator==="<="){if(x=l(O,z,g),x===z&&x!==O)return!1}else if(O.operator==="<="&&!n(O.semver,String(z),g))return!1}if(!z.operator&&(O||b)&&D!==0)return!1}return!(b&&B&&!O&&D!==0||O&&Q&&!b&&D!==0||te||G)},u=(f,d,g)=>{if(!f)return d;const P=o(f.semver,d.semver,g);return P>0?f:P<0||d.operator===">"&&f.operator===">="?d:f},l=(f,d,g)=>{if(!f)return d;const P=o(f.semver,d.semver,g);return P<0?f:P>0||d.operator==="<"&&f.operator==="<="?d:f};return gn=s,gn}var vn,_i;function Qm(){if(_i)return vn;_i=1;const e=Xe(),t=Et(),r=ne(),n=Ps(),o=qe(),s=Cm(),i=Pm(),a=Om(),c=Nm(),u=zm(),l=Lm(),f=xm(),d=Tm(),g=ue(),P=qm(),b=Dm(),O=jr(),D=Zm(),K=jm(),x=At(),B=Jr(),Q=Hs(),G=Ks(),te=Xr(),z=Yr(),He=ri(),bn=Um(),_n=Rt(),yn=le(),Sn=wt(),E=Vm(),y=Fm(),k=Jm(),R=Mm(),C=Wm(),w=pn(),N=Gm(),j=Xm(),T=Hm(),F=Ym(),oe=Km();return vn={parse:o,valid:s,clean:i,inc:a,diff:c,major:u,minor:l,patch:f,prerelease:d,compare:g,rcompare:P,compareLoose:b,compareBuild:O,sort:D,rsort:K,gt:x,lt:B,eq:Q,neq:G,gte:te,lte:z,cmp:He,coerce:bn,Comparator:_n,Range:yn,satisfies:Sn,toComparators:E,maxSatisfying:y,minSatisfying:k,minVersion:R,validRange:C,outside:w,gtr:N,ltr:j,intersects:T,simplifyRange:F,subset:oe,SemVer:r,re:e.re,src:e.src,tokens:e.t,SEMVER_SPEC_VERSION:t.SEMVER_SPEC_VERSION,RELEASE_TYPES:t.RELEASE_TYPES,compareIdentifiers:n.compareIdentifiers,rcompareIdentifiers:n.rcompareIdentifiers},vn}var eg=Qm();const tg=(e,t)=>rg(t)?t.hostnames.includes(new URL(e).hostname):ng(t)?!!e.match(t.regexp):!1,rg=e=>vr.safeParse(e).success,ng=e=>br.safeParse(e).success,og=(e,t)=>t?eg.satisfies(e,t):!0,sg=(e,t,r)=>og(t,r.libraryVersionRange)&&tg(e,r.matcher),ig=(e,t)=>e.siteRegistrations.filter(r=>sg(t,gr(),r)),ag=(e,t)=>ig(e,t).flatMap(({parsers:o,name:s})=>o.filter(i=>$s(i)&&i in mr).map(i=>({parser:mr[i],parserType:i,name:s}))),yi=(e,t)=>{const r=ag(e,t.url);for(const{parser:n,parserType:o,name:s}of r){const i=n(t);if(dt(i)||Jo(i)||Mo(i))return{...i,meta:{parserName:s,parserType:o,uri:t.url,referrer:t.url}}}return{...Vo(),meta:{parserName:null,parserType:L.NoResourceFound,uri:t.url,referrer:t.url}}},cg=(e,t)=>{const r=yi(e,t),{uri:n,...o}=r.meta;return{...r,meta:o}},ug=(e,t)=>{switch(t){case _e.CA:return new URL(`https://${e}.rl.ca.talis.com`);default:return new URL(`https://${e}.rl.talis.com`)}},lg=(e,t)=>{const r=ug(e,t);return new URL("/ui/forms/bookmarklet.html",r)},pg=(e,t,r)=>{const n=Eo(t);n.append("fast","true"),n.append("breakout","true"),r&&(r.parserName&&n.append("targetTitle",r.parserName),n.append("referrer",r.referrer));const o=new URL(e.toString());return o.search=n.toString(),o};v.BookGenresSchema=Ol,v.CustomerListSchema=Io,v.CustomerSchema=Vt,v.DirectLinkOnlyResultSchema=Wt,v.Genre=S,v.HostnamesMatcherSchema=vr,v.JournalGenresSchema=Nl,v.NON_OPENURL_PROPERTIES=Ut,v.NonOpenUrlPropertiesSchema=Zt,v.NothingParsedResultSchema=Mt,v.OPENURL_KEYS=yo,v.OpenUrlAudioVisualResourceSchema=xl,v.OpenUrlBookResourceSchema=zl,v.OpenUrlDocumentResourceSchema=ql,v.OpenUrlImageResourceSchema=Tl,v.OpenUrlJournalResourceSchema=Ll,v.OpenUrlResourceSchema=de,v.OpenUrlResultSchema=Gt,v.OpenUrlWebpageResourceSchema=Dl,v.PARSERS=mr,v.ParserRegistrySchema=Es,v.ParserType=L,v.ParsingMetadataSchema=Ft,v.ParsingMetadataV2Schema=Jt,v.ParsingRequestSchema=wo,v.ParsingResponseSchema=Oo,v.ParsingResponseV2Schema=No,v.ParsingResultSchema=lt,v.REGISTRY=$m,v.RegExpMatcherSchema=br,v.ResourceDataSchema=As,v.ResourceSchema=vo,v.SiteRegistrationSchema=yr,v.SummonSearchResultSchema=Ht,v.TenantRegion=_e,v.TenantRegistrySchema=Fl,v.TenantSchema=Bt,v.UrlMatcherSchema=_r,v.Z3988SearchResultSchema=Xt,v.convertCustomerListToTenantRegistry=Wl,v.createAudioVisual=fe,v.createBook=W,v.createDocument=jt,v.createImage=bo,v.createJournal=Z,v.createWebpage=ut,v.directLinkOnly=Xl,v.fromOpenUrl=Ao,v.getBaseBookmarkingUrl=lg,v.getLibraryVersion=gr,v.isCustomer=ko,v.isCustomerList=Co,v.isDirectLinkOnlyResult=_h,v.isGenre=Vl,v.isNothingParsedResult=yh,v.isOpenUrlResult=dt,v.isParserRegistry=Am,v.isParserType=$s,v.isParsingMetadata=vh,v.isParsingMetadataV2=bh,v.isParsingRequest=Jl,v.isParsingResponse=mh,v.isParsingResponseV2=gh,v.isParsingResult=dh,v.isResourceData=km,v.isSiteRegistration=Rm,v.isSummonSearchResult=Mo,v.isTenant=Po,v.isTenantRegion=Ml,v.isUrlMatcher=wm,v.isZ3988SearchResult=Jo,v.nothingParsed=q,v.openUrlResource=$,v.parseResource=yi,v.parseResourceV2=cg,v.summonSearchResult=Lo,v.toBookmarkingWorkflowUrl=pg,v.toOpenUrl=Eo,v.z3988SearchResult=zo,Object.defineProperty(v,Symbol.toStringTag,{value:"Module"})}));