@talisdev/bibliographic-resource-parsers-lib 5.24.0 → 5.25.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,u){var c;Object.defineProperty(a,"_zod",{value:a._zod??{},enumerable:!1}),(c=a._zod).traits??(c.traits=new Set),a._zod.traits.add(e),t(a,u);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=u}const o=r?.Parent??Object;class s extends o{}Object.defineProperty(s,"name",{value:e});function i(a){var u;const c=r?.Parent?new s:this;n(c,a),(u=c._zod).deferred??(u.deferred=[]);for(const l of c._zod.deferred)l();return c}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 fn extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const mn={};function de(e){return mn}function mi(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 yt(e,t){return typeof t=="bigint"?t.toString():t}function $t(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Rt(e){return e==null}function At(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function di(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 u=n.match(/\d?e-(\d?)/);u?.[1]&&(o=Number.parseInt(u[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 dn=Symbol("evaluating");function V(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==dn)return n===void 0&&(n=dn,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Re(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Ae(...e){const t={};for(const r of e){const n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function gn(e){return JSON.stringify(e)}const vn="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Xe(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const gi=$t(()=>{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(Xe(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(Xe(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function bn(e){return Oe(e)?{...e}:Array.isArray(e)?[...e]:e}const vi=new Set(["string","number","symbol"]);function Ne(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ge(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 bi(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const _i={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=Ae(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 Re(this,"shape",o),o},checks:[]});return ge(e,n)}function Ei(e,t){const r=e._zod.def,n=Ae(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 Re(this,"shape",o),o},checks:[]});return ge(e,n)}function yi(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=Ae(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return Re(this,"shape",s),s},checks:[]});return ge(e,o)}function $i(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 Re(this,"shape",n),n},checks:e._zod.def.checks};return ge(e,r)}function Ri(e,t){const r=Ae(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return Re(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return ge(e,r)}function Ai(e,t,r){const n=Ae(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 Re(this,"shape",s),s},checks:[]});return ge(t,n)}function wi(e,t,r){const n=Ae(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 Re(this,"shape",s),s},checks:[]});return ge(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 He(e){return typeof e=="string"?e:e?.message}function ve(e,t,r){const n={...e,path:e.path??[]};if(!e.message){const o=He(e.inst?._zod.def?.error?.(e))??He(t?.error?.(e))??He(r.customError?.(e))??He(r.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function wt(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function xe(...e){const[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}const _n=(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,yt,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Sn=d("$ZodError",_n),En=d("$ZodError",_n,{Parent:Error});function Ii(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 ki(e,t){const r=t||function(s){return s.message},n={_errors:[]},o=s=>{for(const i of s.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(a=>o({issues:a}));else if(i.code==="invalid_key")o({issues:i.issues});else if(i.code==="invalid_element")o({issues:i.issues});else if(i.path.length===0)n._errors.push(r(i));else{let a=n,u=0;for(;u<i.path.length;){const c=i.path[u];u===i.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(r(i))):a[c]=a[c]||{_errors:[]},a=a[c],u++}}};return o(e),n}const It=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(u=>ve(u,s,de())));throw vn(a,o?.callee),a}return i.value},kt=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(u=>ve(u,s,de())));throw vn(a,o?.callee),a}return i.value},Ye=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??Sn)(s.issues.map(i=>ve(i,o,de())))}:{success:!0,data:s.value}},Ci=Ye(En),Ke=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=>ve(i,o,de())))}:{success:!0,data:s.value}},Pi=Ke(En),Oi=e=>(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return It(e)(t,r,o)},Ni=e=>(t,r,n)=>It(e)(t,r,n),zi=e=>async(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return kt(e)(t,r,o)},Li=e=>async(t,r,n)=>kt(e)(t,r,n),Ti=e=>(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Ye(e)(t,r,o)},Zi=e=>(t,r,n)=>Ye(e)(t,r,n),xi=e=>async(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Ke(e)(t,r,o)},qi=e=>async(t,r,n)=>Ke(e)(t,r,n),ji=/^[cC][^\s-]{8,}$/,Di=/^[0-9a-z]+$/,Ui=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Bi=/^[0-9a-vA-V]{20}$/,Vi=/^[A-Za-z0-9]{27}$/,Fi=/^[a-zA-Z0-9_-]{21}$/,Ji=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Mi=/^([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})$/,yn=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)$/,Wi=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Gi="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Xi(){return new RegExp(Gi,"u")}const Hi=/^(?:(?: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])$/,Yi=/^(([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}|:))$/,Ki=/^((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])$/,Qi=/^(([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])$/,ea=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,$n=/^[A-Za-z0-9_-]*$/,ta=/^(?=.{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])?)*\.?$/,ra=/^\+(?:[0-9]){6,14}[0-9]$/,Rn="(?:(?:\\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])))",na=new RegExp(`^${Rn}$`);function An(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 oa(e){return new RegExp(`^${An(e)}$`)}function sa(e){const t=An({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(`^${Rn}T(?:${n})$`)}const ia=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},aa=/^-?\d+$/,ca=/^-?\d+(?:\.\d+)?/,ua=/^null$/i,la=/^[^A-Z]*$/,pa=/^[^a-z]*$/,se=d("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),wn={number:"number",bigint:"bigint",object:"date"},In=d("$ZodCheckLessThan",(e,t)=>{se.init(e,t);const r=wn[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})}}),kn=d("$ZodCheckGreaterThan",(e,t)=>{se.init(e,t);const r=wn[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})}}),ha=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):di(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})}}),fa=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]=_i[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=aa)}),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})}}),ma=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=wt(o);n.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),da=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=wt(o);n.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),ga=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=wt(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})}}),Qe=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=()=>{})}),va=d("$ZodCheckRegex",(e,t)=>{Qe.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})}}),ba=d("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=la),Qe.init(e,t)}),_a=d("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=pa),Qe.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})}}),ya=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})}}),$a=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,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,u){var c;Object.defineProperty(a,"_zod",{value:a._zod??{},enumerable:!1}),(c=a._zod).traits??(c.traits=new Set),a._zod.traits.add(e),t(a,u);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=u}const o=r?.Parent??Object;class s extends o{}Object.defineProperty(s,"name",{value:e});function i(a){var u;const c=r?.Parent?new s:this;n(c,a),(u=c._zod).deferred??(u.deferred=[]);for(const l of c._zod.deferred)l();return c}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 fn extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const mn={};function de(e){return mn}function mi(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 yt(e,t){return typeof t=="bigint"?t.toString():t}function $t(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Rt(e){return e==null}function At(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function di(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 u=n.match(/\d?e-(\d?)/);u?.[1]&&(o=Number.parseInt(u[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 dn=Symbol("evaluating");function V(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==dn)return n===void 0&&(n=dn,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Re(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Ae(...e){const t={};for(const r of e){const n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function gn(e){return JSON.stringify(e)}const vn="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Xe(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const gi=$t(()=>{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(Xe(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(Xe(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function bn(e){return Oe(e)?{...e}:Array.isArray(e)?[...e]:e}const vi=new Set(["string","number","symbol"]);function Ne(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ge(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 bi(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const _i={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=Ae(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 Re(this,"shape",o),o},checks:[]});return ge(e,n)}function Ei(e,t){const r=e._zod.def,n=Ae(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 Re(this,"shape",o),o},checks:[]});return ge(e,n)}function yi(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=Ae(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return Re(this,"shape",s),s},checks:[]});return ge(e,o)}function $i(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 Re(this,"shape",n),n},checks:e._zod.def.checks};return ge(e,r)}function Ri(e,t){const r=Ae(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return Re(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return ge(e,r)}function Ai(e,t,r){const n=Ae(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 Re(this,"shape",s),s},checks:[]});return ge(t,n)}function wi(e,t,r){const n=Ae(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 Re(this,"shape",s),s},checks:[]});return ge(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 He(e){return typeof e=="string"?e:e?.message}function ve(e,t,r){const n={...e,path:e.path??[]};if(!e.message){const o=He(e.inst?._zod.def?.error?.(e))??He(t?.error?.(e))??He(r.customError?.(e))??He(r.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function wt(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 _n=(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,yt,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Sn=d("$ZodError",_n),En=d("$ZodError",_n,{Parent:Error});function Ii(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 ki(e,t){const r=t||function(s){return s.message},n={_errors:[]},o=s=>{for(const i of s.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(a=>o({issues:a}));else if(i.code==="invalid_key")o({issues:i.issues});else if(i.code==="invalid_element")o({issues:i.issues});else if(i.path.length===0)n._errors.push(r(i));else{let a=n,u=0;for(;u<i.path.length;){const c=i.path[u];u===i.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(r(i))):a[c]=a[c]||{_errors:[]},a=a[c],u++}}};return o(e),n}const It=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(u=>ve(u,s,de())));throw vn(a,o?.callee),a}return i.value},kt=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(u=>ve(u,s,de())));throw vn(a,o?.callee),a}return i.value},Ye=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??Sn)(s.issues.map(i=>ve(i,o,de())))}:{success:!0,data:s.value}},Ci=Ye(En),Ke=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=>ve(i,o,de())))}:{success:!0,data:s.value}},Pi=Ke(En),Oi=e=>(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return It(e)(t,r,o)},Ni=e=>(t,r,n)=>It(e)(t,r,n),zi=e=>async(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return kt(e)(t,r,o)},Li=e=>async(t,r,n)=>kt(e)(t,r,n),Ti=e=>(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Ye(e)(t,r,o)},xi=e=>(t,r,n)=>Ye(e)(t,r,n),Zi=e=>async(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Ke(e)(t,r,o)},qi=e=>async(t,r,n)=>Ke(e)(t,r,n),ji=/^[cC][^\s-]{8,}$/,Di=/^[0-9a-z]+$/,Ui=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Bi=/^[0-9a-vA-V]{20}$/,Vi=/^[A-Za-z0-9]{27}$/,Fi=/^[a-zA-Z0-9_-]{21}$/,Ji=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Mi=/^([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})$/,yn=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)$/,Wi=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Gi="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Xi(){return new RegExp(Gi,"u")}const Hi=/^(?:(?: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])$/,Yi=/^(([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}|:))$/,Ki=/^((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])$/,Qi=/^(([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])$/,ea=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,$n=/^[A-Za-z0-9_-]*$/,ta=/^(?=.{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])?)*\.?$/,ra=/^\+(?:[0-9]){6,14}[0-9]$/,Rn="(?:(?:\\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])))",na=new RegExp(`^${Rn}$`);function An(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 oa(e){return new RegExp(`^${An(e)}$`)}function sa(e){const t=An({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(`^${Rn}T(?:${n})$`)}const ia=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},aa=/^-?\d+$/,ca=/^-?\d+(?:\.\d+)?/,ua=/^null$/i,la=/^[^A-Z]*$/,pa=/^[^a-z]*$/,se=d("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),wn={number:"number",bigint:"bigint",object:"date"},In=d("$ZodCheckLessThan",(e,t)=>{se.init(e,t);const r=wn[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})}}),kn=d("$ZodCheckGreaterThan",(e,t)=>{se.init(e,t);const r=wn[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})}}),ha=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):di(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})}}),fa=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]=_i[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=aa)}),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})}}),ma=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=wt(o);n.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),da=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=wt(o);n.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),ga=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=wt(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})}}),Qe=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=()=>{})}),va=d("$ZodCheckRegex",(e,t)=>{Qe.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})}}),ba=d("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=la),Qe.init(e,t)}),_a=d("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=pa),Qe.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})}}),ya=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})}}),$a=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(`
|
|
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 Aa={major:4,minor:1,patch:11},G=d("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Aa;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,u)=>{let c=ze(i),l;for(const f of a){if(f._zod.def.when){if(!f._zod.def.when(i))continue}else if(c)continue;const m=i.issues.length,g=f._zod.check(i);if(g instanceof Promise&&u?.async===!1)throw new Pe;if(l||g instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await g,i.issues.length!==m&&(c||(c=ze(i,m)))});else{if(i.issues.length===m)continue;c||(c=ze(i,m))}}return l?l.then(()=>i):i},s=(i,a,u)=>{if(ze(i))return i.aborted=!0,i;const c=o(a,n,u);if(c instanceof Promise){if(u.async===!1)throw new Pe;return c.then(l=>e._zod.parse(l,u))}return e._zod.parse(c,u)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction==="backward"){const c=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return c instanceof Promise?c.then(l=>s(l,i,a)):s(c,i,a)}const u=e._zod.parse(i,a);if(u instanceof Promise){if(a.async===!1)throw new Pe;return u.then(c=>o(c,n,a))}return o(u,n,a)}}e["~standard"]={validate:o=>{try{const s=Ci(e,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return Pi(e,o).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}}),Ct=d("$ZodString",(e,t)=>{G.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??ia(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)=>{Qe.init(e,t),Ct.init(e,t)}),wa=d("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Mi),J.init(e,t)}),Ia=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=yn(n))}else t.pattern??(t.pattern=yn());J.init(e,t)}),ka=d("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Wi),J.init(e,t)}),Ca=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:ta.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})}}}),Pa=d("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Xi()),J.init(e,t)}),Oa=d("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Fi),J.init(e,t)}),Na=d("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=ji),J.init(e,t)}),za=d("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Di),J.init(e,t)}),La=d("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Ui),J.init(e,t)}),Ta=d("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Bi),J.init(e,t)}),
|
|
3
|
+
`))}}const Aa={major:4,minor:1,patch:11},G=d("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Aa;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,u)=>{let c=ze(i),l;for(const f of a){if(f._zod.def.when){if(!f._zod.def.when(i))continue}else if(c)continue;const m=i.issues.length,g=f._zod.check(i);if(g instanceof Promise&&u?.async===!1)throw new Pe;if(l||g instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await g,i.issues.length!==m&&(c||(c=ze(i,m)))});else{if(i.issues.length===m)continue;c||(c=ze(i,m))}}return l?l.then(()=>i):i},s=(i,a,u)=>{if(ze(i))return i.aborted=!0,i;const c=o(a,n,u);if(c instanceof Promise){if(u.async===!1)throw new Pe;return c.then(l=>e._zod.parse(l,u))}return e._zod.parse(c,u)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction==="backward"){const c=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return c instanceof Promise?c.then(l=>s(l,i,a)):s(c,i,a)}const u=e._zod.parse(i,a);if(u instanceof Promise){if(a.async===!1)throw new Pe;return u.then(c=>o(c,n,a))}return o(u,n,a)}}e["~standard"]={validate:o=>{try{const s=Ci(e,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return Pi(e,o).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}}),Ct=d("$ZodString",(e,t)=>{G.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??ia(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)=>{Qe.init(e,t),Ct.init(e,t)}),wa=d("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Mi),J.init(e,t)}),Ia=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=yn(n))}else t.pattern??(t.pattern=yn());J.init(e,t)}),ka=d("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Wi),J.init(e,t)}),Ca=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:ta.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})}}}),Pa=d("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Xi()),J.init(e,t)}),Oa=d("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Fi),J.init(e,t)}),Na=d("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=ji),J.init(e,t)}),za=d("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Di),J.init(e,t)}),La=d("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Ui),J.init(e,t)}),Ta=d("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Bi),J.init(e,t)}),xa=d("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Vi),J.init(e,t)}),Za=d("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=sa(t)),J.init(e,t)}),qa=d("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=na),J.init(e,t)}),ja=d("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=oa(t)),J.init(e,t)}),Da=d("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Ji),J.init(e,t)}),Ua=d("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Hi),J.init(e,t),e._zod.onattach.push(r=>{const n=r._zod.bag;n.format="ipv4"})}),Ba=d("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Yi),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})}}}),Va=d("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Ki),J.init(e,t)}),Fa=d("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Qi),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 Cn(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Ja=d("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=ea),J.init(e,t),e._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),e._zod.check=r=>{Cn(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function Ma(e){if(!$n.test(e))return!1;const t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Cn(r)}const Wa=d("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=$n),J.init(e,t),e._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),e._zod.check=r=>{Ma(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Ga=d("$ZodE164",(e,t)=>{t.pattern??(t.pattern=ra),J.init(e,t)});function Xa(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 Ha=d("$ZodJWT",(e,t)=>{J.init(e,t),e._zod.check=r=>{Xa(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),Pn=d("$ZodNumber",(e,t)=>{G.init(e,t),e._zod.pattern=e._zod.bag.pattern??ca,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}}),Ya=d("$ZodNumber",(e,t)=>{fa.init(e,t),Pn.init(e,t)}),Ka=d("$ZodNull",(e,t)=>{G.init(e,t),e._zod.pattern=ua,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}}),Qa=d("$ZodUnknown",(e,t)=>{G.init(e,t),e._zod.parse=r=>r}),ec=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 On(e,t,r){e.issues.length&&t.issues.push(...Le(r,e.issues)),t.value[r]=e.value}const tc=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],u=t.element._zod.run({value:a,issues:[]},n);u instanceof Promise?s.push(u.then(c=>On(c,r,i))):On(u,r,i)}return s.length?Promise.all(s).then(()=>r):r}});function et(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 Nn(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=bi(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function zn(e,t,r,n,o,s){const i=[],a=o.keySet,u=o.catchall._zod,c=u.def.type;for(const l of Object.keys(t)){if(a.has(l))continue;if(c==="never"){i.push(l);continue}const f=u.run({value:t[l],issues:[]},n);f instanceof Promise?e.push(f.then(m=>et(m,r,l,t))):et(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 rc=d("$ZodObject",(e,t)=>{if(G.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const a=t.shape;Object.defineProperty(t,"shape",{get:()=>{const u={...a};return Object.defineProperty(t,"shape",{value:u}),u}})}const n=$t(()=>Nn(t));V(e._zod,"propValues",()=>{const a=t.shape,u={};for(const c in a){const l=a[c]._zod;if(l.values){u[c]??(u[c]=new Set);for(const f of l.values)u[c].add(f)}}return u});const o=Xe,s=t.catchall;let i;e._zod.parse=(a,u)=>{i??(i=n.value);const c=a.value;if(!o(c))return a.issues.push({expected:"object",code:"invalid_type",input:c,inst:e}),a;a.value={};const l=[],f=i.shape;for(const m of i.keys){const P=f[m]._zod.run({value:c[m],issues:[]},u);P instanceof Promise?l.push(P.then(b=>et(b,a,m,c))):et(P,a,m,c)}return s?zn(l,c,a,u,n.value,e):l.length?Promise.all(l).then(()=>a):a}}),nc=d("$ZodObjectJIT",(e,t)=>{rc.init(e,t);const r=e._zod.parse,n=$t(()=>Nn(t)),o=m=>{const g=new Ra(["shape","payload","ctx"]),P=n.value,b=L=>{const B=gn(L);return`shape[${B}]._zod.run({ value: input[${B}], issues: [] }, ctx)`};g.write("const input = payload.value;");const O=Object.create(null);let q=0;for(const L of P.keys)O[L]=`key_${q++}`;g.write("const newResult = {};");for(const L of P.keys){const B=O[L],Q=gn(L);g.write(`const ${B} = ${b(L)};`),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=Xe,a=!mn.jitless,c=a&&gi.value,l=t.catchall;let f;e._zod.parse=(m,g)=>{f??(f=n.value);const P=m.value;return i(P)?a&&c&&g?.async===!1&&g.jitless!==!0?(s||(s=o(t.shape)),m=s(m,g),l?zn([],P,m,g,f,e):m):r(m,g):(m.issues.push({expected:"object",code:"invalid_type",input:P,inst:e}),m)}});function Ln(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=>ve(i,n,de())))}),t)}const oc=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=>At(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 u of t.options){const c=u._zod.run({value:o.value,issues:[]},s);if(c instanceof Promise)a.push(c),i=!0;else{if(c.issues.length===0)return c;a.push(c)}}return i?Promise.all(a).then(u=>Ln(u,o,e,s)):Ln(a,o,e,s)}}),sc=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(([u,c])=>Tn(r,u,c)):Tn(r,s,i)}});function Pt(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=Pt(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=Pt(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 Tn(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=Pt(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 ic=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 u of i)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){const c=t.valueType._zod.run({value:o[u],issues:[]},n);c instanceof Promise?s.push(c.then(l=>{l.issues.length&&r.issues.push(...Le(u,l.issues)),r.value[u]=l.value})):(c.issues.length&&r.issues.push(...Le(u,c.issues)),r.value[u]=c.value)}let a;for(const u in o)i.has(u)||(a=a??[],a.push(u));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(c=>ve(c,n,de())),input:i,path:[i],inst:e}),r.value[a.value]=a.value;continue}const u=t.valueType._zod.run({value:o[i],issues:[]},n);u instanceof Promise?s.push(u.then(c=>{c.issues.length&&r.issues.push(...Le(i,c.issues)),r.value[a.value]=c.value})):(u.issues.length&&r.issues.push(...Le(i,u.issues)),r.value[a.value]=u.value)}}return s.length?Promise.all(s).then(()=>r):r}}),ac=d("$ZodEnum",(e,t)=>{G.init(e,t);const r=mi(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(o=>vi.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}}),cc=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}}),uc=d("$ZodTransform",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new fn(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 lc=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(`^(${At(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)}}),pc=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(`^(${At(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)}),hc=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=>xn(s,t)):xn(o,t)}});function xn(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const fc=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))}),mc=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=>qn(s,e)):qn(o,e)}});function qn(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 dc=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=>ve(i,n,de()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(s=>ve(s,n,de()))},input:r.value}),r.issues=[]),r)}}),gc=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=>tt(i,t.in,n)):tt(s,t.in,n)}const o=t.in._zod.run(r,n);return o instanceof Promise?o.then(s=>tt(s,t.out,n)):tt(o,t.out,n)}});function tt(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const vc=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(jn):jn(o)}});function jn(e){return e.value=Object.freeze(e.value),e}const bc=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=>Dn(s,r,n,e));Dn(o,r,n,e)}});function Dn(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(xe(o))}}class _c{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 _c}const rt=Sc();function Ec(e,t){return new e({type:"string",...$(t)})}function yc(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...$(t)})}function Un(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...$(t)})}function $c(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 Ac(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...$(t)})}function wc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...$(t)})}function Bn(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...$(t)})}function Ic(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...$(t)})}function kc(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...$(t)})}function Cc(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...$(t)})}function Pc(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...$(t)})}function Oc(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...$(t)})}function Nc(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...$(t)})}function zc(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...$(t)})}function Lc(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...$(t)})}function Tc(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...$(t)})}function Zc(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...$(t)})}function xc(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...$(t)})}function qc(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...$(t)})}function jc(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...$(t)})}function Dc(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...$(t)})}function Uc(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...$(t)})}function Bc(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...$(t)})}function Vc(e,t){return new e({type:"string",format:"date",check:"string_format",...$(t)})}function Fc(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...$(t)})}function Jc(e,t){return new e({type:"string",format:"duration",check:"string_format",...$(t)})}function Mc(e,t){return new e({type:"number",checks:[],...$(t)})}function Wc(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...$(t)})}function Gc(e,t){return new e({type:"null",...$(t)})}function Xc(e){return new e({type:"unknown"})}function Hc(e,t){return new e({type:"never",...$(t)})}function Vn(e,t){return new In({check:"less_than",...$(t),value:e,inclusive:!1})}function Ot(e,t){return new In({check:"less_than",...$(t),value:e,inclusive:!0})}function Fn(e,t){return new kn({check:"greater_than",...$(t),value:e,inclusive:!1})}function Nt(e,t){return new kn({check:"greater_than",...$(t),value:e,inclusive:!0})}function Jn(e,t){return new ha({check:"multiple_of",...$(t),value:e})}function Mn(e,t){return new ma({check:"max_length",...$(t),maximum:e})}function nt(e,t){return new da({check:"min_length",...$(t),minimum:e})}function Wn(e,t){return new ga({check:"length_equals",...$(t),length:e})}function Yc(e,t){return new va({check:"string_format",format:"regex",...$(t),pattern:e})}function Kc(e){return new ba({check:"string_format",format:"lowercase",...$(e)})}function Qc(e){return new _a({check:"string_format",format:"uppercase",...$(e)})}function eu(e,t){return new Sa({check:"string_format",format:"includes",...$(t),includes:e})}function tu(e,t){return new Ea({check:"string_format",format:"starts_with",...$(t),prefix:e})}function ru(e,t){return new ya({check:"string_format",format:"ends_with",...$(t),suffix:e})}function qe(e){return new $a({check:"overwrite",tx:e})}function nu(e){return qe(t=>t.normalize(e))}function ou(){return qe(e=>e.trim())}function su(){return qe(e=>e.toLowerCase())}function iu(){return qe(e=>e.toUpperCase())}function au(e,t,r){return new e({type:"array",element:t,...$(r)})}function cu(e,t,r){const n=$(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}function uu(e,t,r){return new e({type:"custom",check:"custom",fn:t,...$(r)})}function lu(e){const t=pu(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(xe(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(xe(o))}},e(r.value,r)));return t}function pu(e,t){const r=new se({check:"custom",...$(t)});return r._zod.check=e,r}const hu=d("ZodISODateTime",(e,t)=>{xa.init(e,t),X.init(e,t)});function fu(e){return Bc(hu,e)}const mu=d("ZodISODate",(e,t)=>{qa.init(e,t),X.init(e,t)});function du(e){return Vc(mu,e)}const gu=d("ZodISOTime",(e,t)=>{ja.init(e,t),X.init(e,t)});function vu(e){return Fc(gu,e)}const bu=d("ZodISODuration",(e,t)=>{Da.init(e,t),X.init(e,t)});function _u(e){return Jc(bu,e)}const ae=d("ZodError",(e,t)=>{Sn.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>ki(e,r)},flatten:{value:r=>Ii(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,yt,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,yt,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Su=It(ae),Eu=kt(ae),yu=Ye(ae),$u=Ke(ae),Ru=Oi(ae),Au=Ni(ae),wu=zi(ae),Iu=Li(ae),ku=Ti(ae),Cu=Zi(ae),Pu=xi(ae),Ou=qi(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(Ae(t,{checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]})),e.clone=(r,n)=>ge(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)=>yu(e,r,n),e.parseAsync=async(r,n)=>Eu(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>$u(e,r,n),e.spa=e.safeParseAsync,e.encode=(r,n)=>Ru(e,r,n),e.decode=(r,n)=>Au(e,r,n),e.encodeAsync=async(r,n)=>wu(e,r,n),e.decodeAsync=async(r,n)=>Iu(e,r,n),e.safeEncode=(r,n)=>ku(e,r,n),e.safeDecode=(r,n)=>Cu(e,r,n),e.safeEncodeAsync=async(r,n)=>Pu(e,r,n),e.safeDecodeAsync=async(r,n)=>Ou(e,r,n),e.refine=(r,n)=>e.check(yl(r,n)),e.superRefine=r=>e.check($l(r)),e.overwrite=r=>e.check(qe(r)),e.optional=()=>he(e),e.nullable=()=>no(e),e.nullish=()=>he(no(e)),e.nonoptional=r=>dl(e,r),e.array=()=>D(e),e.or=r=>pe([e,r]),e.and=r=>sl(e,r),e.transform=r=>so(e,ul(r)),e.default=r=>hl(e,r),e.prefault=r=>ml(e,r),e.catch=r=>vl(e,r),e.pipe=r=>so(e,r),e.readonly=()=>Sl(e),e.describe=r=>{const n=e.clone();return rt.add(n,{description:r}),n},Object.defineProperty(e,"description",{get(){return rt.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return rt.get(e);const n=e.clone();return rt.add(n,r[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Gn=d("_ZodString",(e,t)=>{Ct.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(Yc(...n)),e.includes=(...n)=>e.check(eu(...n)),e.startsWith=(...n)=>e.check(tu(...n)),e.endsWith=(...n)=>e.check(ru(...n)),e.min=(...n)=>e.check(nt(...n)),e.max=(...n)=>e.check(Mn(...n)),e.length=(...n)=>e.check(Wn(...n)),e.nonempty=(...n)=>e.check(nt(1,...n)),e.lowercase=n=>e.check(Kc(n)),e.uppercase=n=>e.check(Qc(n)),e.trim=()=>e.check(ou()),e.normalize=(...n)=>e.check(nu(...n)),e.toLowerCase=()=>e.check(su()),e.toUpperCase=()=>e.check(iu())}),Nu=d("ZodString",(e,t)=>{Ct.init(e,t),Gn.init(e,t),e.email=r=>e.check(yc(zu,r)),e.url=r=>e.check(Bn(Hn,r)),e.jwt=r=>e.check(Uc(Xu,r)),e.emoji=r=>e.check(Ic(Tu,r)),e.guid=r=>e.check(Un(Xn,r)),e.uuid=r=>e.check($c(ot,r)),e.uuidv4=r=>e.check(Rc(ot,r)),e.uuidv6=r=>e.check(Ac(ot,r)),e.uuidv7=r=>e.check(wc(ot,r)),e.nanoid=r=>e.check(kc(Zu,r)),e.guid=r=>e.check(Un(Xn,r)),e.cuid=r=>e.check(Cc(xu,r)),e.cuid2=r=>e.check(Pc(qu,r)),e.ulid=r=>e.check(Oc(ju,r)),e.base64=r=>e.check(qc(Mu,r)),e.base64url=r=>e.check(jc(Wu,r)),e.xid=r=>e.check(Nc(Du,r)),e.ksuid=r=>e.check(zc(Uu,r)),e.ipv4=r=>e.check(Lc(Bu,r)),e.ipv6=r=>e.check(Tc(Vu,r)),e.cidrv4=r=>e.check(Zc(Fu,r)),e.cidrv6=r=>e.check(xc(Ju,r)),e.e164=r=>e.check(Dc(Gu,r)),e.datetime=r=>e.check(fu(r)),e.date=r=>e.check(du(r)),e.time=r=>e.check(vu(r)),e.duration=r=>e.check(_u(r))});function p(e){return Ec(Nu,e)}const X=d("ZodStringFormat",(e,t)=>{J.init(e,t),Gn.init(e,t)}),zu=d("ZodEmail",(e,t)=>{ka.init(e,t),X.init(e,t)}),Xn=d("ZodGUID",(e,t)=>{wa.init(e,t),X.init(e,t)}),ot=d("ZodUUID",(e,t)=>{Ia.init(e,t),X.init(e,t)}),Hn=d("ZodURL",(e,t)=>{Ca.init(e,t),X.init(e,t)});function Lu(e){return Bn(Hn,e)}const Tu=d("ZodEmoji",(e,t)=>{Pa.init(e,t),X.init(e,t)}),Zu=d("ZodNanoID",(e,t)=>{Oa.init(e,t),X.init(e,t)}),xu=d("ZodCUID",(e,t)=>{Na.init(e,t),X.init(e,t)}),qu=d("ZodCUID2",(e,t)=>{za.init(e,t),X.init(e,t)}),ju=d("ZodULID",(e,t)=>{La.init(e,t),X.init(e,t)}),Du=d("ZodXID",(e,t)=>{Ta.init(e,t),X.init(e,t)}),Uu=d("ZodKSUID",(e,t)=>{Za.init(e,t),X.init(e,t)}),Bu=d("ZodIPv4",(e,t)=>{Ua.init(e,t),X.init(e,t)}),Vu=d("ZodIPv6",(e,t)=>{Ba.init(e,t),X.init(e,t)}),Fu=d("ZodCIDRv4",(e,t)=>{Va.init(e,t),X.init(e,t)}),Ju=d("ZodCIDRv6",(e,t)=>{Fa.init(e,t),X.init(e,t)}),Mu=d("ZodBase64",(e,t)=>{Ja.init(e,t),X.init(e,t)}),Wu=d("ZodBase64URL",(e,t)=>{Wa.init(e,t),X.init(e,t)}),Gu=d("ZodE164",(e,t)=>{Ga.init(e,t),X.init(e,t)}),Xu=d("ZodJWT",(e,t)=>{Ha.init(e,t),X.init(e,t)}),Yn=d("ZodNumber",(e,t)=>{Pn.init(e,t),H.init(e,t),e.gt=(n,o)=>e.check(Fn(n,o)),e.gte=(n,o)=>e.check(Nt(n,o)),e.min=(n,o)=>e.check(Nt(n,o)),e.lt=(n,o)=>e.check(Vn(n,o)),e.lte=(n,o)=>e.check(Ot(n,o)),e.max=(n,o)=>e.check(Ot(n,o)),e.int=n=>e.check(Qn(n)),e.safe=n=>e.check(Qn(n)),e.positive=n=>e.check(Fn(0,n)),e.nonnegative=n=>e.check(Nt(0,n)),e.negative=n=>e.check(Vn(0,n)),e.nonpositive=n=>e.check(Ot(0,n)),e.multipleOf=(n,o)=>e.check(Jn(n,o)),e.step=(n,o)=>e.check(Jn(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 Kn(e){return Mc(Yn,e)}const Hu=d("ZodNumberFormat",(e,t)=>{Ya.init(e,t),Yn.init(e,t)});function Qn(e){return Wc(Hu,e)}const Yu=d("ZodNull",(e,t)=>{Ka.init(e,t),H.init(e,t)});function st(e){return Gc(Yu,e)}const Ku=d("ZodUnknown",(e,t)=>{Qa.init(e,t),H.init(e,t)});function eo(){return Xc(Ku)}const Qu=d("ZodNever",(e,t)=>{ec.init(e,t),H.init(e,t)});function el(e){return Hc(Qu,e)}const tl=d("ZodArray",(e,t)=>{tc.init(e,t),H.init(e,t),e.element=t.element,e.min=(r,n)=>e.check(nt(r,n)),e.nonempty=r=>e.check(nt(1,r)),e.max=(r,n)=>e.check(Mn(r,n)),e.length=(r,n)=>e.check(Wn(r,n)),e.unwrap=()=>e.element});function D(e,t){return au(tl,e,t)}const rl=d("ZodObject",(e,t)=>{nc.init(e,t),H.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:eo()}),e.loose=()=>e.clone({...e._zod.def,catchall:eo()}),e.strict=()=>e.clone({...e._zod.def,catchall:el()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>yi(e,r),e.safeExtend=r=>$i(e,r),e.merge=r=>Ri(e,r),e.pick=r=>Si(e,r),e.omit=r=>Ei(e,r),e.partial=(...r)=>Ai(ro,e,r[0]),e.required=(...r)=>wi(oo,e,r[0])});function C(e,t){const r={type:"object",shape:e??{},...$(t)};return new rl(r)}const nl=d("ZodUnion",(e,t)=>{oc.init(e,t),H.init(e,t),e.options=t.options});function pe(e,t){return new nl({type:"union",options:e,...$(t)})}const ol=d("ZodIntersection",(e,t)=>{sc.init(e,t),H.init(e,t)});function sl(e,t){return new ol({type:"intersection",left:e,right:t})}const il=d("ZodRecord",(e,t)=>{ic.init(e,t),H.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function to(e,t,r){return new il({type:"record",keyType:e,valueType:t,...$(r)})}const zt=d("ZodEnum",(e,t)=>{ac.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 zt({...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 zt({...t,checks:[],...$(o),entries:s})}});function je(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new zt({type:"enum",entries:r,...$(t)})}const al=d("ZodLiteral",(e,t)=>{cc.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 al({type:"literal",values:Array.isArray(e)?e:[e],...$(t)})}const cl=d("ZodTransform",(e,t)=>{uc.init(e,t),H.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new fn(e.constructor.name);r.addIssue=s=>{if(typeof s=="string")r.issues.push(xe(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(xe(i))}};const o=t.transform(r.value,r);return o instanceof Promise?o.then(s=>(r.value=s,r)):(r.value=o,r)}});function ul(e){return new cl({type:"transform",transform:e})}const ro=d("ZodOptional",(e,t)=>{lc.init(e,t),H.init(e,t),e.unwrap=()=>e._zod.def.innerType});function he(e){return new ro({type:"optional",innerType:e})}const ll=d("ZodNullable",(e,t)=>{pc.init(e,t),H.init(e,t),e.unwrap=()=>e._zod.def.innerType});function no(e){return new ll({type:"nullable",innerType:e})}const pl=d("ZodDefault",(e,t)=>{hc.init(e,t),H.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function hl(e,t){return new pl({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():bn(t)}})}const fl=d("ZodPrefault",(e,t)=>{fc.init(e,t),H.init(e,t),e.unwrap=()=>e._zod.def.innerType});function ml(e,t){return new fl({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():bn(t)}})}const oo=d("ZodNonOptional",(e,t)=>{mc.init(e,t),H.init(e,t),e.unwrap=()=>e._zod.def.innerType});function dl(e,t){return new oo({type:"nonoptional",innerType:e,...$(t)})}const gl=d("ZodCatch",(e,t)=>{dc.init(e,t),H.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function vl(e,t){return new gl({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const bl=d("ZodPipe",(e,t)=>{gc.init(e,t),H.init(e,t),e.in=t.in,e.out=t.out});function so(e,t){return new bl({type:"pipe",in:e,out:t})}const _l=d("ZodReadonly",(e,t)=>{vc.init(e,t),H.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Sl(e){return new _l({type:"readonly",innerType:e})}const io=d("ZodCustom",(e,t)=>{bc.init(e,t),H.init(e,t)});function El(e,t){return cu(io,e??(()=>!0),t)}function yl(e,t={}){return uu(io,e,t)}function $l(e){return lu(e)}var y=(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))(y||{});const Rl=pe([M("book"),M("bookitem"),M("conference"),M("document"),M("report"),M("proceeding"),M("unknown")]),Al=pe([M("article"),M("conference"),M("issue"),M("journal"),M("preprint"),M("proceeding"),M("unknown")]),fe=C({artnum:p(),atitle:p(),aufirst:p(),aulast:p(),auinit:p(),auinit1:p(),auinitm:p(),ausuffix:p(),au:D(p()),aucorp:p(),bici:p(),btitle:p(),chron:p(),coden:p(),date:p(),edition:p(),eissn:p(),epage:p(),externalDBID:p(),externalDocID:p(),genre:je(y),id:p(),isbn:p(),issn:p(),issue:p(),jtitle:p(),pages:p(),part:p(),place:p(),pub:p(),quarter:p(),rft_id:D(p()),series:p(),sici:p(),spage:p(),ssn:p(),stitle:p(),title:p(),tpages:p(),volume:p()}).partial(),Lt=C({bibid:p(),doi:p(),uri:p()}).partial(),wl=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(),Il=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(),kl=fe.pick({au:!0,date:!0,isbn:!0,pub:!0,title:!0}).partial(),Cl=fe.pick({au:!0,date:!0,pub:!0,title:!0}).partial(),Pl=fe.pick({au:!0,date:!0,pub:!0,title:!0,spage:!0,epage:!0}).partial(),Ol=fe.pick({au:!0,date:!0,title:!0}).partial(),ao=C({...fe.shape,...Lt.shape}),Y=(e,t)=>({...t,genre:e}),U=(e,t)=>({...t,genre:e}),be=e=>({...e,genre:y.AudioVisualDocument}),co=e=>({...e,genre:y.Image}),uo=e=>({...e,genre:y.Document}),it=e=>({...e,genre:y.Webpage}),lo=e=>Object.keys(e.shape),po=lo(fe),Tt=lo(Lt),Nl=(e,t,r)=>{if(r.length>0&&typeof r[0]=="string"){const n=t.startsWith("rft_")?t:`rft.${t}`;e.append(n,r[0])}},zl=(e,t,r)=>{e.append(t,r)},Ll=(e,t,r)=>{e.append(`rft.${t}`,r)},ho=e=>Tt.includes(e),fo=e=>{const t=new URLSearchParams;return Object.entries(e).forEach(([r,n])=>{Array.isArray(n)?Nl(t,r,n):typeof n=="string"&&n&&(ho(r)?zl(t,r,n):Ll(t,r,n))}),t},mo=(e,t,r,n)=>{const o=t.getAll(r).filter(s=>!!s).map(s=>s.trim());return o.length===0?e:{...e,[n]:o}},go=e=>{const t=Tl(e),r=(o,s)=>{if(s==="au")return mo(o,t,"rft.au","au");if(s==="rft_id")return mo(o,t,"rft_id","rft_id");const i=ho(s)?s:`rft.${s}`,a=t.get(i);return a?{...o,[s]:a.trim()}:o},n=[...po,...Tt].reduce(r,{});return Object.keys(n).length===0?null:n},Tl=e=>URL.canParse(e)?new URL(e).searchParams:new URLSearchParams(e);function Zl(e){return typeof e!="string"?!1:Object.values(y).includes(e)}var _e=(e=>(e.CA="CA",e.EUAPAC="EUAPAC",e))(_e||{});const Zt=C({id:p(),name:p(),region:je(_e)}),xl=C({tenants:D(Zt)}),vo=9*1024*1024,bo=C({url:Lu({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(vo,{error:`"html" should be a string with a MAX Length of ${vo}`}),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: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 ql(e){return bo.safeParse(e).success}const xt=C({name:p(),region:je(_e),apps:to(p(),p())}),_o=to(p(),xt),So=e=>xt.safeParse(e).success,Eo=e=>_o.safeParse(e).success;function yo(e){return Zt.safeParse(e).success}function jl(e){return typeof e=="string"&&Object.keys(_e).includes(e)}const Dl=e=>{if(!Eo(e))throw new Error("Error: the customer list data is invalid.");return{tenants:Object.entries(e).map(([r,n])=>Ul(r,n))}},Ul=(e,t)=>{if(!So(t))throw new Error(`Invalid customer: ${t}`);const{name:r,region:n}=t,o={id:e,name:r,region:n};if(!yo(o))throw new Error(`Invalid tenant: ${JSON.stringify(o)}`);return o},qt=C({parserType:p(),parserName:p().nullable(),uri:p(),referrer:p()}),jt=C({parserType:p(),parserName:p().nullable(),referrer:p()}),Dt=C({bookmarkingWorkflowUrl:st(),resource:st()}),Ut=C({bookmarkingWorkflowUrl:p(),resource:st()}),Bt=C({bookmarkingWorkflowUrl:st(),resource:ao}),Vt=C({z3988SearchResult:M(!0)}),Ft=C({summonSearchResult:M(!0)}),at=pe([Ut,Dt,Bt,Vt,Ft]),$o=C({meta:qt}).and(at),Ro=C({meta:jt}).and(at);function Bl(e){return{bookmarkingWorkflowUrl:e,resource:null}}function Z(){return{bookmarkingWorkflowUrl:null,resource:null}}function w(e){return{bookmarkingWorkflowUrl:null,resource:e}}function Ao(){return{z3988SearchResult:!0}}function wo(){return{summonSearchResult:!0}}const Vl=e=>{const t=e.getAttribute("title");return t?go(t):null},Jt=({document:e})=>{const t=Array.from(e.querySelectorAll(".Z3988"));if(t.length===0)return Z();const r=t.map(Vl).find(n=>n!==null);return r?w(r):Z()},Fl=e=>{const t=Array.from(e.querySelectorAll(".author > a")).map(r=>r.textContent.trim()).filter(Boolean);return t.length?t:void 0},Jl=e=>e.querySelector("#rpi-attribute-book_details-edition > .rpi-attribute-value > span")?.textContent??void 0,Ml=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},Wl=e=>e.querySelector("#rpi-attribute-book_details-publication_date > .rpi-attribute-value > span")?.textContent??void 0,Gl=e=>e.querySelector("#rpi-attribute-book_details-publisher > .rpi-attribute-value > span")?.textContent??void 0,Xl=e=>e.querySelector("#rpi-attribute-book_details-series > .rpi-attribute-value > a")?.textContent??void 0,Hl=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},Yl=({url:e,document:t})=>{const r=Fl(t),n=Jl(t),o=Ml(t),s=Wl(t),i=Gl(t),a=Xl(t),u=t.getElementById("productTitle")?.textContent.trim()??void 0,c=Hl(t);return{bookmarkingWorkflowUrl:null,resource:Y(y.Book,{au:r,date:s,edition:n,isbn:o,pub:i,series:a,title:u,tpages:c,uri:e})}},me=e=>{if(e)return e.replace(/[^0-9]/g,"")},Io=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),ko=e=>e.querySelector(".article-header")?.querySelector("h1 span")?.textContent.trim(),Co=e=>({date:e?.textContent.match(/\d{4}/)?.[0],pub:"Elsevier Inc."}),Kl=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}},Ql=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(c=>c.trim()),{jtitle:i,volume:a,issue:u}=Kl(e);return w(U(y.Article,{au:Io(e),atitle:ko(e),spage:o,epage:s,date:r,jtitle:i,volume:a,issue:u}))},ep=e=>{const[t,r]=e.querySelectorAll(".source"),{date:n,pub:o}=Co(r),s=e.querySelector(".browse__book-toc"),[i,a]=(s?.querySelector("h1")?.textContent.split(",")??[]).map(u=>u.trim());return w(Y(y.Book,{btitle:i,edition:a,pub:o,au:t.textContent?[t.textContent]:void 0,date:n}))},tp=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}=Co(o);return{edition:r,btitle:n,date:s,pub:i}},rp=e=>{const{edition:t,btitle:r,date:n,pub:o}=tp(e),s=e.querySelector(".article-header .source")?.textContent,i=/(\d+-\d+|[IVXLCDM]+-[IVXLCDM]+)/i,a=s?.match(i),[u,c]=(a?.[1].split("-")??[]).map(l=>l.trim());return w(Y(y.Bookitem,{au:Io(e),atitle:ko(e),btitle:r,edition:t,pub:o,date:n,spage:u,epage:c}))},np=/^[0-9X]$/,Mt=e=>{if(!e)return;let t="";for(const r of e)np.test(r)&&(t+=r);if(t)return t},op=(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=Mt(s.iterateNext()?.textContent);return w({genre:y.Document,title:r,pub:n,date:o,uri:t,isbn:i})},Po=e=>e.querySelector(".browse-toc")??e.querySelector(".browse__journal"),sp=e=>Po(e)?.querySelector("h1")?.firstElementChild?.textContent.trim(),ip=e=>{const t=Po(e),r=t?.querySelector("figure figcaption.source");if(r){const[a,u,c]=r.textContent.split(",").map(l=>l.trim());return{date:a,volume:me(u),issue:me(c)}}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}=ip(e);return w(U(y.Journal,{jtitle:sp(e),date:t,volume:r,issue:n}))};var Oo=(e=>(e.Book="Book",e.Chapter="Book Chapter",e.Article="Full Text Article",e.Journal="Journal",e.Guideline="Guideline",e))(Oo||{});const cp=e=>Object.values(Oo).includes(e),up=(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&&cp(n))return n},lp=({url:e,document:t})=>{switch(up(t,e)){case"Book":return ep(t);case"Book Chapter":return rp(t);case"Full Text Article":return Ql(t);case"Journal":return ap(t);case"Guideline":return op(t,e);case void 0:return Z()}},we=C({"@context":p()}),pp=e=>we.safeParse(e).success,No='script[type="application/ld+json"]',zo=e=>Array.from(e.querySelectorAll(No)),ct=e=>e.querySelector(No),De=e=>{const t=e.textContent;if(!t)return null;try{const r=JSON.parse(t);if(pp(r))return r}catch{return null}return null},hp=C({"@id":p(),"@type":p(),author:C({"@id":p()}).optional(),datePublished:p().optional(),dateModified:p().optional(),description:p().optional(),inLanguage:p().optional(),isPartOf:C({"@id":p()}).optional(),name:p().optional(),url:p().optional()}),fp=we.extend({"@graph":D(hp)}),mp=e=>fp.safeParse(e).success,dp=e=>{const t=zo(e);if(t.length===0)return null;const r=t.map(De).filter(mp).map(n=>n["@graph"]);return r.length!==1?null:r[0]},gp=(e,t)=>e.find(r=>r["@type"]===t)??null,vp=(e,t)=>e.find(r=>r["@id"]===t)??null,bp=e=>{const t=gp(e,"WebPage");if(!t)return null;const r=t.author?vp(e,t.author["@id"]):void 0;return it({au:r?.name?[r.name]:void 0,date:t.datePublished,title:t.name})},_p=({document:e})=>{const t=dp(e);return t?{bookmarkingWorkflowUrl:null,resource:bp(t)}:Z()},Lo=()=>Z(),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()),To=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 w(U(y.Journal,{pub:a,jtitle:t,issn:s,eissn:i}))},yp=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}},$p=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}=yp(e),a=h(e,"name","citation_publisher"),u=h(e,"name","citation_publication_date"),c=h(e,"name","citation_volume"),l=h(e,"name","citation_issue"),f=h(e,"name","citation_firstpage"),m=h(e,"name","citation_lastpage");return w(U(y.Article,{jtitle:t,atitle:r,au:n,doi:o,eissn:s,issn:i,pub:a,date:u,volume:c,issue:l,spage:f,epage:m}))},Rp=({document:e,url:t})=>{switch(Sp(t)){case"journal":return Ep(e);case"article":return $p(e);case void 0:return Z()}};var E=(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||{});const Ap=e=>{const t=h(e,"name","pbContext");if(!t)return E.None;const r=To(t);switch(r.has("page")?r.get("page")?.value:null){case"Article/Chapter View":return E.Article;case"Table of Contents":return E.Journal;default:return E.None}},wp=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},Ip=e=>e.querySelector('span[property="isPartOf"][typeof="PublicationVolume"] > span[property="volumeNumber"]')?.textContent??void 0,kp=e=>e.querySelector('span[property="isPartOf"][typeof="PublicationIssue"] > span[property="issueNumber"]')?.textContent??void 0,Cp=e=>e.querySelector('meta[name="dc.Identifier"][scheme="doi"]')?.getAttribute("content")??void 0,Pp=e=>e.querySelector("h1")?.textContent??void 0,Op=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},Np=e=>{const t=wp(e.document),r=h(e.document,"name","dc.Date"),n=Cp(e.document),o=Zo(e.document),s=o.get("issn"),i=o.get("eissn"),a=kp(e.document),u=h(e.document,"name","citation_journal_title"),c=h(e.document,"name","dc.Publisher"),l=h(e.document,"name","dc.Title"),f=Ip(e.document);return U(y.Article,{au:t,date:r,eissn:i,issn:s,issue:a,jtitle:u,pub:c,title:l,volume:f,doi:n})},zp=e=>{const t=Zo(e.document),r=t.get("issn"),n=t.get("eissn"),o=Pp(e.document),s=Op(e.document),i=s.get("issue"),a=s.get("volume"),u=s.get("date");return U(y.Journal,{eissn:n,issn:r,jtitle:o,title:o,issue:i,volume:a,date:u})},Lp=e=>{switch(Ap(e.document)){case E.Article:return w(Np(e));case E.Journal:return w(zp(e));default:return Z()}},Tp=e=>{const t=h(e,"name","citation_type"),r=h(e,"name","citation_article_type");return t==="JOUR"&&r?E.Article:t==="CHP"?E.Chapter:e.querySelector(".book-edition-year")?.textContent.includes("Book")?E.Book:e.getElementById("journal-title")?E.Journal:E.None},Wt=e=>h(e,"name","citation_doi")??h(e,"name","dc.identifier")??e.querySelector(".doi .anchor-text")?.textContent??void 0,Zp=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},Gt=(e,t)=>{const r=Array.from(e.querySelectorAll(t)).map(n=>n.textContent).filter(n=>!!n);return r.length>0?r:void 0},xp=e=>{const t=e.querySelector(".js-issn")?.textContent;if(t)return t.replace("Online ISSN: ","")},qp=e=>{const t=e.get("DOI");if(t)return URL.canParse(t)?new URL(t).pathname.substring(1):t},jp=e=>{const t=Zp(e),r=h(e,"property","og:title"),n=h(e,"property","og:book:isbn"),o=t.get("Published"),s=Gt(e,".authors-container .author-detail h3"),i=Wt(e)??qp(t);return Y(y.Book,{au:s,date:o,doi:i,isbn:n,title:r})},Dp=e=>{const t=h(e,"property","og:title"),r=h(e,"property","og:book:isbn"),n=h(e,"name","citation_publication_date"),o=Gt(e,".author-group .button-link-text"),s=h(e,"name","citation_firstpage"),i=h(e,"name","citation_lastpage"),a=h(e,"name","citation_publisher"),u=Wt(e),c=h(e,"name","citation_inbook_title")??e.querySelector(".publication-title")?.textContent??void 0;return Y(y.Bookitem,{au:o,btitle:c,date:n,doi:u,epage:i,isbn:r,pub:a,spage:s,title:t})},Up=e=>{const t=h(e,"property","og:title"),r=h(e,"name","citation_issn"),n=h(e,"name","citation_publication_date"),o=Gt(e,".author-group .button-link-text"),s=h(e,"name","citation_publisher"),i=h(e,"name","citation_firstpage"),a=h(e,"name","citation_issue"),u=h(e,"name","citation_volume"),c=Wt(e),l=h(e,"name","citation_journal_title")??e.querySelector(".publication-title")?.textContent??void 0;return U(y.Article,{au:o,jtitle:l,date:n,doi:c,issn:r,issue:a,pub:s,spage:i,title:t,volume:u})},Bp=e=>{const t=e.getElementById("journal-title")?.textContent??void 0,r=xp(e);return U(y.Journal,{issn:r,title:t})},Vp=({document:e})=>{switch(Tp(e)){case E.Book:return w(jp(e));case E.Chapter:return w(Dp(e));case E.Article:return w(Up(e));case E.Journal:return w(Bp(e));default:return Z()}},Fp=e=>{const t=h(e,"name","pbContext");return t&&To(t).has("article")?E.Article:E.Journal},Jp=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},Mp=e=>{const t=e.querySelector(".issue-heading")?.textContent;return t?t.split(",")[0]?.replace("Volume","").trim():void 0},Wp=e=>{const t=e.querySelector(".issue-heading .nav-toc-list")?.textContent;return t?t.replace("Issue","").trim():void 0},Gp=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=Mp(e),u=Wp(e),c=Jp(e),l=c?.includes("-")?c.split("-")[0]:c,f=c?.includes("-")?c.split("-")[1]:c;return U(y.Article,{au:i,jtitle:s,date:n,doi:o,issue:u,pub:r,spage:l,epage:f,title:t,volume:a})},Xp=e=>{const t=h(e,"property","og:title"),r=h(e,"name","publication_doi");return U(y.Journal,{doi:r,title:t})},Hp=({document:e})=>{switch(Fp(e)){case E.Article:return w(Gp(e));case E.Journal:return w(Xp(e));default:return Z()}},Yp=e=>at.safeParse(e).success,Kp=e=>$o.safeParse(e).success,Qp=e=>Ro.safeParse(e).success,eh=e=>qt.safeParse(e).success,th=e=>jt.safeParse(e).success;function rh(e){return Ut.safeParse(e).success}function ut(e){return Bt.safeParse(e).success}function xo(e){return Vt.safeParse(e).success}function qo(e){return Ft.safeParse(e).success}function nh(e){return Dt.safeParse(e).success}const oh=e=>Array.from(e.querySelectorAll("tr th")).find(n=>n.textContent.trim()==="DOI:")?.nextElementSibling?.querySelector('span[property="identifier"]')?.textContent??void 0,sh=e=>{const t=/Record\/(\d+)/.exec(e);if(t&&t.length>1)return t[1]},ih=e=>{const{url:t,document:r}=e,n=Jt(e);if(!ut(n))return n;const o=oh(r);return o&&(n.resource.rft_id=[`info:doi/${o}`]),n.resource.bibid=sh(t),n},ah=we.extend({"@type":M("VideoObject"),name:p(),author:p(),genre:p(),description:p(),uploadDate:p(),duration:p(),thumbnailUrl:D(p())}),ch=e=>ah.safeParse(e).success,uh=e=>{const t=zo(e);if(t.length===0)return null;const r=t.map(De).filter(ch);return r.length!==1?null:r[0]},lh=({url:e,document:t})=>{const r=uh(t);return r?{bookmarkingWorkflowUrl:null,resource:be({au:[r.author],date:r.uploadDate,title:r.name,uri:e})}:Z()},jo=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,Do=e=>{const t=e.editor?.map(o=>o.name)??[],n=[...e.author?.map(o=>o.name)??[],...t];if(n.length!==0)return n};var Ue=(e=>(e.Book="Book",e.Journal="Journal",e.Periodical="Periodical",e.PublicationVolume="PublicationVolume",e.ScholarlyArticle="ScholarlyArticle",e.VideoObject="VideoObject",e.WebPage="WebPage",e))(Ue||{}),Se=(e=>(e.Article="article",e.Book="book",e.Paper="Paper",e.Video="video.other",e.Website="website",e))(Se||{}),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 Uo=C({"@type":M(Ue.ScholarlyArticle),author:D(C({"@type":p(),name:p()})).optional(),editor:D(C({"@type":p(),name:p()})).optional(),datePublished:p().optional(),headline:p().optional(),issn:D(p()).optional(),pageStart:p().optional(),pageEnd:p().optional(),isPartOf:C({"@type":pe([p(),D(p())]),name:p(),issn:D(p()).optional(),volumeNumber:p().optional(),isbn:D(p()).optional()}),publisher:C({"@type":p(),name:p()}).optional()}),Bo=e=>Uo.safeParse(e).success,ph=we.extend({"@type":M(Ue.WebPage),mainEntity:Uo}),hh=e=>ph.safeParse(e).success,fh=C({"@type":D(p()),name:p().optional(),issn:D(p()),volumeNumber:p().optional()}),Vo=e=>fh.safeParse(e).success,mh=(e,t)=>h(e,"name","citation_issn")??h(e,"name","prism.issn")??(Bo(t.isPartOf)?t.isPartOf.issn?.[0]:void 0),Fo=(e,t)=>{const r=Do(t),n=h(e,"name","citation_online_date"),o=jo(e),s=h(e,"name","citation_issue"),i=mh(e,t),a=Vo(t.isPartOf)&&t.isPartOf.issn.length>0?t.isPartOf.issn[1]:void 0,u=t.pageStart,c=t.pageEnd,l=t.headline,f=t.isPartOf.name,m=Vo(t.isPartOf)?t.isPartOf.volumeNumber:void 0;return U(y.Article,{au:r,date:n,doi:o,issue:s,eissn:i,issn:a,spage:u,epage:c,atitle:l,jtitle:f,volume:m})},dh=we.extend({"@type":M(Ue.Book),copyrightYear:p().optional(),author:D(C({"@type":p(),name:p()})).optional(),editor:D(C({"@type":p(),name:p()})).optional(),isbn:p().optional(),name:p().optional(),numberOfPages:Kn().optional(),publisher:C({"@type":p(),name:p()}).optional()}),gh=e=>dh.safeParse(e).success,vh=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},bh=(e,t)=>{const r=vh(e),n=Do(t),o=t.copyrightYear?.toString(),s=jo(e)??r.get("DOI"),i=t.name??r.get("Book Title"),a=t.isbn??r.get("Softcover ISBN"),u=t.numberOfPages?.toString()??r.get("Number of Pages"),c=t.publisher?.name??r.get("Publisher");return Y(y.Book,{au:n,date:o,doi:s,title:i,isbn:a,tpages:u,pub:c})},_h=C({"@type":M("Periodical"),name:p(),url:p(),issn:D(p()),editor:D(C({givenName:p(),familyName:p()})),publisher:C({name:p()}),description:p()}),Sh=e=>_h.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 U(y.Journal,{au:t,jtitle:r,eissn:n,issn:o,pub:s})},yh=C({"@type":M(Ue.VideoObject),name:p().optional(),description:p().optional(),thumbnailUrl:p().optional(),uploadDate:p().optional(),contentUrl:p().optional(),duration:p().optional()}),$h=e=>yh.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 be({au:r.length>0?r:void 0,date:n,doi:s,title:o})},Ah=e=>{const t=h(e,"property","og:title");return it({title:t})},wh=(e,t)=>{const r=h(t,"property","og:type");return r===Se.Article&&e.includes(ce.Article)?E.Article:r===Se.Book&&(e.includes(ce.Book)||e.includes(ce.ReferenceWork))?E.Book:r===Se.Paper&&e.includes(ce.Chapter)?E.Chapter:r===Se.Paper&&(e.includes(ce.ReferenceWorkEntry)||e.includes(ce.Protocol))?E.Article:r===Se.Video&&e.includes(ce.Video)?E.AudioVisual:r===Se.Website&&(e.includes(ce.Collections)||e.includes(ce.JournalIssue))?E.Webpage:r===Se.Website&&e.includes(ce.Journal)?E.Journal:E.None},Ih=(e,t,r)=>e===E.AudioVisual&&$h(r)?w(Rh(t,r)):e===E.Book&&gh(r)?w(bh(t,r)):(e===E.Chapter||e===E.Article)&&Bo(r)?w(Fo(t,r)):e===E.Article&&hh(r)?w(Fo(t,r.mainEntity)):e===E.Journal&&Sh(r)?w(Eh(r)):Z(),kh=({url:e,document:t})=>{const r=wh(e,t);if(r===E.Webpage)return w(Ah(t));const n=ct(t);if(!n)return Z();const o=De(n);return o?Ih(r,t,o):Z()},Ch=new Set(["Print ISBN","Online ISBN","DOI","First published","Online ISSN","Print ISSN"]),Jo=(e,t)=>{if(!e)return;const r=e.indexOf(t);return r>-1?e.substring(0,r):e},Xt=e=>{const r=/\d+/.exec(e);if(r?.[0])return r[0]},Ph=e=>{const t=h(e,"property","og:type");return t==="Book"||t==="books.book"?E.Book:t==="Chapter"?E.Chapter:t==="Journal"?E.Journal:t==="Article"?E.Article:E.None},lt=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},Oh=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 Xt(t)},pt=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=Jo(n.textContent,":"),i=Jo(o.textContent,":");!s||!i||Ch.has(s)&&t.set(s,i)}return t},ht=(e,t)=>h(e,"property","books:release_date")??h(e,"name","citation_online_date")??t.get("First published")??void 0,Ht=(e,t)=>h(e,"name","dc.identifier")??h(e,"name","citation_doi")??h(e,"name","publication_doi")??t.get("DOI")??void 0,Mo=(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},Nh=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=Xt(o.textContent)),s.textContent&&(r=Xt(s.textContent))}return{volume:t,issue:r}},zh=e=>{const t=pt(e),r=lt(e),n=h(e,"property","og:title"),o=ht(e,t),s=Ht(e,t),i=Mo(e,t),a=Oh(e);return Y(y.Book,{au:r,date:o,doi:s,isbn:i,pages:a,title:n})},Lh=e=>{const t=pt(e),r=lt(e),n=h(e,"name","citation_book_title"),o=ht(e,t),s=Ht(e,t),i=Mo(e,t),a=h(e,"name","citation_publisher"),u=h(e,"property","og:title");return Y(y.Bookitem,{au:r,btitle:n,date:o,doi:s,isbn:i,pub:a,title:u})},Th=e=>{const t=pt(e),r=lt(e),n=ht(e,t),o=t.get("Online ISSN"),s=t.get("Print ISSN"),i=h(e,"property","og:title"),{volume:a,issue:u}=Nh(e);return U(y.Journal,{au:r,date:n,eissn:o,issn:s,issue:u,title:i,volume:a})},Zh=e=>{const t=pt(e),r=lt(e),n=ht(e,t),o=Ht(e,t),s=h(e,"name","citation_issn"),i=h(e,"name","citation_journal_title"),a=h(e,"property","og:title");return U(y.Article,{au:r,date:n,doi:o,issn:s,jtitle:i,title:a})},xh=({document:e})=>{switch(Ph(e)){case E.Book:return w(zh(e));case E.Chapter:return w(Lh(e));case E.Journal:return w(Th(e));case E.Article:return w(Zh(e));default:return Z()}},qh=e=>{const t=re(e,"name","citation_author");return t.length>0?t:void 0},jh=({document:e})=>{const t=qh(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=be({au:t,date:r,doi:n,isbn:o,pub:s,title:i});return w(a)},Dh=({document:e})=>Array.from(e.querySelectorAll(".Z3988")).length<=1?Z():Ao(),Yt=e=>{if(!(!e||e.length===0))return e[0]};function Wo(e,t){const r=t.map(n=>{const o=e.querySelector(n)?.textContent??null;if(o&&o.trim()!=="")return o}).filter(n=>n);return Yt(r)??null}const Uh=e=>{const t=e.querySelector(".content-meta-data__authors")?.textContent;if(t)return t.split(/,\s+|\s+and\s+/).filter(r=>!!r)},Bh=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},Vh=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},Fh=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([...Vh(e)??[],...Uh(e)??[],...Fh(e)??[],...Bh(e)??[]]);return t.size?[...t]:void 0},ke=(e,t)=>e.querySelector('[data-qa="published-date"]')?.textContent??e.querySelector(".summary-image")?.textContent??Be(t?.get("date"))??Be(t?.get("copyright date"))??Be(t?.get("published date")),Go=e=>{const t=e.find(r=>r.startsWith("https://doi.org/"));if(t)return t.replace("https://doi.org/","")},Xo=e=>{const t=e.get("local identifier");if(t?.length)return Go(t)},Be=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},Ho=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,"")??Be(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}},Jh=e=>{const t=Wo(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},ft=e=>me(e.querySelector('[data-qa="page-count"]')?.textContent),Ve=(e,t)=>e.querySelector(".publisher-link")?.textContent??Be(t?.get("publisher")),Ee=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,ye=e=>{if(!URL.canParse(e))return;const t=new URL(e);return t.origin+t.pathname},Mh=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}},Wh=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,u=i?i[2]:void 0,c=/pp\.\s*\d+-\d+\s*\((\d+)\s*pages\)/.exec(t),l=c?c[1]:void 0;return{issue:s,volume:n,spage:a,epage:u,pages:l}},Gh=e=>{const t=Wo(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 Yt(n)},Xh=(e,t)=>{const r=Ee(e),n=Ie(e),o=ke(e)??Gh(e),s=Ho(e),i=s.jtitle??Jh(e)??void 0,a=s.pub,u=Mh(e),c=Wh(e),l=u.issue??c.issue,f=u.volume??c.volume,m=ft(e)??c.pages,g=c.spage,P=c.epage,b=ye(t),O=Go(Array.from(e.querySelector(".content-meta-data-stables")?.childNodes??[]).map(q=>q.textContent??""));return U(y.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})},Hh=(e,t)=>{const r=Ce(e),n=Ie(e),o=ke(e,r),s=Ee(e),i=Ve(e,r),a=ye(t);return be({au:n,date:o,pub:i,title:s,uri:a})},Yh=(e,t)=>{const r=Ce(e),n=Ie(e),o=Ee(e),s=ke(e),i=ft(e),a=Ve(e,r),u=ye(t),c=Xo(r);return Y(y.Book,{au:n,date:s,doi:c,pages:i,pub:a,title:o,uri:u})},Kh=(e,t)=>{const r=Ce(e),n=Ie(e),o=Ee(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),u=ft(e),c=a.find(m=>m.includes("pp."))?.match(/(\d+)-(\d+)/)??void 0,l=Ve(e,r),f=ye(t);return Y(y.Bookitem,{atitle:o,au:n,btitle:s,date:i,epage:c?.[2],pub:l,pages:u,spage:c?.[1],uri:f})},Qh=(e,t)=>{const r=Ce(e),n=Ie(e),o=Ee(e),s=ke(e),i=ft(e),a=Ve(e,r),u=ye(t),c=Xo(r);return Y(y.Document,{au:n,date:s,doi:c,pages:i,pub:a,title:o,uri:u})},ef=(e,t)=>{const r=Ce(e),n=Ie(e),o=ke(e,r),s=Ee(e),i=ye(t);return co({au:n,date:o,title:s,uri:i})},tf=(e,t)=>{const{pub:r}=Ho(e),n=Ee(e),o=e.querySelector(".eissn")?.textContent.replace(/EISSN\s+/,"").trim()??void 0,s=e.querySelector(".issn")?.textContent.replace(/ISSN\s+/,"").trim()??void 0,i=ye(t);return U(y.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 rf=(e,t)=>{const r=Ce(e),n=Ie(e),o=ke(e,r),s=Ee(e),i=Ve(e,r),a=ye(t);return be({au:n,date:o,pub:i,title:s,uri:a})},nf=e=>Object.values(ie).includes(e),of=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 nf(n)?n:null},sf=(e,t)=>{switch(of(e)){case ie.Article:case ie.Serial:return Xh(e,t);case ie.Audio:return Hh(e,t);case ie.Book:return Yh(e,t);case ie.Chapter:case ie.ResearchReport:return Kh(e,t);case ie.Document:return Qh(e,t);case ie.Image:return ef(e,t);case ie.Journal:return tf(e,t);case ie.Video:return rf(e,t);default:return null}},af=({document:e,url:t})=>{const r=sf(e,t);return r?w(r):Z()},Fe=e=>{if(e){if(typeof e=="string")return e;if(e.length>0)return e[0]}else return},Yo=e=>{if(e)return typeof e=="string"?e:Array.isArray(e)?e.length===0?void 0:Fe(e[0].name):Fe(e.name)},mt=(...e)=>{const t=new Set(e.filter(r=>!!r));if(t.size!==0)return[...t]},cf=e=>{const t=Yo(e.mainEntity.creator);return t?[t]:void 0},Je=({lcn:e,title:t})=>({bibid:e,title:t}),uf=(e,t)=>{const r=mt(...(e&&cf(e))??[],...t.authors??[]),n=mt(...t.eissns??[]),o=mt(e?.mainEntity.isbn?Mt(e.mainEntity.isbn):void 0,...t.isbns??[]),s=mt(...e?.mainEntity.issn??[],...t.issns??[]),[i,a]=e?.mainEntity.pagination?.split("-")??[];return{authors:r,date:t.date,doi:Fe(t.dois),edition:e?.mainEntity.edition??t.edition,epage:a,eissn:Fe(n),lcn:t.lcn??e?.identifier.value,isbn:o?.join(","),issn:Fe(s),issue:e?.mainEntity.issueNumber,jtitle:t.jtitle,publisher:t.publisher??Yo(e?.mainEntity.publisher),spage:i,title:e?.name??t.title,volume:e?.mainEntity.volumeNumber}},lf=e=>U(y.Article,{...Je(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}),pf=e=>be({...Je(e),au:e.authors,date:e.date,pub:e.publisher}),hf=e=>Y(y.Book,{...Je(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}),ff=e=>U(y.Journal,{...Je(e),date:e.date,doi:e.doi,eissn:e.eissn,issn:e.issn,pub:e.publisher}),Ko=C({"@type":M("Organization"),name:pe([p(),D(p())])}),Qo=C({"@type":M("Person"),name:pe([p(),D(p())])}),mf=we.extend({identifier:C({"@type":p(),propertyID:p(),value:p()}),mainEntity:C({"@type":p(),"@id":p(),creator:he(pe([p(),Qo,D(Qo)])),edition:he(p()),isbn:he(p()),issn:he(D(p())),issueNumber:he(p()),pagination:he(p()),publisher:he(pe([p(),Ko,D(Ko)])),volumeNumber:he(p())}),name:p()}),df=e=>{const t=ct(e);if(!t)return null;const r=De(t),n=mf.safeParse(r);return n.success?n.data:null},gf=e=>be({...Je(e),au:e.authors,date:e.date,pub:e.publisher}),vf=/([0-9]{4}-[0-9]{1,2}-[0-9]{1,2}|[0-9]{4}-[0-9]{1,2}|[0-9]{4})/,es=/(E?ISBN|E?ISSN|DOI)\s*:\s*/g,Kt=e=>`*:has([title*="${e}" i]) + .item-details-element-container prm-highlight`,bf=e=>{if(!e)return;const t=vf.exec(e);if(t)return t.length>1?t[1]:void 0},_f=e=>{const t=Array.from(e.querySelectorAll(Kt("Identifier"))),r={};return t.map(n=>n.textContent).filter(n=>!!n).forEach(n=>{const o=[];let s;for(;(s=es.exec(n))!==null;)o.push({id:s[1].toLowerCase(),index:s.index,start:es.lastIndex});o.forEach(({id:i,start:a},u)=>{r[i]??=[],r[i].push(n.substring(a,o[u+1]?.index))})}),r},Sf=e=>Array.from(e.querySelectorAll(Kt("Author"))).filter(t=>!!t.textContent&&t.parentElement!==null&&t.parentElement.getAttribute("aria-hidden")!=="true").map(t=>t.textContent.trim()),$e=(e,t)=>e.querySelector(Kt(t))?.textContent.trim(),Ef=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"),u=Sf(e),c=_f(e),[l]=o?.split(",")??[],f=bf(n??t),m=[...c.isbn??[],...c.eisbn??[]].map(g=>Mt(g)).filter(g=>!!g);return{authors:u,date:f,dois:c.doi,edition:r,eissns:c.eissn,isbns:m,issns:c.issn,jtitle:l,lcn:a,publisher:s,title:i}};var ts=(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))(ts||{});const yf=e=>Object.values(ts).includes(e),$f=(e,t)=>{const r=t?.mainEntity["@type"]??e.querySelector(".media-content-type")?.textContent??void 0;if(yf(r))return r},Rf=({document:e})=>{const t=df(e),r=Ef(e),n=uf(t,r);switch($f(e,t)){case"Article":return w(lf(n));case"Book":return w(hf(n));case"Periodical":case"Journal":return w(ff(n));case"Audio CD":case"CreativeWork":return w(pf(n));case"Movie":case"Video":return w(gf(n));default:return Z()}},Af=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")?E.Article:o?.startsWith("urn:issn:")?E.Journal:void 0},wf=e=>{const t=h(e,"name","DCTERMS.bibliographicCitation"),[r,n,o,s]=t?.split(",")??[];return{journalTitle:r,volume:n,issue:o,pages:s}},If=e=>{const t=h(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,Cf=e=>{const[t,r]=e?e.trim().split("-"):[void 0,void 0],n=r?.replace(/\(\d+\)/,"").trim();return{spage:t,epage:n}},Pf=e=>{const t=h(e,"name","DCTERMS.issued");if(!t)return;const n=/\d{4}/.exec(t);return n?n[0]:void 0},Of=e=>{const t=h(e,"name","DC.title"),r=h(e,"name","DC.publisher"),n=Pf(e),o=wf(e),s=o.journalTitle?.trim(),i=o.volume?.trim(),a=o.issue?.trim(),u=o.pages?Cf(o.pages):void 0,c=u?.spage,l=u?.epage,f=re(e,"name","DC.creator"),m=If(e);return U(y.Article,{au:f,jtitle:s,date:n,doi:m,issue:a,pub:r,spage:c,epage:l,atitle:t,volume:i})},Nf=e=>{const t=h(e,"name","DC.title"),r=h(e,"name","DC.publisher"),n=kf(e);return U(y.Journal,{issn:n,title:t,pub:r})},zf=({document:e})=>{switch(Af(e)){case E.Article:return w(Of(e));case E.Journal:return w(Nf(e));default:return Z()}},Lf=/^\d{4}-\d{3}[\dX]$/i,Tf=e=>Lf.test(e),rs=e=>{const t=e.filter(Tf);return t.length?t:void 0},Qt=e=>{const t=re(e,"name","citation_author");return t.length?t:void 0},er=e=>h(e,"name","citation_publication_date")?.match(/^\d{4}/)?.[0],Zf=e=>h(e,"name","citation_doi"),ns=e=>{const t=re(e,"name","citation_isbn");return t.length?t.join(","):void 0},os=e=>rs(re(e,"name","citation_issn")),tr=e=>h(e,"name","citation_journal_title"),rr=e=>h(e,"name","citation_publisher"),dt=e=>h(e,"name","citation_title"),xf=e=>h(e,"name","citation_doi"),nr=e=>h(e,"name","citation_firstpage"),or=e=>h(e,"name","citation_lastpage"),qf=e=>h(e,"name","citation_issue"),jf=e=>h(e,"name","citation_volume"),Df=e=>U(y.Article,{atitle:dt(e),au:Qt(e),date:er(e),doi:Zf(e),issn:os(e)?.[0],issue:qf(e),jtitle:tr(e),pub:rr(e),volume:jf(e),spage:nr(e),epage:or(e)}),Uf=e=>Y(y.Bookitem,{atitle:dt(e),au:Qt(e),btitle:tr(e),date:er(e),isbn:ns(e),pub:rr(e),spage:nr(e),epage:or(e)}),Bf=e=>uo({title:dt(e),au:Qt(e),date:er(e),pub:rr(e),spage:nr(e),epage:or(e)}),ss=e=>!!e.isbn,Vf=e=>!!e.issn||e.type==="Article"&&!!e.journalTitle||!ss(e)&&!!e.journalTitle,Ff=e=>!!e.title,Jf=e=>{const t={type:xf(e),isbn:ns(e),issn:os(e),journalTitle:tr(e),title:dt(e)};return ss(t)?Uf(e):Vf(t)?Df(e):Ff(t)?Bf(e):null},Mf=({document:e})=>{const t=Jf(e);return t?w(t):Z()},Wf=C({"@content":p(),datePublished:p().optional(),mainEntity:C({type:p().optional(),name:p().optional(),author:D(C({name:p()})).optional(),publisher:C({type:p(),name:p()}).optional(),isbn:p().optional()})}),Gf=e=>Wf.safeParse(e).success,Xf=e=>{const t=e.textContent;if(!t)return null;try{const r=JSON.parse(t);if(Gf(r))return r}catch{return null}return null},Hf=({document:e})=>{const t=ct(e);if(!t)return Z();const r=Xf(t);if(!r)return Z();const n=r.mainEntity.type,o=r.mainEntity.author?.map(c=>c.name),s=r.datePublished?.substring(0,4),i=r.mainEntity.name,a=r.mainEntity.isbn,u=r.mainEntity.publisher?.name;switch(n){case"Book":return w(Y(y.Book,{au:o,date:s,title:i,isbn:a,pub:u}));default:return Z()}},Yf=we.extend({"@type":p().optional(),name:p().optional(),copyrightYear:Kn().optional(),author:D(C({name:p()})).optional(),publisher:D(C({name:p()})).optional()}),Kf=e=>Yf.safeParse(e).success,Qf=({document:e,url:t})=>{const r=ct(e);if(!r)return Z();const n=De(r);if(!n||!Kf(n))return Z();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,u=Yt(n.publisher?.map(l=>l.name)),c=h(e,"property","og:book:isbn");switch(o){case"Book":return w(Y(y.Book,{au:s,date:i,title:a,isbn:c,pub:u,uri:t}));default:return Z()}},em=e=>{const t=Array.from(e.querySelectorAll("a[rel=author]")).map(r=>r.textContent.trim()).filter(Boolean);return t.length?t:void 0},tm=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+/,",")},rm=({url:e,document:t})=>{const r=t.querySelector("h3.page-title")?.textContent.trim()??void 0,n=em(t),o=h(t,"property","article:published_time"),s=tm(t),i=Y(y.Book,{au:n,date:o?.substring(0,4),isbn:s,pub:"Milne Open Textbooks",title:r,uri:e});return w(i)},nm=({document:e,url:t})=>{switch(om(t)){case E.Chapter:return w(um(e));case E.Book:return w(lm(e));case E.Article:return w(sm(e));case E.Journal:return w(im(e));default:return Z()}},om=e=>{const{pathname:t}=new URL(e);return t.includes("/books/abs/")?E.Chapter:t.includes("/books/")?E.Book:/\/journals\/.+\/article\//.exec(t)!=null?E.Article:t.includes("/journals/")?E.Journal:E.None},sm=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"),u=h(e,"name","citation_publication_date")?.substring(0,4),c=h(e,"name","citation_publisher"),l=is(e),f=rs(re(e,"name","citation_issn"));return U(y.Article,{atitle:t,au:l,jtitle:r,doi:n,volume:o,issue:s,issn:f?.[0],spage:i,epage:a,date:u,pub:c})},im=e=>{const t=am(e),r=cm(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 U(y.Journal,{title:t,issn:s,eissn:i})},am=e=>e.querySelector("h1.title")?.textContent.trim()??void 0,cm=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(),u=n.exec(a);u&&o.push({value:u[1],type:u[2]})}),o},um=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(y.Bookitem,{atitle:t,btitle:r,doi:n,date:o,pub:s})},lm=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=is(e);return Y(y.Book,{title:t,au:i,doi:r,isbn:n,date:o,pub:s})},is=e=>{const t=re(e,"name","citation_author");return t.length?t:void 0},pm=e=>{switch(h(e,"property","og:type")){case"Article":return"Article";case"Journal":return"Journal";default:return}};function hm(e){const t=h(e,"property","og:title"),r=h(e,"name","dc.Publisher"),n=h(e,"name","publication_doi");return w(U(y.Journal,{jtitle:t,pub:r,doi:n}))}function fm(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 w(U(y.Article,{atitle:t,au:r,date:n,doi:o,jtitle:s,pub:i}))}const mm=({document:e})=>{switch(pm(e)){case"Journal":return hm(e);case"Article":return fm(e);default:return Z()}},dm=e=>{if(!e)return;const[t,r]=e.trim().split("-");return{spage:t,epage:r}},gm=e=>{const{pathname:t}=new URL(e);if(t.includes("/article/"))return E.Article},vm=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"),u=h(e,"name","DC.Identifier.URI"),c=h(e,"name","DC.Identifier.pageNumber"),l=c?dm(c):void 0,f=l?.spage,m=l?.epage;return U(y.Article,{jtitle:t,atitle:r,au:n,issn:o,date:s,spage:f,epage:m,volume:i,issue:a,uri:u})},bm=({document:e,url:t})=>{switch(gm(t)){case E.Article:return w(vm(e));default:return Z()}},_m=e=>{switch(Sm(e)){case"eBook":return"Book";case"Reference":return"Chapter";default:return}},Sm=e=>e.querySelector("#vol-contentType a")?.textContent??void 0;function Em(e,t){const r=as(e),n=sr(e),o=us(e),s=ls(e),i=ps(e),a=hs(e),u=sr(e),c=t,{startPage:l,endPage:f}=fs(e)??{};return w(Y(y.Book,{au:r,btitle:n,date:o,doi:s,epage:f,isbn:i,pub:a,spage:l,title:u,uri:c}))}function ym(e,t){const r=as(e),n=cs(e),o=sr(e),s=us(e),i=ls(e),a=ps(e),u=hs(e),c=cs(e),l=t,{startPage:f,endPage:m}=fs(e)??{};return w(Y(y.Book,{au:r,atitle:n,btitle:o,date:s,doi:i,epage:m,isbn:a,pub:u,spage:f,title:c,uri:l}))}const as=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,$m=e=>h(e,"property","og:title"),sr=e=>Te(e,"titlevalue")??$m(e),cs=e=>Te(e,"chapter-title-squid"),us=e=>Te(e,"pubdate-squid"),ls=e=>Te(e,"doi-squid"),ps=e=>Te(e,"isbn-squid"),hs=e=>Te(e,"pubname-squid"),fs=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]}},Rm=({document:e,url:t})=>{switch(_m(e)){case"Book":return Em(e,t);case"Chapter":return ym(e,t);default:return Z()}},Am=(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(),wm=e=>{switch(Am(e,"Medium")){case"book":case"e-book":return y.Book;case"e-journal":return y.Journal;default:return y.Unknown}},Im=e=>{delete e.rft_id},km=e=>{const t=Jt(e);if(ut(t)){const r=wm(e.document);t.resource.genre=r,Im(t.resource)}return t},Cm=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 E.Article;const o=h(e,"name","twitter:title")?.trim(),s=h(e,"name","description")?.trim();if(o||s)return E.Webpage},Pm=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"),u=re(e,"name","citation_author");return U(y.Article,{au:u,jtitle:s,date:n,doi:o,issn:a,pub:r,title:t,volume:i})},Om=(e,t)=>{const r=h(t,"name","twitter:title");return it({uri:e,title:r})},Nm=({url:e,document:t})=>{switch(Cm(t)){case E.Article:return w(Pm(t));case E.Webpage:return w(Om(e,t))}return Z()},zm=({document:e})=>Array.from(e.querySelectorAll(".availability.documentSummaryAvailability.availabilityContent")).length<=1?Z():wo(),Lm=/([0-9]{4})\s+at/;function Tm(e){if(!e)return;const t=Lm.exec(e);if(t&&t.length>1)return t[1]}function ms(e,t){const r=e.getElementsByClassName(t);if(r.length!==0)return r[0].textContent}function Zm(e){const t={};return Array.from(e.getElementsByTagName("li")).reduce((r,n)=>{const o=ms(n,"title"),s=ms(n,"content");return o&&s&&(r[o]=s),r},t)}function xm(e){const t=e.getElementsByClassName("information");if(t.length===0)return{};const r=Zm(t[0]),n=Tm(r.Published),o=r.Show;return{date:n,series:o}}const qm=({url:e,document:t})=>{if(!new URL(e).searchParams.has("i"))return Z();const n=y.AudioDocument,o=h(t,"property","og:site_name"),s=h(t,"property","og:title"),i=xm(t);return w({genre:n,pub:o,title:s,uri:e,...i})};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))(x||{});const ir={NoResourceFound:Lo,Z3988:Jt,Z3988SearchResult:Dh,Amazon:Yl,CupOfJo:_p,Jstor:af,Youtube:lh,SagePub:Lp,SageVideo:jh,ScienceDirect:Vp,Springer:kh,TaylorFrancis:Hp,Wiley:xh,VuFind:ih,ClinicalKey:lp,DOAJ:Rp,Primo:Rf,IngentaConnect:zf,Ebscohost:Mf,OpenStax:Hf,OpenTextbook:Qf,Milne:rm,CambridgeJournalsOnline:nm,AhaJournals:mm,Ijees:bm,BloomsburyCollections:Rm,HeritageCirqa:km,BritishMedicalJournal:Nm,SummonSearchResult:zm,ApplePodcasts:qm},jm="5.24.0",ar=()=>jm,Dm=["com.au","com","ca","co.uk","de","fr","nl"].flatMap(e=>[`amazon.${e}`,`www.amazon.${e}`]),Um={version:ar(),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:Dm},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]}]},cr=C({hostnames:D(p()).min(1)}),ur=C({regexp:p()}),lr=pe([cr,ur]),pr=C({matcher:lr,name:p(),parsers:D(p()),libraryVersionRange:p().optional()}),ds=C({siteRegistrations:D(pr),version:p()}),Bm=e=>ds.safeParse(e).success,Vm=e=>pr.safeParse(e).success,Fm=e=>lr.safeParse(e).success,gs=e=>Object.values(x).includes(e),Jm=e=>typeof e=="object"&&e!==null,vs=C({url:p(),document:El(Jm)}),Mm=e=>vs.safeParse(e).success;var gt={exports:{}},hr,bs;function vt(){if(bs)return hr;bs=1;const e="2.0.0",t=256,r=Number.MAX_SAFE_INTEGER||9007199254740991,n=16,o=t-6;return hr={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},hr}var fr,_s;function bt(){return _s||(_s=1,fr=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{}),fr}var Ss;function Me(){return Ss||(Ss=1,(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:o}=vt(),s=bt();t=e.exports={};const i=t.re=[],a=t.safeRe=[],u=t.src=[],c=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[q,K]of g)O=O.split(`${q}*`).join(`${q}{0,${K}}`).split(`${q}+`).join(`${q}{1,${K}}`);return O},b=(O,q,K)=>{const L=P(q),B=f++;s(O,B,q),l[O]=B,u[B]=q,c[B]=L,i[B]=new RegExp(q,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",`(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})`),b("MAINVERSIONLOOSE",`(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})`),b("PRERELEASEIDENTIFIER",`(?:${u[l.NONNUMERICIDENTIFIER]}|${u[l.NUMERICIDENTIFIER]})`),b("PRERELEASEIDENTIFIERLOOSE",`(?:${u[l.NONNUMERICIDENTIFIER]}|${u[l.NUMERICIDENTIFIERLOOSE]})`),b("PRERELEASE",`(?:-(${u[l.PRERELEASEIDENTIFIER]}(?:\\.${u[l.PRERELEASEIDENTIFIER]})*))`),b("PRERELEASELOOSE",`(?:-?(${u[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[l.PRERELEASEIDENTIFIERLOOSE]})*))`),b("BUILDIDENTIFIER",`${m}+`),b("BUILD",`(?:\\+(${u[l.BUILDIDENTIFIER]}(?:\\.${u[l.BUILDIDENTIFIER]})*))`),b("FULLPLAIN",`v?${u[l.MAINVERSION]}${u[l.PRERELEASE]}?${u[l.BUILD]}?`),b("FULL",`^${u[l.FULLPLAIN]}$`),b("LOOSEPLAIN",`[v=\\s]*${u[l.MAINVERSIONLOOSE]}${u[l.PRERELEASELOOSE]}?${u[l.BUILD]}?`),b("LOOSE",`^${u[l.LOOSEPLAIN]}$`),b("GTLT","((?:<|>)?=?)"),b("XRANGEIDENTIFIERLOOSE",`${u[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),b("XRANGEIDENTIFIER",`${u[l.NUMERICIDENTIFIER]}|x|X|\\*`),b("XRANGEPLAIN",`[v=\\s]*(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:${u[l.PRERELEASE]})?${u[l.BUILD]}?)?)?`),b("XRANGEPLAINLOOSE",`[v=\\s]*(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:${u[l.PRERELEASELOOSE]})?${u[l.BUILD]}?)?)?`),b("XRANGE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAIN]}$`),b("XRANGELOOSE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAINLOOSE]}$`),b("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),b("COERCE",`${u[l.COERCEPLAIN]}(?:$|[^\\d])`),b("COERCEFULL",u[l.COERCEPLAIN]+`(?:${u[l.PRERELEASE]})?(?:${u[l.BUILD]})?(?:$|[^\\d])`),b("COERCERTL",u[l.COERCE],!0),b("COERCERTLFULL",u[l.COERCEFULL],!0),b("LONETILDE","(?:~>?)"),b("TILDETRIM",`(\\s*)${u[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",b("TILDE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAIN]}$`),b("TILDELOOSE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAINLOOSE]}$`),b("LONECARET","(?:\\^)"),b("CARETTRIM",`(\\s*)${u[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",b("CARET",`^${u[l.LONECARET]}${u[l.XRANGEPLAIN]}$`),b("CARETLOOSE",`^${u[l.LONECARET]}${u[l.XRANGEPLAINLOOSE]}$`),b("COMPARATORLOOSE",`^${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]})$|^$`),b("COMPARATOR",`^${u[l.GTLT]}\\s*(${u[l.FULLPLAIN]})$|^$`),b("COMPARATORTRIM",`(\\s*)${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]}|${u[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",b("HYPHENRANGE",`^\\s*(${u[l.XRANGEPLAIN]})\\s+-\\s+(${u[l.XRANGEPLAIN]})\\s*$`),b("HYPHENRANGELOOSE",`^\\s*(${u[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[l.XRANGEPLAINLOOSE]})\\s*$`),b("STAR","(<|>)?=?\\s*\\*"),b("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),b("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(gt,gt.exports)),gt.exports}var mr,Es;function dr(){if(Es)return mr;Es=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return mr=n=>n?typeof n!="object"?e:n:t,mr}var gr,ys;function $s(){if(ys)return gr;ys=1;const e=/^[0-9]+$/,t=(n,o)=>{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 gr={compareIdentifiers:t,rcompareIdentifiers:(n,o)=>t(o,n)},gr}var vr,Rs;function ne(){if(Rs)return vr;Rs=1;const e=bt(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:r}=vt(),{safeRe:n,t:o}=Me(),s=dr(),{compareIdentifiers:i}=$s();class a{constructor(c,l){if(l=s(l),c instanceof a){if(c.loose===!!l.loose&&c.includePrerelease===!!l.includePrerelease)return c;c=c.version}else if(typeof c!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof c}".`);if(c.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",c,l),this.options=l,this.loose=!!l.loose,this.includePrerelease=!!l.includePrerelease;const f=c.trim().match(l.loose?n[o.LOOSE]:n[o.FULL]);if(!f)throw new TypeError(`Invalid Version: ${c}`);if(this.raw=c,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(c){if(e("SemVer.compare",this.version,this.options,c),!(c instanceof a)){if(typeof c=="string"&&c===this.version)return 0;c=new a(c,this.options)}return c.version===this.version?0:this.compareMain(c)||this.comparePre(c)}compareMain(c){return c instanceof a||(c=new a(c,this.options)),i(this.major,c.major)||i(this.minor,c.minor)||i(this.patch,c.patch)}comparePre(c){if(c instanceof a||(c=new a(c,this.options)),this.prerelease.length&&!c.prerelease.length)return-1;if(!this.prerelease.length&&c.prerelease.length)return 1;if(!this.prerelease.length&&!c.prerelease.length)return 0;let l=0;do{const f=this.prerelease[l],m=c.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(c){c instanceof a||(c=new a(c,this.options));let l=0;do{const f=this.build[l],m=c.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(c,l,f){if(c.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(c){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: ${c}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return vr=a,vr}var br,As;function Ze(){if(As)return br;As=1;const e=ne();return br=(r,n,o=!1)=>{if(r instanceof e)return r;try{return new e(r,n)}catch(s){if(!o)return null;throw s}},br}var _r,ws;function Wm(){if(ws)return _r;ws=1;const e=Ze();return _r=(r,n)=>{const o=e(r,n);return o?o.version:null},_r}var Sr,Is;function Gm(){if(Is)return Sr;Is=1;const e=Ze();return Sr=(r,n)=>{const o=e(r.trim().replace(/^[=v]+/,""),n);return o?o.version:null},Sr}var Er,ks;function Xm(){if(ks)return Er;ks=1;const e=ne();return Er=(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}},Er}var yr,Cs;function Hm(){if(Cs)return yr;Cs=1;const e=Ze();return yr=(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,u=a?o:s,c=a?s:o,l=!!u.prerelease.length;if(!!c.prerelease.length&&!l){if(!c.patch&&!c.minor)return"major";if(c.compareMain(u)===0)return c.minor&&!c.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"},yr}var $r,Ps;function Ym(){if(Ps)return $r;Ps=1;const e=ne();return $r=(r,n)=>new e(r,n).major,$r}var Rr,Os;function Km(){if(Os)return Rr;Os=1;const e=ne();return Rr=(r,n)=>new e(r,n).minor,Rr}var Ar,Ns;function Qm(){if(Ns)return Ar;Ns=1;const e=ne();return Ar=(r,n)=>new e(r,n).patch,Ar}var wr,zs;function ed(){if(zs)return wr;zs=1;const e=Ze();return wr=(r,n)=>{const o=e(r,n);return o&&o.prerelease.length?o.prerelease:null},wr}var Ir,Ls;function ue(){if(Ls)return Ir;Ls=1;const e=ne();return Ir=(r,n,o)=>new e(r,o).compare(new e(n,o)),Ir}var kr,Ts;function td(){if(Ts)return kr;Ts=1;const e=ue();return kr=(r,n,o)=>e(n,r,o),kr}var Cr,Zs;function rd(){if(Zs)return Cr;Zs=1;const e=ue();return Cr=(r,n)=>e(r,n,!0),Cr}var Pr,xs;function Or(){if(xs)return Pr;xs=1;const e=ne();return Pr=(r,n,o)=>{const s=new e(r,o),i=new e(n,o);return s.compare(i)||s.compareBuild(i)},Pr}var Nr,qs;function nd(){if(qs)return Nr;qs=1;const e=Or();return Nr=(r,n)=>r.sort((o,s)=>e(o,s,n)),Nr}var zr,js;function od(){if(js)return zr;js=1;const e=Or();return zr=(r,n)=>r.sort((o,s)=>e(s,o,n)),zr}var Lr,Ds;function _t(){if(Ds)return Lr;Ds=1;const e=ue();return Lr=(r,n,o)=>e(r,n,o)>0,Lr}var Tr,Us;function Zr(){if(Us)return Tr;Us=1;const e=ue();return Tr=(r,n,o)=>e(r,n,o)<0,Tr}var xr,Bs;function Vs(){if(Bs)return xr;Bs=1;const e=ue();return xr=(r,n,o)=>e(r,n,o)===0,xr}var qr,Fs;function Js(){if(Fs)return qr;Fs=1;const e=ue();return qr=(r,n,o)=>e(r,n,o)!==0,qr}var jr,Ms;function Dr(){if(Ms)return jr;Ms=1;const e=ue();return jr=(r,n,o)=>e(r,n,o)>=0,jr}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 Xs(){if(Gs)return Vr;Gs=1;const e=Vs(),t=Js(),r=_t(),n=Dr(),o=Zr(),s=Br();return Vr=(a,u,c,l)=>{switch(u){case"===":return typeof a=="object"&&(a=a.version),typeof c=="object"&&(c=c.version),a===c;case"!==":return typeof a=="object"&&(a=a.version),typeof c=="object"&&(c=c.version),a!==c;case"":case"=":case"==":return e(a,c,l);case"!=":return t(a,c,l);case">":return r(a,c,l);case">=":return n(a,c,l);case"<":return o(a,c,l);case"<=":return s(a,c,l);default:throw new TypeError(`Invalid operator: ${u}`)}},Vr}var Fr,Hs;function sd(){if(Hs)return Fr;Hs=1;const e=ne(),t=Ze(),{safeRe:r,t:n}=Me();return Fr=(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 u=a[2],c=a[3]||"0",l=a[4]||"0",f=i.includePrerelease&&a[5]?`-${a[5]}`:"",m=i.includePrerelease&&a[6]?`+${a[6]}`:"";return t(`${u}.${c}.${l}${f}${m}`,i)},Fr}var Jr,Ys;function id(){if(Ys)return Jr;Ys=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 Jr=e,Jr}var Mr,Ks;function le(){if(Ks)return Mr;Ks=1;const e=/\s+/g;class t{constructor(_,I){if(I=o(I),_ instanceof t)return _.loose===!!I.loose&&_.includePrerelease===!!I.includePrerelease?_:new t(_.raw,I);if(_ instanceof s)return this.raw=_.value,this.set=[[_]],this.formatted=void 0,this;if(this.options=I,this.loose=!!I.loose,this.includePrerelease=!!I.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(k=>!b(k[0])),this.set.length===0)this.set=[R];else if(this.set.length>1){for(const k of this.set)if(k.length===1&&O(k[0])){this.set=[k];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let _=0;_<this.set.length;_++){_>0&&(this.formatted+="||");const I=this.set[_];for(let R=0;R<I.length;R++)R>0&&(this.formatted+=" "),this.formatted+=I[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))+":"+_,k=n.get(R);if(k)return k;const A=this.options.loose,N=A?u[c.HYPHENRANGELOOSE]:u[c.HYPHENRANGE];_=_.replace(N,pn(this.options.includePrerelease)),i("hyphen replace",_),_=_.replace(u[c.COMPARATORTRIM],l),i("comparator trim",_),_=_.replace(u[c.TILDETRIM],f),i("tilde trim",_),_=_.replace(u[c.CARETTRIM],m),i("caret trim",_);let j=_.split(" ").map(ee=>K(ee,this.options)).join(" ").split(/\s+/).map(ee=>ln(ee,this.options));A&&(j=j.filter(ee=>(i("loose invalid filter",ee,this.options),!!ee.match(u[c.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(_,I){if(!(_ instanceof t))throw new TypeError("a Range is required");return this.set.some(R=>q(R,I)&&_.set.some(k=>q(k,I)&&R.every(A=>k.every(N=>A.intersects(N,I)))))}test(_){if(!_)return!1;if(typeof _=="string")try{_=new a(_,this.options)}catch{return!1}for(let I=0;I<this.set.length;I++)if(hn(this.set[I],_,this.options))return!0;return!1}}Mr=t;const r=id(),n=new r,o=dr(),s=St(),i=bt(),a=ne(),{safeRe:u,t:c,comparatorTrimReplace:l,tildeTrimReplace:f,caretTrimReplace:m}=Me(),{FLAG_INCLUDE_PRERELEASE:g,FLAG_LOOSE:P}=vt(),b=S=>S.value==="<0.0.0-0",O=S=>S.value==="",q=(S,_)=>{let I=!0;const R=S.slice();let k=R.pop();for(;I&&R.length;)I=R.every(A=>k.intersects(A,_)),k=R.pop();return I},K=(S,_)=>(i("comp",S,_),S=W(S,_),i("caret",S),S=B(S,_),i("tildes",S),S=z(S,_),i("xrange",S),S=un(S,_),i("stars",S),S),L=S=>!S||S.toLowerCase()==="x"||S==="*",B=(S,_)=>S.trim().split(/\s+/).map(I=>Q(I,_)).join(" "),Q=(S,_)=>{const I=_.loose?u[c.TILDELOOSE]:u[c.TILDE];return S.replace(I,(R,k,A,N,j)=>{i("tilde",S,R,k,A,N,j);let T;return L(k)?T="":L(A)?T=`>=${k}.0.0 <${+k+1}.0.0-0`:L(N)?T=`>=${k}.${A}.0 <${k}.${+A+1}.0-0`:j?(i("replaceTilde pr",j),T=`>=${k}.${A}.${N}-${j} <${k}.${+A+1}.0-0`):T=`>=${k}.${A}.${N} <${k}.${+A+1}.0-0`,i("tilde return",T),T})},W=(S,_)=>S.trim().split(/\s+/).map(I=>te(I,_)).join(" "),te=(S,_)=>{i("caret",S,_);const I=_.loose?u[c.CARETLOOSE]:u[c.CARET],R=_.includePrerelease?"-0":"";return S.replace(I,(k,A,N,j,T)=>{i("caret",S,k,A,N,j,T);let F;return L(A)?F="":L(N)?F=`>=${A}.0.0${R} <${+A+1}.0.0-0`:L(j)?A==="0"?F=`>=${A}.${N}.0${R} <${A}.${+N+1}.0-0`:F=`>=${A}.${N}.0${R} <${+A+1}.0.0-0`:T?(i("replaceCaret pr",T),A==="0"?N==="0"?F=`>=${A}.${N}.${j}-${T} <${A}.${N}.${+j+1}-0`:F=`>=${A}.${N}.${j}-${T} <${A}.${+N+1}.0-0`:F=`>=${A}.${N}.${j}-${T} <${+A+1}.0.0-0`):(i("no pr"),A==="0"?N==="0"?F=`>=${A}.${N}.${j}${R} <${A}.${N}.${+j+1}-0`:F=`>=${A}.${N}.${j}${R} <${A}.${+N+1}.0-0`:F=`>=${A}.${N}.${j} <${+A+1}.0.0-0`),i("caret return",F),F})},z=(S,_)=>(i("replaceXRanges",S,_),S.split(/\s+/).map(I=>We(I,_)).join(" ")),We=(S,_)=>{S=S.trim();const I=_.loose?u[c.XRANGELOOSE]:u[c.XRANGE];return S.replace(I,(R,k,A,N,j,T)=>{i("xRange",S,R,k,A,N,j,T);const F=L(A),oe=F||L(N),ee=oe||L(j),Ge=ee;return k==="="&&Ge&&(k=""),T=_.includePrerelease?"-0":"",F?k===">"||k==="<"?R="<0.0.0-0":R="*":k&&Ge?(oe&&(N=0),j=0,k===">"?(k=">=",oe?(A=+A+1,N=0,j=0):(N=+N+1,j=0)):k==="<="&&(k="<",oe?A=+A+1:N=+N+1),k==="<"&&(T="-0"),R=`${k+A}.${N}.${j}${T}`):oe?R=`>=${A}.0.0${T} <${+A+1}.0.0-0`:ee&&(R=`>=${A}.${N}.0${T} <${A}.${+N+1}.0-0`),i("xRange return",R),R})},un=(S,_)=>(i("replaceStars",S,_),S.trim().replace(u[c.STAR],"")),ln=(S,_)=>(i("replaceGTE0",S,_),S.trim().replace(u[_.includePrerelease?c.GTE0PRE:c.GTE0],"")),pn=S=>(_,I,R,k,A,N,j,T,F,oe,ee,Ge)=>(L(R)?I="":L(k)?I=`>=${R}.0.0${S?"-0":""}`:L(A)?I=`>=${R}.${k}.0${S?"-0":""}`:N?I=`>=${I}`:I=`>=${I}${S?"-0":""}`,L(F)?T="":L(oe)?T=`<${+F+1}.0.0-0`:L(ee)?T=`<${F}.${+oe+1}.0-0`:Ge?T=`<=${F}.${oe}.${ee}-${Ge}`:S?T=`<${F}.${oe}.${+ee+1}-0`:T=`<=${T}`,`${I} ${T}`.trim()),hn=(S,_,I)=>{for(let R=0;R<S.length;R++)if(!S[R].test(_))return!1;if(_.prerelease.length&&!I.includePrerelease){for(let R=0;R<S.length;R++)if(i(S[R].semver),S[R].semver!==s.ANY&&S[R].semver.prerelease.length>0){const k=S[R].semver;if(k.major===_.major&&k.minor===_.minor&&k.patch===_.patch)return!0}return!1}return!0};return Mr}var Wr,Qs;function St(){if(Qs)return Wr;Qs=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 u(l.value,f).test(this.value):l.operator===""?l.value===""?!0:new u(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(">")))}}Wr=t;const r=dr(),{safeRe:n,t:o}=Me(),s=Xs(),i=bt(),a=ne(),u=le();return Wr}var Gr,ei;function Et(){if(ei)return Gr;ei=1;const e=le();return Gr=(r,n,o)=>{try{n=new e(n,o)}catch{return!1}return n.test(r)},Gr}var Xr,ti;function ad(){if(ti)return Xr;ti=1;const e=le();return Xr=(r,n)=>new e(r,n).set.map(o=>o.map(s=>s.value).join(" ").trim().split(" ")),Xr}var Hr,ri;function cd(){if(ri)return Hr;ri=1;const e=ne(),t=le();return Hr=(n,o,s)=>{let i=null,a=null,u=null;try{u=new t(o,s)}catch{return null}return n.forEach(c=>{u.test(c)&&(!i||a.compare(c)===-1)&&(i=c,a=new e(i,s))}),i},Hr}var Yr,ni;function ud(){if(ni)return Yr;ni=1;const e=ne(),t=le();return Yr=(n,o,s)=>{let i=null,a=null,u=null;try{u=new t(o,s)}catch{return null}return n.forEach(c=>{u.test(c)&&(!i||a.compare(c)===1)&&(i=c,a=new e(i,s))}),i},Yr}var Kr,oi;function ld(){if(oi)return Kr;oi=1;const e=ne(),t=le(),r=_t();return Kr=(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 u=o.set[a];let c=null;u.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">=":(!c||r(f,c))&&(c=f);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${l.operator}`)}}),c&&(!i||r(i,c))&&(i=c)}return i&&o.test(i)?i:null},Kr}var Qr,si;function pd(){if(si)return Qr;si=1;const e=le();return Qr=(r,n)=>{try{return new e(r,n).range||"*"}catch{return null}},Qr}var en,ii;function tn(){if(ii)return en;ii=1;const e=ne(),t=St(),{ANY:r}=t,n=le(),o=Et(),s=_t(),i=Zr(),a=Br(),u=Dr();return en=(l,f,m,g)=>{l=new e(l,g),f=new n(f,g);let P,b,O,q,K;switch(m){case">":P=s,b=a,O=i,q=">",K=">=";break;case"<":P=i,b=u,O=s,q="<",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===q||Q.operator===K||(!W.operator||W.operator===q)&&b(l,W.semver))return!1;if(W.operator===K&&O(l,W.semver))return!1}return!0},en}var rn,ai;function hd(){if(ai)return rn;ai=1;const e=tn();return rn=(r,n,o)=>e(r,n,">",o),rn}var nn,ci;function fd(){if(ci)return nn;ci=1;const e=tn();return nn=(r,n,o)=>e(r,n,"<",o),nn}var on,ui;function md(){if(ui)return on;ui=1;const e=le();return on=(r,n,o)=>(r=new e(r,o),n=new e(n,o),r.intersects(n,o)),on}var sn,li;function dd(){if(li)return sn;li=1;const e=Et(),t=ue();return sn=(r,n,o)=>{const s=[];let i=null,a=null;const u=r.sort((m,g)=>t(m,g,o));for(const m of u)e(m,n,o)?(a=m,i||(i=m)):(a&&s.push([i,a]),a=null,i=null);i&&s.push([i,null]);const c=[];for(const[m,g]of s)m===g?c.push(m):!g&&m===u[0]?c.push("*"):g?m===u[0]?c.push(`<=${g}`):c.push(`${m} - ${g}`):c.push(`>=${m}`);const l=c.join(" || "),f=typeof n.raw=="string"?n.raw:String(n);return l.length<f.length?l:n},sn}var an,pi;function gd(){if(pi)return an;pi=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 q=u(b,O,g);if(P=P||q!==null,q)continue e}if(P)return!1}return!0},i=[new t(">=0.0.0-0")],a=[new t(">=0.0.0")],u=(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=c(b,z,g):z.operator==="<"||z.operator==="<="?O=l(O,z,g):P.add(z.semver);if(P.size>1)return null;let q;if(b&&O){if(q=o(b.semver,O.semver,g),q>0)return null;if(q===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 We of m)if(!n(z,String(We),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=c(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)&&q!==0)return!1}return!(b&&B&&!O&&q!==0||O&&Q&&!b&&q!==0||te||W)},c=(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 an=s,an}var cn,hi;function vd(){if(hi)return cn;hi=1;const e=Me(),t=vt(),r=ne(),n=$s(),o=Ze(),s=Wm(),i=Gm(),a=Xm(),u=Hm(),c=Ym(),l=Km(),f=Qm(),m=ed(),g=ue(),P=td(),b=rd(),O=Or(),q=nd(),K=od(),L=_t(),B=Zr(),Q=Vs(),W=Js(),te=Dr(),z=Br(),We=Xs(),un=sd(),ln=St(),pn=le(),hn=Et(),S=ad(),_=cd(),I=ud(),R=ld(),k=pd(),A=tn(),N=hd(),j=fd(),T=md(),F=dd(),oe=gd();return cn={parse:o,valid:s,clean:i,inc:a,diff:u,major:c,minor:l,patch:f,prerelease:m,compare:g,rcompare:P,compareLoose:b,compareBuild:O,sort:q,rsort:K,gt:L,lt:B,eq:Q,neq:W,gte:te,lte:z,cmp:We,coerce:un,Comparator:ln,Range:pn,satisfies:hn,toComparators:S,maxSatisfying:_,minSatisfying:I,minVersion:R,validRange:k,outside:A,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},cn}var bd=vd();const _d=(e,t)=>Sd(t)?t.hostnames.includes(new URL(e).hostname):Ed(t)?!!e.match(t.regexp):!1,Sd=e=>cr.safeParse(e).success,Ed=e=>ur.safeParse(e).success,yd=(e,t)=>t?bd.satisfies(e,t):!0,$d=(e,t,r)=>yd(t,r.libraryVersionRange)&&_d(e,r.matcher),Rd=(e,t)=>e.siteRegistrations.filter(r=>$d(t,ar(),r)),Ad=(e,t)=>Rd(e,t).flatMap(({parsers:o,name:s})=>o.filter(i=>gs(i)&&i in ir).map(i=>({parser:ir[i],parserType:i,name:s}))),fi=(e,t)=>{const r=Ad(e,t.url);for(const{parser:n,parserType:o,name:s}of r){const i=n(t);if(ut(i)||xo(i)||qo(i))return{...i,meta:{parserName:s,parserType:o,uri:t.url,referrer:t.url}}}return{...Lo(),meta:{parserName:null,parserType:x.NoResourceFound,uri:t.url,referrer:t.url}}},wd=(e,t)=>{const r=fi(e,t),{uri:n,...o}=r.meta;return{...r,meta:o}},Id=(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`)}},kd=(e,t)=>{const r=Id(e,t);return new URL("/ui/forms/bookmarklet.html",r)},Cd=(e,t,r)=>{const n=fo(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=_o,v.CustomerSchema=xt,v.DirectLinkOnlyResultSchema=Ut,v.Genre=y,v.HostnamesMatcherSchema=cr,v.JournalGenresSchema=Al,v.NON_OPENURL_PROPERTIES=Tt,v.NonOpenUrlPropertiesSchema=Lt,v.NothingParsedResultSchema=Dt,v.OPENURL_KEYS=po,v.OpenUrlAudioVisualResourceSchema=kl,v.OpenUrlBookResourceSchema=wl,v.OpenUrlDocumentResourceSchema=Pl,v.OpenUrlImageResourceSchema=Cl,v.OpenUrlJournalResourceSchema=Il,v.OpenUrlResourceSchema=fe,v.OpenUrlResultSchema=Bt,v.OpenUrlWebpageResourceSchema=Ol,v.PARSERS=ir,v.ParserRegistrySchema=ds,v.ParserType=x,v.ParsingMetadataSchema=qt,v.ParsingMetadataV2Schema=jt,v.ParsingRequestSchema=bo,v.ParsingResponseSchema=$o,v.ParsingResponseV2Schema=Ro,v.ParsingResultSchema=at,v.REGISTRY=Um,v.RegExpMatcherSchema=ur,v.ResourceDataSchema=vs,v.ResourceSchema=ao,v.SiteRegistrationSchema=pr,v.SummonSearchResultSchema=Ft,v.TenantRegion=_e,v.TenantRegistrySchema=xl,v.TenantSchema=Zt,v.UrlMatcherSchema=lr,v.Z3988SearchResultSchema=Vt,v.convertCustomerListToTenantRegistry=Dl,v.createAudioVisual=be,v.createBook=Y,v.createDocument=uo,v.createImage=co,v.createJournal=U,v.createWebpage=it,v.directLinkOnly=Bl,v.fromOpenUrl=go,v.getBaseBookmarkingUrl=kd,v.getLibraryVersion=ar,v.isCustomer=So,v.isCustomerList=Eo,v.isDirectLinkOnlyResult=rh,v.isGenre=Zl,v.isNothingParsedResult=nh,v.isOpenUrlResult=ut,v.isParserRegistry=Bm,v.isParserType=gs,v.isParsingMetadata=eh,v.isParsingMetadataV2=th,v.isParsingRequest=ql,v.isParsingResponse=Kp,v.isParsingResponseV2=Qp,v.isParsingResult=Yp,v.isResourceData=Mm,v.isSiteRegistration=Vm,v.isSummonSearchResult=qo,v.isTenant=yo,v.isTenantRegion=jl,v.isUrlMatcher=Fm,v.isZ3988SearchResult=xo,v.nothingParsed=Z,v.openUrlResource=w,v.parseResource=fi,v.parseResourceV2=wd,v.summonSearchResult=wo,v.toBookmarkingWorkflowUrl=Cd,v.toOpenUrl=fo,v.z3988SearchResult=Ao,Object.defineProperty(v,Symbol.toStringTag,{value:"Module"})}));
|
|
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=Xe,a=!mn.jitless,c=a&&gi.value,l=t.catchall;let f;e._zod.parse=(m,g)=>{f??(f=n.value);const P=m.value;return i(P)?a&&c&&g?.async===!1&&g.jitless!==!0?(s||(s=o(t.shape)),m=s(m,g),l?zn([],P,m,g,f,e):m):r(m,g):(m.issues.push({expected:"object",code:"invalid_type",input:P,inst:e}),m)}});function Ln(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=>ve(i,n,de())))}),t)}const oc=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=>At(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 u of t.options){const c=u._zod.run({value:o.value,issues:[]},s);if(c instanceof Promise)a.push(c),i=!0;else{if(c.issues.length===0)return c;a.push(c)}}return i?Promise.all(a).then(u=>Ln(u,o,e,s)):Ln(a,o,e,s)}}),sc=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(([u,c])=>Tn(r,u,c)):Tn(r,s,i)}});function Pt(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=Pt(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=Pt(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 Tn(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=Pt(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 ic=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 u of i)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){const c=t.valueType._zod.run({value:o[u],issues:[]},n);c instanceof Promise?s.push(c.then(l=>{l.issues.length&&r.issues.push(...Le(u,l.issues)),r.value[u]=l.value})):(c.issues.length&&r.issues.push(...Le(u,c.issues)),r.value[u]=c.value)}let a;for(const u in o)i.has(u)||(a=a??[],a.push(u));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(c=>ve(c,n,de())),input:i,path:[i],inst:e}),r.value[a.value]=a.value;continue}const u=t.valueType._zod.run({value:o[i],issues:[]},n);u instanceof Promise?s.push(u.then(c=>{c.issues.length&&r.issues.push(...Le(i,c.issues)),r.value[a.value]=c.value})):(u.issues.length&&r.issues.push(...Le(i,u.issues)),r.value[a.value]=u.value)}}return s.length?Promise.all(s).then(()=>r):r}}),ac=d("$ZodEnum",(e,t)=>{G.init(e,t);const r=mi(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(o=>vi.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}}),cc=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}}),uc=d("$ZodTransform",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new fn(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 xn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const lc=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(`^(${At(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=>xn(s,r.value)):xn(o,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}}),pc=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(`^(${At(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)}),hc=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=>Zn(s,t)):Zn(o,t)}});function Zn(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const fc=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))}),mc=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=>qn(s,e)):qn(o,e)}});function qn(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 dc=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=>ve(i,n,de()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(s=>ve(s,n,de()))},input:r.value}),r.issues=[]),r)}}),gc=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=>tt(i,t.in,n)):tt(s,t.in,n)}const o=t.in._zod.run(r,n);return o instanceof Promise?o.then(s=>tt(s,t.out,n)):tt(o,t.out,n)}});function tt(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const vc=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(jn):jn(o)}});function jn(e){return e.value=Object.freeze(e.value),e}const bc=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=>Dn(s,r,n,e));Dn(o,r,n,e)}});function Dn(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 _c{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 _c}const rt=Sc();function Ec(e,t){return new e({type:"string",...$(t)})}function yc(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...$(t)})}function Un(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...$(t)})}function $c(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 Ac(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...$(t)})}function wc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...$(t)})}function Bn(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...$(t)})}function Ic(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...$(t)})}function kc(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...$(t)})}function Cc(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...$(t)})}function Pc(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...$(t)})}function Oc(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...$(t)})}function Nc(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...$(t)})}function zc(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...$(t)})}function Lc(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...$(t)})}function Tc(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...$(t)})}function xc(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 qc(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...$(t)})}function jc(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...$(t)})}function Dc(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...$(t)})}function Uc(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...$(t)})}function Bc(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...$(t)})}function Vc(e,t){return new e({type:"string",format:"date",check:"string_format",...$(t)})}function Fc(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...$(t)})}function Jc(e,t){return new e({type:"string",format:"duration",check:"string_format",...$(t)})}function Mc(e,t){return new e({type:"number",checks:[],...$(t)})}function Wc(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...$(t)})}function Gc(e,t){return new e({type:"null",...$(t)})}function Xc(e){return new e({type:"unknown"})}function Hc(e,t){return new e({type:"never",...$(t)})}function Vn(e,t){return new In({check:"less_than",...$(t),value:e,inclusive:!1})}function Ot(e,t){return new In({check:"less_than",...$(t),value:e,inclusive:!0})}function Fn(e,t){return new kn({check:"greater_than",...$(t),value:e,inclusive:!1})}function Nt(e,t){return new kn({check:"greater_than",...$(t),value:e,inclusive:!0})}function Jn(e,t){return new ha({check:"multiple_of",...$(t),value:e})}function Mn(e,t){return new ma({check:"max_length",...$(t),maximum:e})}function nt(e,t){return new da({check:"min_length",...$(t),minimum:e})}function Wn(e,t){return new ga({check:"length_equals",...$(t),length:e})}function Yc(e,t){return new va({check:"string_format",format:"regex",...$(t),pattern:e})}function Kc(e){return new ba({check:"string_format",format:"lowercase",...$(e)})}function Qc(e){return new _a({check:"string_format",format:"uppercase",...$(e)})}function eu(e,t){return new Sa({check:"string_format",format:"includes",...$(t),includes:e})}function tu(e,t){return new Ea({check:"string_format",format:"starts_with",...$(t),prefix:e})}function ru(e,t){return new ya({check:"string_format",format:"ends_with",...$(t),suffix:e})}function qe(e){return new $a({check:"overwrite",tx:e})}function nu(e){return qe(t=>t.normalize(e))}function ou(){return qe(e=>e.trim())}function su(){return qe(e=>e.toLowerCase())}function iu(){return qe(e=>e.toUpperCase())}function au(e,t,r){return new e({type:"array",element:t,...$(r)})}function cu(e,t,r){const n=$(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}function uu(e,t,r){return new e({type:"custom",check:"custom",fn:t,...$(r)})}function lu(e){const t=pu(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 pu(e,t){const r=new se({check:"custom",...$(t)});return r._zod.check=e,r}const hu=d("ZodISODateTime",(e,t)=>{Za.init(e,t),X.init(e,t)});function fu(e){return Bc(hu,e)}const mu=d("ZodISODate",(e,t)=>{qa.init(e,t),X.init(e,t)});function du(e){return Vc(mu,e)}const gu=d("ZodISOTime",(e,t)=>{ja.init(e,t),X.init(e,t)});function vu(e){return Fc(gu,e)}const bu=d("ZodISODuration",(e,t)=>{Da.init(e,t),X.init(e,t)});function _u(e){return Jc(bu,e)}const ae=d("ZodError",(e,t)=>{Sn.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>ki(e,r)},flatten:{value:r=>Ii(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,yt,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,yt,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Su=It(ae),Eu=kt(ae),yu=Ye(ae),$u=Ke(ae),Ru=Oi(ae),Au=Ni(ae),wu=zi(ae),Iu=Li(ae),ku=Ti(ae),Cu=xi(ae),Pu=Zi(ae),Ou=qi(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(Ae(t,{checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]})),e.clone=(r,n)=>ge(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)=>yu(e,r,n),e.parseAsync=async(r,n)=>Eu(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>$u(e,r,n),e.spa=e.safeParseAsync,e.encode=(r,n)=>Ru(e,r,n),e.decode=(r,n)=>Au(e,r,n),e.encodeAsync=async(r,n)=>wu(e,r,n),e.decodeAsync=async(r,n)=>Iu(e,r,n),e.safeEncode=(r,n)=>ku(e,r,n),e.safeDecode=(r,n)=>Cu(e,r,n),e.safeEncodeAsync=async(r,n)=>Pu(e,r,n),e.safeDecodeAsync=async(r,n)=>Ou(e,r,n),e.refine=(r,n)=>e.check(yl(r,n)),e.superRefine=r=>e.check($l(r)),e.overwrite=r=>e.check(qe(r)),e.optional=()=>he(e),e.nullable=()=>no(e),e.nullish=()=>he(no(e)),e.nonoptional=r=>dl(e,r),e.array=()=>D(e),e.or=r=>pe([e,r]),e.and=r=>sl(e,r),e.transform=r=>so(e,ul(r)),e.default=r=>hl(e,r),e.prefault=r=>ml(e,r),e.catch=r=>vl(e,r),e.pipe=r=>so(e,r),e.readonly=()=>Sl(e),e.describe=r=>{const n=e.clone();return rt.add(n,{description:r}),n},Object.defineProperty(e,"description",{get(){return rt.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return rt.get(e);const n=e.clone();return rt.add(n,r[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Gn=d("_ZodString",(e,t)=>{Ct.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(Yc(...n)),e.includes=(...n)=>e.check(eu(...n)),e.startsWith=(...n)=>e.check(tu(...n)),e.endsWith=(...n)=>e.check(ru(...n)),e.min=(...n)=>e.check(nt(...n)),e.max=(...n)=>e.check(Mn(...n)),e.length=(...n)=>e.check(Wn(...n)),e.nonempty=(...n)=>e.check(nt(1,...n)),e.lowercase=n=>e.check(Kc(n)),e.uppercase=n=>e.check(Qc(n)),e.trim=()=>e.check(ou()),e.normalize=(...n)=>e.check(nu(...n)),e.toLowerCase=()=>e.check(su()),e.toUpperCase=()=>e.check(iu())}),Nu=d("ZodString",(e,t)=>{Ct.init(e,t),Gn.init(e,t),e.email=r=>e.check(yc(zu,r)),e.url=r=>e.check(Bn(Hn,r)),e.jwt=r=>e.check(Uc(Xu,r)),e.emoji=r=>e.check(Ic(Tu,r)),e.guid=r=>e.check(Un(Xn,r)),e.uuid=r=>e.check($c(ot,r)),e.uuidv4=r=>e.check(Rc(ot,r)),e.uuidv6=r=>e.check(Ac(ot,r)),e.uuidv7=r=>e.check(wc(ot,r)),e.nanoid=r=>e.check(kc(xu,r)),e.guid=r=>e.check(Un(Xn,r)),e.cuid=r=>e.check(Cc(Zu,r)),e.cuid2=r=>e.check(Pc(qu,r)),e.ulid=r=>e.check(Oc(ju,r)),e.base64=r=>e.check(qc(Mu,r)),e.base64url=r=>e.check(jc(Wu,r)),e.xid=r=>e.check(Nc(Du,r)),e.ksuid=r=>e.check(zc(Uu,r)),e.ipv4=r=>e.check(Lc(Bu,r)),e.ipv6=r=>e.check(Tc(Vu,r)),e.cidrv4=r=>e.check(xc(Fu,r)),e.cidrv6=r=>e.check(Zc(Ju,r)),e.e164=r=>e.check(Dc(Gu,r)),e.datetime=r=>e.check(fu(r)),e.date=r=>e.check(du(r)),e.time=r=>e.check(vu(r)),e.duration=r=>e.check(_u(r))});function p(e){return Ec(Nu,e)}const X=d("ZodStringFormat",(e,t)=>{J.init(e,t),Gn.init(e,t)}),zu=d("ZodEmail",(e,t)=>{ka.init(e,t),X.init(e,t)}),Xn=d("ZodGUID",(e,t)=>{wa.init(e,t),X.init(e,t)}),ot=d("ZodUUID",(e,t)=>{Ia.init(e,t),X.init(e,t)}),Hn=d("ZodURL",(e,t)=>{Ca.init(e,t),X.init(e,t)});function Lu(e){return Bn(Hn,e)}const Tu=d("ZodEmoji",(e,t)=>{Pa.init(e,t),X.init(e,t)}),xu=d("ZodNanoID",(e,t)=>{Oa.init(e,t),X.init(e,t)}),Zu=d("ZodCUID",(e,t)=>{Na.init(e,t),X.init(e,t)}),qu=d("ZodCUID2",(e,t)=>{za.init(e,t),X.init(e,t)}),ju=d("ZodULID",(e,t)=>{La.init(e,t),X.init(e,t)}),Du=d("ZodXID",(e,t)=>{Ta.init(e,t),X.init(e,t)}),Uu=d("ZodKSUID",(e,t)=>{xa.init(e,t),X.init(e,t)}),Bu=d("ZodIPv4",(e,t)=>{Ua.init(e,t),X.init(e,t)}),Vu=d("ZodIPv6",(e,t)=>{Ba.init(e,t),X.init(e,t)}),Fu=d("ZodCIDRv4",(e,t)=>{Va.init(e,t),X.init(e,t)}),Ju=d("ZodCIDRv6",(e,t)=>{Fa.init(e,t),X.init(e,t)}),Mu=d("ZodBase64",(e,t)=>{Ja.init(e,t),X.init(e,t)}),Wu=d("ZodBase64URL",(e,t)=>{Wa.init(e,t),X.init(e,t)}),Gu=d("ZodE164",(e,t)=>{Ga.init(e,t),X.init(e,t)}),Xu=d("ZodJWT",(e,t)=>{Ha.init(e,t),X.init(e,t)}),Yn=d("ZodNumber",(e,t)=>{Pn.init(e,t),H.init(e,t),e.gt=(n,o)=>e.check(Fn(n,o)),e.gte=(n,o)=>e.check(Nt(n,o)),e.min=(n,o)=>e.check(Nt(n,o)),e.lt=(n,o)=>e.check(Vn(n,o)),e.lte=(n,o)=>e.check(Ot(n,o)),e.max=(n,o)=>e.check(Ot(n,o)),e.int=n=>e.check(Qn(n)),e.safe=n=>e.check(Qn(n)),e.positive=n=>e.check(Fn(0,n)),e.nonnegative=n=>e.check(Nt(0,n)),e.negative=n=>e.check(Vn(0,n)),e.nonpositive=n=>e.check(Ot(0,n)),e.multipleOf=(n,o)=>e.check(Jn(n,o)),e.step=(n,o)=>e.check(Jn(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 Kn(e){return Mc(Yn,e)}const Hu=d("ZodNumberFormat",(e,t)=>{Ya.init(e,t),Yn.init(e,t)});function Qn(e){return Wc(Hu,e)}const Yu=d("ZodNull",(e,t)=>{Ka.init(e,t),H.init(e,t)});function st(e){return Gc(Yu,e)}const Ku=d("ZodUnknown",(e,t)=>{Qa.init(e,t),H.init(e,t)});function eo(){return Xc(Ku)}const Qu=d("ZodNever",(e,t)=>{ec.init(e,t),H.init(e,t)});function el(e){return Hc(Qu,e)}const tl=d("ZodArray",(e,t)=>{tc.init(e,t),H.init(e,t),e.element=t.element,e.min=(r,n)=>e.check(nt(r,n)),e.nonempty=r=>e.check(nt(1,r)),e.max=(r,n)=>e.check(Mn(r,n)),e.length=(r,n)=>e.check(Wn(r,n)),e.unwrap=()=>e.element});function D(e,t){return au(tl,e,t)}const rl=d("ZodObject",(e,t)=>{nc.init(e,t),H.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:eo()}),e.loose=()=>e.clone({...e._zod.def,catchall:eo()}),e.strict=()=>e.clone({...e._zod.def,catchall:el()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>yi(e,r),e.safeExtend=r=>$i(e,r),e.merge=r=>Ri(e,r),e.pick=r=>Si(e,r),e.omit=r=>Ei(e,r),e.partial=(...r)=>Ai(ro,e,r[0]),e.required=(...r)=>wi(oo,e,r[0])});function C(e,t){const r={type:"object",shape:e??{},...$(t)};return new rl(r)}const nl=d("ZodUnion",(e,t)=>{oc.init(e,t),H.init(e,t),e.options=t.options});function pe(e,t){return new nl({type:"union",options:e,...$(t)})}const ol=d("ZodIntersection",(e,t)=>{sc.init(e,t),H.init(e,t)});function sl(e,t){return new ol({type:"intersection",left:e,right:t})}const il=d("ZodRecord",(e,t)=>{ic.init(e,t),H.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function to(e,t,r){return new il({type:"record",keyType:e,valueType:t,...$(r)})}const zt=d("ZodEnum",(e,t)=>{ac.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 zt({...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 zt({...t,checks:[],...$(o),entries:s})}});function je(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new zt({type:"enum",entries:r,...$(t)})}const al=d("ZodLiteral",(e,t)=>{cc.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 al({type:"literal",values:Array.isArray(e)?e:[e],...$(t)})}const cl=d("ZodTransform",(e,t)=>{uc.init(e,t),H.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new fn(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 ul(e){return new cl({type:"transform",transform:e})}const ro=d("ZodOptional",(e,t)=>{lc.init(e,t),H.init(e,t),e.unwrap=()=>e._zod.def.innerType});function he(e){return new ro({type:"optional",innerType:e})}const ll=d("ZodNullable",(e,t)=>{pc.init(e,t),H.init(e,t),e.unwrap=()=>e._zod.def.innerType});function no(e){return new ll({type:"nullable",innerType:e})}const pl=d("ZodDefault",(e,t)=>{hc.init(e,t),H.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function hl(e,t){return new pl({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():bn(t)}})}const fl=d("ZodPrefault",(e,t)=>{fc.init(e,t),H.init(e,t),e.unwrap=()=>e._zod.def.innerType});function ml(e,t){return new fl({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():bn(t)}})}const oo=d("ZodNonOptional",(e,t)=>{mc.init(e,t),H.init(e,t),e.unwrap=()=>e._zod.def.innerType});function dl(e,t){return new oo({type:"nonoptional",innerType:e,...$(t)})}const gl=d("ZodCatch",(e,t)=>{dc.init(e,t),H.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function vl(e,t){return new gl({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const bl=d("ZodPipe",(e,t)=>{gc.init(e,t),H.init(e,t),e.in=t.in,e.out=t.out});function so(e,t){return new bl({type:"pipe",in:e,out:t})}const _l=d("ZodReadonly",(e,t)=>{vc.init(e,t),H.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Sl(e){return new _l({type:"readonly",innerType:e})}const io=d("ZodCustom",(e,t)=>{bc.init(e,t),H.init(e,t)});function El(e,t){return cu(io,e??(()=>!0),t)}function yl(e,t={}){return uu(io,e,t)}function $l(e){return lu(e)}var y=(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))(y||{});const Rl=pe([M("book"),M("bookitem"),M("conference"),M("document"),M("report"),M("proceeding"),M("unknown")]),Al=pe([M("article"),M("conference"),M("issue"),M("journal"),M("preprint"),M("proceeding"),M("unknown")]),fe=C({artnum:p(),atitle:p(),aufirst:p(),aulast:p(),auinit:p(),auinit1:p(),auinitm:p(),ausuffix:p(),au:D(p()),aucorp:p(),bici:p(),btitle:p(),chron:p(),coden:p(),date:p(),edition:p(),eissn:p(),epage:p(),externalDBID:p(),externalDocID:p(),genre:je(y),id:p(),isbn:p(),issn:p(),issue:p(),jtitle:p(),pages:p(),part:p(),place:p(),pub:p(),quarter:p(),rft_id:D(p()),series:p(),sici:p(),spage:p(),ssn:p(),stitle:p(),title:p(),tpages:p(),volume:p()}).partial(),Lt=C({bibid:p(),doi:p(),uri:p()}).partial(),wl=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(),Il=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(),kl=fe.pick({au:!0,date:!0,isbn:!0,pub:!0,title:!0}).partial(),Cl=fe.pick({au:!0,date:!0,pub:!0,title:!0}).partial(),Pl=fe.pick({au:!0,date:!0,pub:!0,title:!0,spage:!0,epage:!0}).partial(),Ol=fe.pick({au:!0,date:!0,title:!0}).partial(),ao=C({...fe.shape,...Lt.shape}),Y=(e,t)=>({...t,genre:e}),U=(e,t)=>({...t,genre:e}),be=e=>({...e,genre:y.AudioVisualDocument}),co=e=>({...e,genre:y.Image}),uo=e=>({...e,genre:y.Document}),it=e=>({...e,genre:y.Webpage}),lo=e=>Object.keys(e.shape),po=lo(fe),Tt=lo(Lt),Nl=(e,t,r)=>{if(r.length>0&&typeof r[0]=="string"){const n=t.startsWith("rft_")?t:`rft.${t}`;e.append(n,r[0])}},zl=(e,t,r)=>{e.append(t,r)},Ll=(e,t,r)=>{e.append(`rft.${t}`,r)},ho=e=>Tt.includes(e),fo=e=>{const t=new URLSearchParams;return Object.entries(e).forEach(([r,n])=>{Array.isArray(n)?Nl(t,r,n):typeof n=="string"&&n&&(ho(r)?zl(t,r,n):Ll(t,r,n))}),t},mo=(e,t,r,n)=>{const o=t.getAll(r).filter(s=>!!s).map(s=>s.trim());return o.length===0?e:{...e,[n]:o}},go=e=>{const t=Tl(e),r=(o,s)=>{if(s==="au")return mo(o,t,"rft.au","au");if(s==="rft_id")return mo(o,t,"rft_id","rft_id");const i=ho(s)?s:`rft.${s}`,a=t.get(i);return a?{...o,[s]:a.trim()}:o},n=[...po,...Tt].reduce(r,{});return Object.keys(n).length===0?null:n},Tl=e=>URL.canParse(e)?new URL(e).searchParams:new URLSearchParams(e);function xl(e){return typeof e!="string"?!1:Object.values(y).includes(e)}var _e=(e=>(e.CA="CA",e.EUAPAC="EUAPAC",e))(_e||{});const xt=C({id:p(),name:p(),region:je(_e)}),Zl=C({tenants:D(xt)}),vo=9*1024*1024,bo=C({url:Lu({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(vo,{error:`"html" should be a string with a MAX Length of ${vo}`}),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: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 ql(e){return bo.safeParse(e).success}const Zt=C({name:p(),region:je(_e),apps:to(p(),p())}),_o=to(p(),Zt),So=e=>Zt.safeParse(e).success,Eo=e=>_o.safeParse(e).success;function yo(e){return xt.safeParse(e).success}function jl(e){return typeof e=="string"&&Object.keys(_e).includes(e)}const Dl=e=>{if(!Eo(e))throw new Error("Error: the customer list data is invalid.");return{tenants:Object.entries(e).map(([r,n])=>Ul(r,n))}},Ul=(e,t)=>{if(!So(t))throw new Error(`Invalid customer: ${t}`);const{name:r,region:n}=t,o={id:e,name:r,region:n};if(!yo(o))throw new Error(`Invalid tenant: ${JSON.stringify(o)}`);return o},qt=C({parserType:p(),parserName:p().nullable(),uri:p(),referrer:p()}),jt=C({parserType:p(),parserName:p().nullable(),referrer:p()}),Dt=C({bookmarkingWorkflowUrl:st(),resource:st()}),Ut=C({bookmarkingWorkflowUrl:p(),resource:st()}),Bt=C({bookmarkingWorkflowUrl:st(),resource:ao}),Vt=C({z3988SearchResult:M(!0)}),Ft=C({summonSearchResult:M(!0)}),at=pe([Ut,Dt,Bt,Vt,Ft]),$o=C({meta:qt}).and(at),Ro=C({meta:jt}).and(at);function Bl(e){return{bookmarkingWorkflowUrl:e,resource:null}}function x(){return{bookmarkingWorkflowUrl:null,resource:null}}function w(e){return{bookmarkingWorkflowUrl:null,resource:e}}function Ao(){return{z3988SearchResult:!0}}function wo(){return{summonSearchResult:!0}}const Vl=e=>{const t=e.getAttribute("title");return t?go(t):null},Jt=({document:e})=>{const t=Array.from(e.querySelectorAll(".Z3988"));if(t.length===0)return x();const r=t.map(Vl).find(n=>n!==null);return r?w(r):x()},Fl=e=>{const t=Array.from(e.querySelectorAll(".author > a")).map(r=>r.textContent.trim()).filter(Boolean);return t.length?t:void 0},Jl=e=>e.querySelector("#rpi-attribute-book_details-edition > .rpi-attribute-value > span")?.textContent??void 0,Ml=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},Wl=e=>e.querySelector("#rpi-attribute-book_details-publication_date > .rpi-attribute-value > span")?.textContent??void 0,Gl=e=>e.querySelector("#rpi-attribute-book_details-publisher > .rpi-attribute-value > span")?.textContent??void 0,Xl=e=>e.querySelector("#rpi-attribute-book_details-series > .rpi-attribute-value > a")?.textContent??void 0,Hl=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},Yl=({url:e,document:t})=>{const r=Fl(t),n=Jl(t),o=Ml(t),s=Wl(t),i=Gl(t),a=Xl(t),u=t.getElementById("productTitle")?.textContent.trim()??void 0,c=Hl(t);return{bookmarkingWorkflowUrl:null,resource:Y(y.Book,{au:r,date:s,edition:n,isbn:o,pub:i,series:a,title:u,tpages:c,uri:e})}},me=e=>{if(e)return e.replace(/[^0-9]/g,"")},Io=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),ko=e=>e.querySelector(".article-header")?.querySelector("h1 span")?.textContent.trim(),Co=e=>({date:e?.textContent.match(/\d{4}/)?.[0],pub:"Elsevier Inc."}),Kl=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}},Ql=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(c=>c.trim()),{jtitle:i,volume:a,issue:u}=Kl(e);return w(U(y.Article,{au:Io(e),atitle:ko(e),spage:o,epage:s,date:r,jtitle:i,volume:a,issue:u}))},ep=e=>{const[t,r]=e.querySelectorAll(".source"),{date:n,pub:o}=Co(r),s=e.querySelector(".browse__book-toc"),[i,a]=(s?.querySelector("h1")?.textContent.split(",")??[]).map(u=>u.trim());return w(Y(y.Book,{btitle:i,edition:a,pub:o,au:t.textContent?[t.textContent]:void 0,date:n}))},tp=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}=Co(o);return{edition:r,btitle:n,date:s,pub:i}},rp=e=>{const{edition:t,btitle:r,date:n,pub:o}=tp(e),s=e.querySelector(".article-header .source")?.textContent,i=/(\d+-\d+|[IVXLCDM]+-[IVXLCDM]+)/i,a=s?.match(i),[u,c]=(a?.[1].split("-")??[]).map(l=>l.trim());return w(Y(y.Bookitem,{au:Io(e),atitle:ko(e),btitle:r,edition:t,pub:o,date:n,spage:u,epage:c}))},np=/^[0-9X]$/,Mt=e=>{if(!e)return;let t="";for(const r of e)np.test(r)&&(t+=r);if(t)return t},op=(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=Mt(s.iterateNext()?.textContent);return w({genre:y.Document,title:r,pub:n,date:o,uri:t,isbn:i})},Po=e=>e.querySelector(".browse-toc")??e.querySelector(".browse__journal"),sp=e=>Po(e)?.querySelector("h1")?.firstElementChild?.textContent.trim(),ip=e=>{const t=Po(e),r=t?.querySelector("figure figcaption.source");if(r){const[a,u,c]=r.textContent.split(",").map(l=>l.trim());return{date:a,volume:me(u),issue:me(c)}}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}=ip(e);return w(U(y.Journal,{jtitle:sp(e),date:t,volume:r,issue:n}))};var Oo=(e=>(e.Book="Book",e.Chapter="Book Chapter",e.Article="Full Text Article",e.Journal="Journal",e.Guideline="Guideline",e))(Oo||{});const cp=e=>Object.values(Oo).includes(e),up=(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&&cp(n))return n},lp=({url:e,document:t})=>{switch(up(t,e)){case"Book":return ep(t);case"Book Chapter":return rp(t);case"Full Text Article":return Ql(t);case"Journal":return ap(t);case"Guideline":return op(t,e);case void 0:return x()}},we=C({"@context":p()}),pp=e=>we.safeParse(e).success,No='script[type="application/ld+json"]',zo=e=>Array.from(e.querySelectorAll(No)),ct=e=>e.querySelector(No),De=e=>{const t=e.textContent;if(!t)return null;try{const r=JSON.parse(t);if(pp(r))return r}catch{return null}return null},hp=C({"@id":p(),"@type":p(),author:C({"@id":p()}).optional(),datePublished:p().optional(),dateModified:p().optional(),description:p().optional(),inLanguage:p().optional(),isPartOf:C({"@id":p()}).optional(),name:p().optional(),url:p().optional()}),fp=we.extend({"@graph":D(hp)}),mp=e=>fp.safeParse(e).success,dp=e=>{const t=zo(e);if(t.length===0)return null;const r=t.map(De).filter(mp).map(n=>n["@graph"]);return r.length!==1?null:r[0]},gp=(e,t)=>e.find(r=>r["@type"]===t)??null,vp=(e,t)=>e.find(r=>r["@id"]===t)??null,bp=e=>{const t=gp(e,"WebPage");if(!t)return null;const r=t.author?vp(e,t.author["@id"]):void 0;return it({au:r?.name?[r.name]:void 0,date:t.datePublished,title:t.name})},_p=({document:e})=>{const t=dp(e);return t?{bookmarkingWorkflowUrl:null,resource:bp(t)}:x()},Lo=()=>x(),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()),To=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 w(U(y.Journal,{pub:a,jtitle:t,issn:s,eissn:i}))},yp=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}},$p=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}=yp(e),a=h(e,"name","citation_publisher"),u=h(e,"name","citation_publication_date"),c=h(e,"name","citation_volume"),l=h(e,"name","citation_issue"),f=h(e,"name","citation_firstpage"),m=h(e,"name","citation_lastpage");return w(U(y.Article,{jtitle:t,atitle:r,au:n,doi:o,eissn:s,issn:i,pub:a,date:u,volume:c,issue:l,spage:f,epage:m}))},Rp=({document:e,url:t})=>{switch(Sp(t)){case"journal":return Ep(e);case"article":return $p(e);case void 0:return x()}};var E=(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||{});const Ap=e=>{const t=h(e,"name","pbContext");if(!t)return E.None;const r=To(t);switch(r.has("page")?r.get("page")?.value:null){case"Article/Chapter View":return E.Article;case"Table of Contents":return E.Journal;default:return E.None}},wp=e=>{const t=e.querySelector('meta[property="article:author"]')?.getAttribute("content")?.split(",").map(r=>r.trim());return t&&t.length>0?t:void 0},xo=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},Ip=e=>e.querySelector('span[property="isPartOf"][typeof="PublicationVolume"] > span[property="volumeNumber"]')?.textContent??void 0,kp=e=>e.querySelector('span[property="isPartOf"][typeof="PublicationIssue"] > span[property="issueNumber"]')?.textContent??void 0,Cp=e=>e.querySelector('meta[name="dc.Identifier"][scheme="doi"]')?.getAttribute("content")??void 0,Pp=e=>e.querySelector("h1")?.textContent??void 0,Op=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},Np=e=>{const t=wp(e.document),r=h(e.document,"name","dc.Date"),n=Cp(e.document),o=xo(e.document),s=o.get("issn"),i=o.get("eissn"),a=kp(e.document),u=h(e.document,"name","citation_journal_title"),c=h(e.document,"name","dc.Publisher"),l=h(e.document,"name","dc.Title"),f=Ip(e.document);return U(y.Article,{au:t,date:r,eissn:i,issn:s,issue:a,jtitle:u,pub:c,title:l,volume:f,doi:n})},zp=e=>{const t=xo(e.document),r=t.get("issn"),n=t.get("eissn"),o=Pp(e.document),s=Op(e.document),i=s.get("issue"),a=s.get("volume"),u=s.get("date");return U(y.Journal,{eissn:n,issn:r,jtitle:o,title:o,issue:i,volume:a,date:u})},Lp=e=>{switch(Ap(e.document)){case E.Article:return w(Np(e));case E.Journal:return w(zp(e));default:return x()}},Tp=e=>{const t=h(e,"name","citation_type"),r=h(e,"name","citation_article_type");return t==="JOUR"&&r?E.Article:t==="CHP"?E.Chapter:e.querySelector(".book-edition-year")?.textContent.includes("Book")?E.Book:e.getElementById("journal-title")?E.Journal:E.None},Wt=e=>h(e,"name","citation_doi")??h(e,"name","dc.identifier")??e.querySelector(".doi .anchor-text")?.textContent??void 0,xp=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},Gt=(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: ","")},qp=e=>{const t=e.get("DOI");if(t)return URL.canParse(t)?new URL(t).pathname.substring(1):t},jp=e=>{const t=xp(e),r=h(e,"property","og:title"),n=h(e,"property","og:book:isbn"),o=t.get("Published"),s=Gt(e,".authors-container .author-detail h3"),i=Wt(e)??qp(t);return Y(y.Book,{au:s,date:o,doi:i,isbn:n,title:r})},Dp=e=>{const t=h(e,"property","og:title"),r=h(e,"property","og:book:isbn"),n=h(e,"name","citation_publication_date"),o=Gt(e,".author-group .button-link-text"),s=h(e,"name","citation_firstpage"),i=h(e,"name","citation_lastpage"),a=h(e,"name","citation_publisher"),u=Wt(e),c=h(e,"name","citation_inbook_title")??e.querySelector(".publication-title")?.textContent??void 0;return Y(y.Bookitem,{au:o,btitle:c,date:n,doi:u,epage:i,isbn:r,pub:a,spage:s,title:t})},Up=e=>{const t=h(e,"property","og:title"),r=h(e,"name","citation_issn"),n=h(e,"name","citation_publication_date"),o=Gt(e,".author-group .button-link-text"),s=h(e,"name","citation_publisher"),i=h(e,"name","citation_firstpage"),a=h(e,"name","citation_issue"),u=h(e,"name","citation_volume"),c=Wt(e),l=h(e,"name","citation_journal_title")??e.querySelector(".publication-title")?.textContent??void 0;return U(y.Article,{au:o,jtitle:l,date:n,doi:c,issn:r,issue:a,pub:s,spage:i,title:t,volume:u})},Bp=e=>{const t=e.getElementById("journal-title")?.textContent??void 0,r=Zp(e);return U(y.Journal,{issn:r,title:t})},Vp=({document:e})=>{switch(Tp(e)){case E.Book:return w(jp(e));case E.Chapter:return w(Dp(e));case E.Article:return w(Up(e));case E.Journal:return w(Bp(e));default:return x()}},Fp=e=>{const t=h(e,"name","pbContext");return t&&To(t).has("article")?E.Article:E.Journal},Jp=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},Mp=e=>{const t=e.querySelector(".issue-heading")?.textContent;return t?t.split(",")[0]?.replace("Volume","").trim():void 0},Wp=e=>{const t=e.querySelector(".issue-heading .nav-toc-list")?.textContent;return t?t.replace("Issue","").trim():void 0},Gp=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=Mp(e),u=Wp(e),c=Jp(e),l=c?.includes("-")?c.split("-")[0]:c,f=c?.includes("-")?c.split("-")[1]:c;return U(y.Article,{au:i,jtitle:s,date:n,doi:o,issue:u,pub:r,spage:l,epage:f,title:t,volume:a})},Xp=e=>{const t=h(e,"property","og:title"),r=h(e,"name","publication_doi");return U(y.Journal,{doi:r,title:t})},Hp=({document:e})=>{switch(Fp(e)){case E.Article:return w(Gp(e));case E.Journal:return w(Xp(e));default:return x()}},Yp=e=>at.safeParse(e).success,Kp=e=>$o.safeParse(e).success,Qp=e=>Ro.safeParse(e).success,eh=e=>qt.safeParse(e).success,th=e=>jt.safeParse(e).success;function rh(e){return Ut.safeParse(e).success}function ut(e){return Bt.safeParse(e).success}function Zo(e){return Vt.safeParse(e).success}function qo(e){return Ft.safeParse(e).success}function nh(e){return Dt.safeParse(e).success}const oh=e=>Array.from(e.querySelectorAll("tr th")).find(n=>n.textContent.trim()==="DOI:")?.nextElementSibling?.querySelector('span[property="identifier"]')?.textContent??void 0,sh=e=>{const t=/Record\/(\d+)/.exec(e);if(t&&t.length>1)return t[1]},ih=e=>{const{url:t,document:r}=e,n=Jt(e);if(!ut(n))return n;const o=oh(r);return o&&(n.resource.rft_id=[`info:doi/${o}`]),n.resource.bibid=sh(t),n},ah=we.extend({"@type":M("VideoObject"),name:p(),author:p(),genre:p(),description:p(),uploadDate:p(),duration:p(),thumbnailUrl:D(p())}),ch=e=>ah.safeParse(e).success,uh=e=>{const t=zo(e);if(t.length===0)return null;const r=t.map(De).filter(ch);return r.length!==1?null:r[0]},lh=({url:e,document:t})=>{const r=uh(t);return r?{bookmarkingWorkflowUrl:null,resource:be({au:[r.author],date:r.uploadDate,title:r.name,uri:e})}:x()},jo=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,Do=e=>{const t=e.editor?.map(o=>o.name)??[],n=[...e.author?.map(o=>o.name)??[],...t];if(n.length!==0)return n};var Ue=(e=>(e.Book="Book",e.Journal="Journal",e.Periodical="Periodical",e.PublicationVolume="PublicationVolume",e.ScholarlyArticle="ScholarlyArticle",e.VideoObject="VideoObject",e.WebPage="WebPage",e))(Ue||{}),Se=(e=>(e.Article="article",e.Book="book",e.Paper="Paper",e.Video="video.other",e.Website="website",e))(Se||{}),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 Uo=C({"@type":M(Ue.ScholarlyArticle),author:D(C({"@type":p(),name:p()})).optional(),editor:D(C({"@type":p(),name:p()})).optional(),datePublished:p().optional(),headline:p().optional(),issn:D(p()).optional(),pageStart:p().optional(),pageEnd:p().optional(),isPartOf:C({"@type":pe([p(),D(p())]),name:p(),issn:D(p()).optional(),volumeNumber:p().optional(),isbn:D(p()).optional()}),publisher:C({"@type":p(),name:p()}).optional()}),Bo=e=>Uo.safeParse(e).success,ph=we.extend({"@type":M(Ue.WebPage),mainEntity:Uo}),hh=e=>ph.safeParse(e).success,fh=C({"@type":D(p()),name:p().optional(),issn:D(p()),volumeNumber:p().optional()}),Vo=e=>fh.safeParse(e).success,mh=(e,t)=>h(e,"name","citation_issn")??h(e,"name","prism.issn")??(Bo(t.isPartOf)?t.isPartOf.issn?.[0]:void 0),Fo=(e,t)=>{const r=Do(t),n=h(e,"name","citation_online_date"),o=jo(e),s=h(e,"name","citation_issue"),i=mh(e,t),a=Vo(t.isPartOf)&&t.isPartOf.issn.length>0?t.isPartOf.issn[1]:void 0,u=t.pageStart,c=t.pageEnd,l=t.headline,f=t.isPartOf.name,m=Vo(t.isPartOf)?t.isPartOf.volumeNumber:void 0;return U(y.Article,{au:r,date:n,doi:o,issue:s,eissn:i,issn:a,spage:u,epage:c,atitle:l,jtitle:f,volume:m})},dh=we.extend({"@type":M(Ue.Book),copyrightYear:p().optional(),author:D(C({"@type":p(),name:p()})).optional(),editor:D(C({"@type":p(),name:p()})).optional(),isbn:p().optional(),name:p().optional(),numberOfPages:Kn().optional(),publisher:C({"@type":p(),name:p()}).optional()}),gh=e=>dh.safeParse(e).success,vh=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},bh=(e,t)=>{const r=vh(e),n=Do(t),o=t.copyrightYear?.toString(),s=jo(e)??r.get("DOI"),i=t.name??r.get("Book Title"),a=t.isbn??r.get("Softcover ISBN"),u=t.numberOfPages?.toString()??r.get("Number of Pages"),c=t.publisher?.name??r.get("Publisher");return Y(y.Book,{au:n,date:o,doi:s,title:i,isbn:a,tpages:u,pub:c})},_h=C({"@type":M("Periodical"),name:p(),url:p(),issn:D(p()),editor:D(C({givenName:p(),familyName:p()})),publisher:C({name:p()}),description:p()}),Sh=e=>_h.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 U(y.Journal,{au:t,jtitle:r,eissn:n,issn:o,pub:s})},yh=C({"@type":M(Ue.VideoObject),name:p().optional(),description:p().optional(),thumbnailUrl:p().optional(),uploadDate:p().optional(),contentUrl:p().optional(),duration:p().optional()}),$h=e=>yh.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 be({au:r.length>0?r:void 0,date:n,doi:s,title:o})},Ah=e=>{const t=h(e,"property","og:title");return it({title:t})},wh=(e,t)=>{const r=h(t,"property","og:type");return r===Se.Article&&e.includes(ce.Article)?E.Article:r===Se.Book&&(e.includes(ce.Book)||e.includes(ce.ReferenceWork))?E.Book:r===Se.Paper&&e.includes(ce.Chapter)?E.Chapter:r===Se.Paper&&(e.includes(ce.ReferenceWorkEntry)||e.includes(ce.Protocol))?E.Article:r===Se.Video&&e.includes(ce.Video)?E.AudioVisual:r===Se.Website&&(e.includes(ce.Collections)||e.includes(ce.JournalIssue))?E.Webpage:r===Se.Website&&e.includes(ce.Journal)?E.Journal:E.None},Ih=(e,t,r)=>e===E.AudioVisual&&$h(r)?w(Rh(t,r)):e===E.Book&&gh(r)?w(bh(t,r)):(e===E.Chapter||e===E.Article)&&Bo(r)?w(Fo(t,r)):e===E.Article&&hh(r)?w(Fo(t,r.mainEntity)):e===E.Journal&&Sh(r)?w(Eh(r)):x(),kh=({url:e,document:t})=>{const r=wh(e,t);if(r===E.Webpage)return w(Ah(t));const n=ct(t);if(!n)return x();const o=De(n);return o?Ih(r,t,o):x()},Ch=new Set(["Print ISBN","Online ISBN","DOI","First published","Online ISSN","Print ISSN"]),Jo=(e,t)=>{if(!e)return;const r=e.indexOf(t);return r>-1?e.substring(0,r):e},Xt=e=>{const r=/\d+/.exec(e);if(r?.[0])return r[0]},Ph=e=>{const t=h(e,"property","og:type");return t==="Book"||t==="books.book"?E.Book:t==="Chapter"?E.Chapter:t==="Journal"?E.Journal:t==="Article"?E.Article:E.None},lt=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},Oh=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 Xt(t)},pt=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=Jo(n.textContent,":"),i=Jo(o.textContent,":");!s||!i||Ch.has(s)&&t.set(s,i)}return t},ht=(e,t)=>h(e,"property","books:release_date")??h(e,"name","citation_online_date")??t.get("First published")??void 0,Ht=(e,t)=>h(e,"name","dc.identifier")??h(e,"name","citation_doi")??h(e,"name","publication_doi")??t.get("DOI")??void 0,Mo=(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},Nh=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=Xt(o.textContent)),s.textContent&&(r=Xt(s.textContent))}return{volume:t,issue:r}},zh=e=>{const t=pt(e),r=lt(e),n=h(e,"property","og:title"),o=ht(e,t),s=Ht(e,t),i=Mo(e,t),a=Oh(e);return Y(y.Book,{au:r,date:o,doi:s,isbn:i,pages:a,title:n})},Lh=e=>{const t=pt(e),r=lt(e),n=h(e,"name","citation_book_title"),o=ht(e,t),s=Ht(e,t),i=Mo(e,t),a=h(e,"name","citation_publisher"),u=h(e,"property","og:title");return Y(y.Bookitem,{au:r,btitle:n,date:o,doi:s,isbn:i,pub:a,title:u})},Th=e=>{const t=pt(e),r=lt(e),n=ht(e,t),o=t.get("Online ISSN"),s=t.get("Print ISSN"),i=h(e,"property","og:title"),{volume:a,issue:u}=Nh(e);return U(y.Journal,{au:r,date:n,eissn:o,issn:s,issue:u,title:i,volume:a})},xh=e=>{const t=pt(e),r=lt(e),n=ht(e,t),o=Ht(e,t),s=h(e,"name","citation_issn"),i=h(e,"name","citation_journal_title"),a=h(e,"property","og:title");return U(y.Article,{au:r,date:n,doi:o,issn:s,jtitle:i,title:a})},Zh=({document:e})=>{switch(Ph(e)){case E.Book:return w(zh(e));case E.Chapter:return w(Lh(e));case E.Journal:return w(Th(e));case E.Article:return w(xh(e));default:return x()}},qh=e=>{const t=re(e,"name","citation_author");return t.length>0?t:void 0},jh=({document:e})=>{const t=qh(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=be({au:t,date:r,doi:n,isbn:o,pub:s,title:i});return w(a)},Dh=({document:e})=>Array.from(e.querySelectorAll(".Z3988")).length<=1?x():Ao(),Yt=e=>{if(!(!e||e.length===0))return e[0]};function Wo(e,t){const r=t.map(n=>{const o=e.querySelector(n)?.textContent??null;if(o&&o.trim()!=="")return o}).filter(n=>n);return Yt(r)??null}const Uh=e=>{const t=e.querySelector(".content-meta-data__authors")?.textContent;if(t)return t.split(/,\s+|\s+and\s+/).filter(r=>!!r)},Bh=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},Vh=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},Fh=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([...Vh(e)??[],...Uh(e)??[],...Fh(e)??[],...Bh(e)??[]]);return t.size?[...t]:void 0},ke=(e,t)=>e.querySelector('[data-qa="published-date"]')?.textContent??e.querySelector(".summary-image")?.textContent??Be(t?.get("date"))??Be(t?.get("copyright date"))??Be(t?.get("published date")),Go=e=>{const t=e.find(r=>r.startsWith("https://doi.org/"));if(t)return t.replace("https://doi.org/","")},Xo=e=>{const t=e.get("local identifier");if(t?.length)return Go(t)},Be=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},Ho=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,"")??Be(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}},Jh=e=>{const t=Wo(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},ft=e=>me(e.querySelector('[data-qa="page-count"]')?.textContent),Ve=(e,t)=>e.querySelector(".publisher-link")?.textContent??Be(t?.get("publisher")),Ee=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,ye=e=>{if(!URL.canParse(e))return;const t=new URL(e);return t.origin+t.pathname},Mh=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}},Wh=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,u=i?i[2]:void 0,c=/pp\.\s*\d+-\d+\s*\((\d+)\s*pages\)/.exec(t),l=c?c[1]:void 0;return{issue:s,volume:n,spage:a,epage:u,pages:l}},Gh=e=>{const t=Wo(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 Yt(n)},Xh=(e,t)=>{const r=Ee(e),n=Ie(e),o=ke(e)??Gh(e),s=Ho(e),i=s.jtitle??Jh(e)??void 0,a=s.pub,u=Mh(e),c=Wh(e),l=u.issue??c.issue,f=u.volume??c.volume,m=ft(e)??c.pages,g=c.spage,P=c.epage,b=ye(t),O=Go(Array.from(e.querySelector(".content-meta-data-stables")?.childNodes??[]).map(q=>q.textContent??""));return U(y.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})},Hh=(e,t)=>{const r=Ce(e),n=Ie(e),o=ke(e,r),s=Ee(e),i=Ve(e,r),a=ye(t);return be({au:n,date:o,pub:i,title:s,uri:a})},Yh=(e,t)=>{const r=Ce(e),n=Ie(e),o=Ee(e),s=ke(e),i=ft(e),a=Ve(e,r),u=ye(t),c=Xo(r);return Y(y.Book,{au:n,date:s,doi:c,pages:i,pub:a,title:o,uri:u})},Kh=(e,t)=>{const r=Ce(e),n=Ie(e),o=Ee(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),u=ft(e),c=a.find(m=>m.includes("pp."))?.match(/(\d+)-(\d+)/)??void 0,l=Ve(e,r),f=ye(t);return Y(y.Bookitem,{atitle:o,au:n,btitle:s,date:i,epage:c?.[2],pub:l,pages:u,spage:c?.[1],uri:f})},Qh=(e,t)=>{const r=Ce(e),n=Ie(e),o=Ee(e),s=ke(e),i=ft(e),a=Ve(e,r),u=ye(t),c=Xo(r);return Y(y.Document,{au:n,date:s,doi:c,pages:i,pub:a,title:o,uri:u})},ef=(e,t)=>{const r=Ce(e),n=Ie(e),o=ke(e,r),s=Ee(e),i=ye(t);return co({au:n,date:o,title:s,uri:i})},tf=(e,t)=>{const{pub:r}=Ho(e),n=Ee(e),o=e.querySelector(".eissn")?.textContent.replace(/EISSN\s+/,"").trim()??void 0,s=e.querySelector(".issn")?.textContent.replace(/ISSN\s+/,"").trim()??void 0,i=ye(t);return U(y.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 rf=(e,t)=>{const r=Ce(e),n=Ie(e),o=ke(e,r),s=Ee(e),i=Ve(e,r),a=ye(t);return be({au:n,date:o,pub:i,title:s,uri:a})},nf=e=>Object.values(ie).includes(e),of=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 nf(n)?n:null},sf=(e,t)=>{switch(of(e)){case ie.Article:case ie.Serial:return Xh(e,t);case ie.Audio:return Hh(e,t);case ie.Book:return Yh(e,t);case ie.Chapter:case ie.ResearchReport:return Kh(e,t);case ie.Document:return Qh(e,t);case ie.Image:return ef(e,t);case ie.Journal:return tf(e,t);case ie.Video:return rf(e,t);default:return null}},af=({document:e,url:t})=>{const r=sf(e,t);return r?w(r):x()},Fe=e=>{if(e){if(typeof e=="string")return e;if(e.length>0)return e[0]}else return},Yo=e=>{if(e)return typeof e=="string"?e:Array.isArray(e)?e.length===0?void 0:Fe(e[0].name):Fe(e.name)},mt=(...e)=>{const t=new Set(e.filter(r=>!!r));if(t.size!==0)return[...t]},cf=e=>{const t=Yo(e.mainEntity.creator);return t?[t]:void 0},Je=({lcn:e,title:t})=>({bibid:e,title:t}),uf=(e,t)=>{const r=mt(...(e&&cf(e))??[],...t.authors??[]),n=mt(...t.eissns??[]),o=mt(e?.mainEntity.isbn?Mt(e.mainEntity.isbn):void 0,...t.isbns??[]),s=mt(...e?.mainEntity.issn??[],...t.issns??[]),[i,a]=e?.mainEntity.pagination?.split("-")??[];return{authors:r,date:t.date,doi:Fe(t.dois),edition:e?.mainEntity.edition??t.edition,epage:a,eissn:Fe(n),lcn:t.lcn??e?.identifier.value,isbn:o?.join(","),issn:Fe(s),issue:e?.mainEntity.issueNumber,jtitle:t.jtitle,publisher:t.publisher??Yo(e?.mainEntity.publisher),spage:i,title:e?.name??t.title,volume:e?.mainEntity.volumeNumber}},lf=e=>U(y.Article,{...Je(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}),pf=e=>be({...Je(e),au:e.authors,date:e.date,pub:e.publisher}),hf=e=>Y(y.Book,{...Je(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}),ff=e=>U(y.Journal,{...Je(e),date:e.date,doi:e.doi,eissn:e.eissn,issn:e.issn,pub:e.publisher}),Ko=C({"@type":M("Organization"),name:pe([p(),D(p())])}),Qo=C({"@type":M("Person"),name:pe([p(),D(p())])}),mf=we.extend({identifier:C({"@type":p(),propertyID:p(),value:p()}),mainEntity:C({"@type":p(),"@id":p(),creator:he(pe([p(),Qo,D(Qo)])),edition:he(p()),isbn:he(p()),issn:he(D(p())),issueNumber:he(p()),pagination:he(p()),publisher:he(pe([p(),Ko,D(Ko)])),volumeNumber:he(p())}),name:p()}),df=e=>{const t=ct(e);if(!t)return null;const r=De(t),n=mf.safeParse(r);return n.success?n.data:null},gf=e=>be({...Je(e),au:e.authors,date:e.date,pub:e.publisher}),vf=/([0-9]{4}-[0-9]{1,2}-[0-9]{1,2}|[0-9]{4}-[0-9]{1,2}|[0-9]{4})/,es=/(E?ISBN|E?ISSN|DOI)\s*:\s*/g,Kt=e=>`*:has([title*="${e}" i]) + .item-details-element-container prm-highlight`,bf=e=>{if(!e)return;const t=vf.exec(e);if(t)return t.length>1?t[1]:void 0},_f=e=>{const t=Array.from(e.querySelectorAll(Kt("Identifier"))),r={};return t.map(n=>n.textContent).filter(n=>!!n).forEach(n=>{const o=[];let s;for(;(s=es.exec(n))!==null;)o.push({id:s[1].toLowerCase(),index:s.index,start:es.lastIndex});o.forEach(({id:i,start:a},u)=>{r[i]??=[],r[i].push(n.substring(a,o[u+1]?.index))})}),r},Sf=e=>Array.from(e.querySelectorAll(Kt("Author"))).filter(t=>!!t.textContent&&t.parentElement!==null&&t.parentElement.getAttribute("aria-hidden")!=="true").map(t=>t.textContent.trim()),$e=(e,t)=>e.querySelector(Kt(t))?.textContent.trim(),Ef=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"),u=Sf(e),c=_f(e),[l]=o?.split(",")??[],f=bf(n??t),m=[...c.isbn??[],...c.eisbn??[]].map(g=>Mt(g)).filter(g=>!!g);return{authors:u,date:f,dois:c.doi,edition:r,eissns:c.eissn,isbns:m,issns:c.issn,jtitle:l,lcn:a,publisher:s,title:i}};var ts=(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))(ts||{});const yf=e=>Object.values(ts).includes(e),$f=(e,t)=>{const r=t?.mainEntity["@type"]??e.querySelector(".media-content-type")?.textContent??void 0;if(yf(r))return r},Rf=({document:e})=>{const t=df(e),r=Ef(e),n=uf(t,r);switch($f(e,t)){case"Article":return w(lf(n));case"Book":return w(hf(n));case"Periodical":case"Journal":return w(ff(n));case"Audio CD":case"CreativeWork":return w(pf(n));case"Movie":case"Video":return w(gf(n));default:return x()}},Af=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")?E.Article:o?.startsWith("urn:issn:")?E.Journal:void 0},wf=e=>{const t=h(e,"name","DCTERMS.bibliographicCitation"),[r,n,o,s]=t?.split(",")??[];return{journalTitle:r,volume:n,issue:o,pages:s}},If=e=>{const t=h(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,Cf=e=>{const[t,r]=e?e.trim().split("-"):[void 0,void 0],n=r?.replace(/\(\d+\)/,"").trim();return{spage:t,epage:n}},Pf=e=>{const t=h(e,"name","DCTERMS.issued");if(!t)return;const n=/\d{4}/.exec(t);return n?n[0]:void 0},Of=e=>{const t=h(e,"name","DC.title"),r=h(e,"name","DC.publisher"),n=Pf(e),o=wf(e),s=o.journalTitle?.trim(),i=o.volume?.trim(),a=o.issue?.trim(),u=o.pages?Cf(o.pages):void 0,c=u?.spage,l=u?.epage,f=re(e,"name","DC.creator"),m=If(e);return U(y.Article,{au:f,jtitle:s,date:n,doi:m,issue:a,pub:r,spage:c,epage:l,atitle:t,volume:i})},Nf=e=>{const t=h(e,"name","DC.title"),r=h(e,"name","DC.publisher"),n=kf(e);return U(y.Journal,{issn:n,title:t,pub:r})},zf=({document:e})=>{switch(Af(e)){case E.Article:return w(Of(e));case E.Journal:return w(Nf(e));default:return x()}},Lf=/^\d{4}-\d{3}[\dX]$/i,Tf=e=>Lf.test(e),rs=e=>{const t=e.filter(Tf);return t.length?t:void 0},Qt=e=>{const t=re(e,"name","citation_author");return t.length?t:void 0},er=e=>h(e,"name","citation_publication_date")?.match(/^\d{4}/)?.[0],xf=e=>h(e,"name","citation_doi"),ns=e=>{const t=re(e,"name","citation_isbn");return t.length?t.join(","):void 0},os=e=>rs(re(e,"name","citation_issn")),tr=e=>h(e,"name","citation_journal_title"),rr=e=>h(e,"name","citation_publisher"),dt=e=>h(e,"name","citation_title"),Zf=e=>h(e,"name","citation_doi"),nr=e=>h(e,"name","citation_firstpage"),or=e=>h(e,"name","citation_lastpage"),qf=e=>h(e,"name","citation_issue"),jf=e=>h(e,"name","citation_volume"),Df=e=>U(y.Article,{atitle:dt(e),au:Qt(e),date:er(e),doi:xf(e),issn:os(e)?.[0],issue:qf(e),jtitle:tr(e),pub:rr(e),volume:jf(e),spage:nr(e),epage:or(e)}),Uf=e=>Y(y.Bookitem,{atitle:dt(e),au:Qt(e),btitle:tr(e),date:er(e),isbn:ns(e),pub:rr(e),spage:nr(e),epage:or(e)}),Bf=e=>uo({title:dt(e),au:Qt(e),date:er(e),pub:rr(e),spage:nr(e),epage:or(e)}),ss=e=>!!e.isbn,Vf=e=>!!e.issn||e.type==="Article"&&!!e.journalTitle||!ss(e)&&!!e.journalTitle,Ff=e=>!!e.title,Jf=e=>{const t={type:Zf(e),isbn:ns(e),issn:os(e),journalTitle:tr(e),title:dt(e)};return ss(t)?Uf(e):Vf(t)?Df(e):Ff(t)?Bf(e):null},Mf=({document:e})=>{const t=Jf(e);return t?w(t):x()},Wf=C({"@content":p(),datePublished:p().optional(),mainEntity:C({type:p().optional(),name:p().optional(),author:D(C({name:p()})).optional(),publisher:C({type:p(),name:p()}).optional(),isbn:p().optional()})}),Gf=e=>Wf.safeParse(e).success,Xf=e=>{const t=e.textContent;if(!t)return null;try{const r=JSON.parse(t);if(Gf(r))return r}catch{return null}return null},Hf=({document:e})=>{const t=ct(e);if(!t)return x();const r=Xf(t);if(!r)return x();const n=r.mainEntity.type,o=r.mainEntity.author?.map(c=>c.name),s=r.datePublished?.substring(0,4),i=r.mainEntity.name,a=r.mainEntity.isbn,u=r.mainEntity.publisher?.name;switch(n){case"Book":return w(Y(y.Book,{au:o,date:s,title:i,isbn:a,pub:u}));default:return x()}},Yf=we.extend({"@type":p().optional(),name:p().optional(),copyrightYear:Kn().optional(),author:D(C({name:p()})).optional(),publisher:D(C({name:p()})).optional()}),Kf=e=>Yf.safeParse(e).success,Qf=({document:e,url:t})=>{const r=ct(e);if(!r)return x();const n=De(r);if(!n||!Kf(n))return x();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,u=Yt(n.publisher?.map(l=>l.name)),c=h(e,"property","og:book:isbn");switch(o){case"Book":return w(Y(y.Book,{au:s,date:i,title:a,isbn:c,pub:u,uri:t}));default:return x()}},em=e=>{const t=Array.from(e.querySelectorAll("a[rel=author]")).map(r=>r.textContent.trim()).filter(Boolean);return t.length?t:void 0},tm=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+/,",")},rm=({url:e,document:t})=>{const r=t.querySelector("h3.page-title")?.textContent.trim()??void 0,n=em(t),o=h(t,"property","article:published_time"),s=tm(t),i=Y(y.Book,{au:n,date:o?.substring(0,4),isbn:s,pub:"Milne Open Textbooks",title:r,uri:e});return w(i)},nm=({document:e,url:t})=>{switch(om(t)){case E.Chapter:return w(um(e));case E.Book:return w(lm(e));case E.Article:return w(sm(e));case E.Journal:return w(im(e));default:return x()}},om=e=>{const{pathname:t}=new URL(e);return t.includes("/books/abs/")?E.Chapter:t.includes("/books/")?E.Book:/\/journals\/.+\/article\//.exec(t)!=null?E.Article:t.includes("/journals/")?E.Journal:E.None},sm=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"),u=h(e,"name","citation_publication_date")?.substring(0,4),c=h(e,"name","citation_publisher"),l=is(e),f=rs(re(e,"name","citation_issn"));return U(y.Article,{atitle:t,au:l,jtitle:r,doi:n,volume:o,issue:s,issn:f?.[0],spage:i,epage:a,date:u,pub:c})},im=e=>{const t=am(e),r=cm(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 U(y.Journal,{title:t,issn:s,eissn:i})},am=e=>e.querySelector("h1.title")?.textContent.trim()??void 0,cm=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(),u=n.exec(a);u&&o.push({value:u[1],type:u[2]})}),o},um=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(y.Bookitem,{atitle:t,btitle:r,doi:n,date:o,pub:s})},lm=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=is(e);return Y(y.Book,{title:t,au:i,doi:r,isbn:n,date:o,pub:s})},is=e=>{const t=re(e,"name","citation_author");return t.length?t:void 0},pm=e=>{switch(h(e,"property","og:type")){case"Article":return"Article";case"Journal":return"Journal";default:return}};function hm(e){const t=h(e,"property","og:title"),r=h(e,"name","dc.Publisher"),n=h(e,"name","publication_doi");return w(U(y.Journal,{jtitle:t,pub:r,doi:n}))}function fm(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 w(U(y.Article,{atitle:t,au:r,date:n,doi:o,jtitle:s,pub:i}))}const mm=({document:e})=>{switch(pm(e)){case"Journal":return hm(e);case"Article":return fm(e);default:return x()}},dm=e=>{if(!e)return;const[t,r]=e.trim().split("-");return{spage:t,epage:r}},gm=e=>{const{pathname:t}=new URL(e);if(t.includes("/article/"))return E.Article},vm=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"),u=h(e,"name","DC.Identifier.URI"),c=h(e,"name","DC.Identifier.pageNumber"),l=c?dm(c):void 0,f=l?.spage,m=l?.epage;return U(y.Article,{jtitle:t,atitle:r,au:n,issn:o,date:s,spage:f,epage:m,volume:i,issue:a,uri:u})},bm=({document:e,url:t})=>{switch(gm(t)){case E.Article:return w(vm(e));default:return x()}},_m=e=>{switch(Sm(e)){case"eBook":return"Book";case"Reference":return"Chapter";default:return}},Sm=e=>e.querySelector("#vol-contentType a")?.textContent??void 0;function Em(e,t){const r=as(e),n=sr(e),o=us(e),s=ls(e),i=ps(e),a=hs(e),u=sr(e),c=t,{startPage:l,endPage:f}=fs(e)??{};return w(Y(y.Book,{au:r,btitle:n,date:o,doi:s,epage:f,isbn:i,pub:a,spage:l,title:u,uri:c}))}function ym(e,t){const r=as(e),n=cs(e),o=sr(e),s=us(e),i=ls(e),a=ps(e),u=hs(e),c=cs(e),l=t,{startPage:f,endPage:m}=fs(e)??{};return w(Y(y.Book,{au:r,atitle:n,btitle:o,date:s,doi:i,epage:m,isbn:a,pub:u,spage:f,title:c,uri:l}))}const as=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,$m=e=>h(e,"property","og:title"),sr=e=>Te(e,"titlevalue")??$m(e),cs=e=>Te(e,"chapter-title-squid"),us=e=>Te(e,"pubdate-squid"),ls=e=>Te(e,"doi-squid"),ps=e=>Te(e,"isbn-squid"),hs=e=>Te(e,"pubname-squid"),fs=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]}},Rm=({document:e,url:t})=>{switch(_m(e)){case"Book":return Em(e,t);case"Chapter":return ym(e,t);default:return x()}},Am=(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(),wm=e=>{switch(Am(e,"Medium")){case"book":case"e-book":return y.Book;case"e-journal":return y.Journal;default:return y.Unknown}},Im=e=>{delete e.rft_id},km=e=>{const t=Jt(e);if(ut(t)){const r=wm(e.document);t.resource.genre=r,Im(t.resource)}return t},Cm=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 E.Article;const o=h(e,"name","twitter:title")?.trim(),s=h(e,"name","description")?.trim();if(o||s)return E.Webpage},Pm=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"),u=re(e,"name","citation_author");return U(y.Article,{au:u,jtitle:s,date:n,doi:o,issn:a,pub:r,title:t,volume:i})},Om=(e,t)=>{const r=h(t,"name","twitter:title");return it({uri:e,title:r})},Nm=({url:e,document:t})=>{switch(Cm(t)){case E.Article:return w(Pm(t));case E.Webpage:return w(Om(e,t))}return x()},zm=({document:e})=>Array.from(e.querySelectorAll(".availability.documentSummaryAvailability.availabilityContent")).length<=1?x():wo(),Lm=/([0-9]{4})\s+at/;function Tm(e){if(!e)return;const t=Lm.exec(e);if(t&&t.length>1)return t[1]}function ms(e,t){const r=e.getElementsByClassName(t);if(r.length!==0)return r[0].textContent}function xm(e){const t={};return Array.from(e.getElementsByTagName("li")).reduce((r,n)=>{const o=ms(n,"title"),s=ms(n,"content");return o&&s&&(r[o]=s),r},t)}function Zm(e){const t=e.getElementsByClassName("information");if(t.length===0)return{};const r=xm(t[0]),n=Tm(r.Published),o=r.Show;return{date:n,series:o}}const qm=({url:e,document:t})=>{if(!new URL(e).searchParams.has("i"))return x();const n=y.AudioDocument,o=h(t,"property","og:site_name"),s=h(t,"property","og:title"),i=Zm(t);return w({genre:n,pub:o,title:s,uri:e,...i})},jm=e=>{const t=h(e,"name","citation_date");return t?t.split("/").find(o=>/^\d{4}/.test(o))??void 0:void 0},Dm=e=>{const t=e.querySelector("#arxiv-doi-link")?.textContent;return t?t.replace("https://doi.org/","").trim():void 0},Um=({document:e})=>{const t=h(e,"name","citation_title"),r=h(e,"name","citation_pdf_url"),n=re(e,"name","citation_author"),o=jm(e),s=Dm(e);return!t&&n.length===0&&!o&&!s?x():w(U(y.Article,{au:n,date:o,doi:s,title:t,uri:r}))};var Z=(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))(Z||{});const ir={NoResourceFound:Lo,Z3988:Jt,Z3988SearchResult:Dh,Amazon:Yl,CupOfJo:_p,Jstor:af,Youtube:lh,SagePub:Lp,SageVideo:jh,ScienceDirect:Vp,Springer:kh,TaylorFrancis:Hp,Wiley:Zh,VuFind:ih,ClinicalKey:lp,DOAJ:Rp,Primo:Rf,IngentaConnect:zf,Ebscohost:Mf,OpenStax:Hf,OpenTextbook:Qf,Milne:rm,CambridgeJournalsOnline:nm,AhaJournals:mm,Ijees:bm,BloomsburyCollections:Rm,HeritageCirqa:km,BritishMedicalJournal:Nm,SummonSearchResult:zm,ApplePodcasts:qm,Arxiv:Um},Bm="5.25.0",ar=()=>Bm,Vm=["com.au","com","ca","co.uk","de","fr","nl"].flatMap(e=>[`amazon.${e}`,`www.amazon.${e}`]),Fm={version:ar(),siteRegistrations:[{matcher:{regexp:"^https://[a-z0-9\\-]+\\.on\\.worldcat\\.org/search"},name:"Worldcat Search Results",parsers:[Z.Z3988SearchResult]},{matcher:{regexp:"^https://[a-z0-9\\-]+\\.summon\\.serialssolutions\\.com/"},name:"Summon Search Results",parsers:[Z.SummonSearchResult]},{matcher:{hostnames:["cupofjo.com"]},name:"Cup of Jo",parsers:[Z.CupOfJo]},{matcher:{hostnames:["youtube.com","www.youtube.com"]},name:"Youtube",parsers:[Z.Youtube]},{matcher:{hostnames:["www.sciencedirect.com"]},name:"Science Direct",parsers:[Z.ScienceDirect]},{matcher:{hostnames:Vm},name:"Amazon",parsers:[Z.Amazon]},{matcher:{hostnames:["sagepub.com","www.sagepub.com","journals.sagepub.com"]},name:"Sage Publishing",parsers:[Z.SagePub]},{matcher:{hostnames:["www.tandfonline.com"]},name:"Taylor & Francis",parsers:[Z.TaylorFrancis]},{matcher:{hostnames:["wiley.com","www.wiley.com","onlinelibrary.wiley.com"]},name:"Wiley",parsers:[Z.Wiley]},{matcher:{regexp:"^https://[a-z0-9\\-]+\\.on\\.worldcat\\.org/"},name:"Worldcat",parsers:[Z.Z3988]},{matcher:{hostnames:["catalogue.rau.ac.uk"]},name:"Royal Agricultural University Library",parsers:[Z.Z3988]},{matcher:{hostnames:["link.springer.com"]},name:"Springer",parsers:[Z.Springer]},{matcher:{regexp:"^https://sk\\.sagepub\\.com/video/"},name:"Sage Video",parsers:[Z.SageVideo]},{matcher:{regexp:"^https://vufind\\.lboro\\.ac\\.uk/(Record|PrimoRecord)"},name:"VuFind",parsers:[Z.VuFind]},{matcher:{hostnames:["www.clinicalkey.com","www.clinicalkey.com.au"]},name:"ClinicalKey",parsers:[Z.ClinicalKey]},{matcher:{hostnames:["www.jstor.org"]},name:"JSTOR",parsers:[Z.Jstor]},{matcher:{hostnames:["doaj.org"]},name:"DOAJ",parsers:[Z.DOAJ]},{matcher:{regexp:"/.*ingentaconnect.com/"},name:"IngentaConnect",parsers:[Z.IngentaConnect]},{matcher:{hostnames:["research.ebsco.com"]},name:"EBSCOHost",parsers:[Z.Ebscohost]},{matcher:{hostnames:["openstax.org"]},name:"OpenStax",parsers:[Z.OpenStax]},{matcher:{hostnames:["open.umn.edu"]},name:"OpenTextbook",parsers:[Z.OpenTextbook]},{matcher:{hostnames:["milneopentextbooks.org"]},name:"Milne Open Textbooks",parsers:[Z.Milne]},{matcher:{hostnames:["www.perlego.com"]},name:"Perlego",parsers:[Z.Z3988]},{matcher:{hostnames:["www.ahajournals.org"]},name:"AHA Journals",parsers:[Z.AhaJournals]},{matcher:{hostnames:["www.cambridge.org"]},name:"Cambridge Journals Online",parsers:[Z.CambridgeJournalsOnline]},{matcher:{hostnames:["www.nieindia.org"]},name:"International Journal of Ecology and Environmental Sciences",parsers:[Z.Ijees]},{matcher:{hostnames:["www.bloomsburycollections.com"]},name:"Bloomsbury Collections",parsers:[Z.BloomsburyCollections]},{matcher:{hostnames:["regwem.cirqahosting.com","buddy.cirqahosting.com"]},name:"Heritage Cirqa",parsers:[Z.HeritageCirqa]},{matcher:{hostnames:["www.bmj.com"]},name:"British Medical Journal",parsers:[Z.BritishMedicalJournal]},{matcher:{hostnames:["podcasts.apple.com"]},name:"Apple Podcasts",parsers:[Z.ApplePodcasts]},{matcher:{hostnames:["arxiv.org"]},name:"arxiv",parsers:[Z.Arxiv]}]},cr=C({hostnames:D(p()).min(1)}),ur=C({regexp:p()}),lr=pe([cr,ur]),pr=C({matcher:lr,name:p(),parsers:D(p()),libraryVersionRange:p().optional()}),ds=C({siteRegistrations:D(pr),version:p()}),Jm=e=>ds.safeParse(e).success,Mm=e=>pr.safeParse(e).success,Wm=e=>lr.safeParse(e).success,gs=e=>Object.values(Z).includes(e),Gm=e=>typeof e=="object"&&e!==null,vs=C({url:p(),document:El(Gm)}),Xm=e=>vs.safeParse(e).success;var gt={exports:{}},hr,bs;function vt(){if(bs)return hr;bs=1;const e="2.0.0",t=256,r=Number.MAX_SAFE_INTEGER||9007199254740991,n=16,o=t-6;return hr={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},hr}var fr,_s;function bt(){return _s||(_s=1,fr=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{}),fr}var Ss;function Me(){return Ss||(Ss=1,(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:o}=vt(),s=bt();t=e.exports={};const i=t.re=[],a=t.safeRe=[],u=t.src=[],c=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[q,K]of g)O=O.split(`${q}*`).join(`${q}{0,${K}}`).split(`${q}+`).join(`${q}{1,${K}}`);return O},b=(O,q,K)=>{const L=P(q),B=f++;s(O,B,q),l[O]=B,u[B]=q,c[B]=L,i[B]=new RegExp(q,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",`(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})`),b("MAINVERSIONLOOSE",`(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})`),b("PRERELEASEIDENTIFIER",`(?:${u[l.NONNUMERICIDENTIFIER]}|${u[l.NUMERICIDENTIFIER]})`),b("PRERELEASEIDENTIFIERLOOSE",`(?:${u[l.NONNUMERICIDENTIFIER]}|${u[l.NUMERICIDENTIFIERLOOSE]})`),b("PRERELEASE",`(?:-(${u[l.PRERELEASEIDENTIFIER]}(?:\\.${u[l.PRERELEASEIDENTIFIER]})*))`),b("PRERELEASELOOSE",`(?:-?(${u[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[l.PRERELEASEIDENTIFIERLOOSE]})*))`),b("BUILDIDENTIFIER",`${m}+`),b("BUILD",`(?:\\+(${u[l.BUILDIDENTIFIER]}(?:\\.${u[l.BUILDIDENTIFIER]})*))`),b("FULLPLAIN",`v?${u[l.MAINVERSION]}${u[l.PRERELEASE]}?${u[l.BUILD]}?`),b("FULL",`^${u[l.FULLPLAIN]}$`),b("LOOSEPLAIN",`[v=\\s]*${u[l.MAINVERSIONLOOSE]}${u[l.PRERELEASELOOSE]}?${u[l.BUILD]}?`),b("LOOSE",`^${u[l.LOOSEPLAIN]}$`),b("GTLT","((?:<|>)?=?)"),b("XRANGEIDENTIFIERLOOSE",`${u[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),b("XRANGEIDENTIFIER",`${u[l.NUMERICIDENTIFIER]}|x|X|\\*`),b("XRANGEPLAIN",`[v=\\s]*(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:${u[l.PRERELEASE]})?${u[l.BUILD]}?)?)?`),b("XRANGEPLAINLOOSE",`[v=\\s]*(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:${u[l.PRERELEASELOOSE]})?${u[l.BUILD]}?)?)?`),b("XRANGE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAIN]}$`),b("XRANGELOOSE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAINLOOSE]}$`),b("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),b("COERCE",`${u[l.COERCEPLAIN]}(?:$|[^\\d])`),b("COERCEFULL",u[l.COERCEPLAIN]+`(?:${u[l.PRERELEASE]})?(?:${u[l.BUILD]})?(?:$|[^\\d])`),b("COERCERTL",u[l.COERCE],!0),b("COERCERTLFULL",u[l.COERCEFULL],!0),b("LONETILDE","(?:~>?)"),b("TILDETRIM",`(\\s*)${u[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",b("TILDE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAIN]}$`),b("TILDELOOSE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAINLOOSE]}$`),b("LONECARET","(?:\\^)"),b("CARETTRIM",`(\\s*)${u[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",b("CARET",`^${u[l.LONECARET]}${u[l.XRANGEPLAIN]}$`),b("CARETLOOSE",`^${u[l.LONECARET]}${u[l.XRANGEPLAINLOOSE]}$`),b("COMPARATORLOOSE",`^${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]})$|^$`),b("COMPARATOR",`^${u[l.GTLT]}\\s*(${u[l.FULLPLAIN]})$|^$`),b("COMPARATORTRIM",`(\\s*)${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]}|${u[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",b("HYPHENRANGE",`^\\s*(${u[l.XRANGEPLAIN]})\\s+-\\s+(${u[l.XRANGEPLAIN]})\\s*$`),b("HYPHENRANGELOOSE",`^\\s*(${u[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[l.XRANGEPLAINLOOSE]})\\s*$`),b("STAR","(<|>)?=?\\s*\\*"),b("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),b("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(gt,gt.exports)),gt.exports}var mr,Es;function dr(){if(Es)return mr;Es=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return mr=n=>n?typeof n!="object"?e:n:t,mr}var gr,ys;function $s(){if(ys)return gr;ys=1;const e=/^[0-9]+$/,t=(n,o)=>{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 gr={compareIdentifiers:t,rcompareIdentifiers:(n,o)=>t(o,n)},gr}var vr,Rs;function ne(){if(Rs)return vr;Rs=1;const e=bt(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:r}=vt(),{safeRe:n,t:o}=Me(),s=dr(),{compareIdentifiers:i}=$s();class a{constructor(c,l){if(l=s(l),c instanceof a){if(c.loose===!!l.loose&&c.includePrerelease===!!l.includePrerelease)return c;c=c.version}else if(typeof c!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof c}".`);if(c.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",c,l),this.options=l,this.loose=!!l.loose,this.includePrerelease=!!l.includePrerelease;const f=c.trim().match(l.loose?n[o.LOOSE]:n[o.FULL]);if(!f)throw new TypeError(`Invalid Version: ${c}`);if(this.raw=c,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(c){if(e("SemVer.compare",this.version,this.options,c),!(c instanceof a)){if(typeof c=="string"&&c===this.version)return 0;c=new a(c,this.options)}return c.version===this.version?0:this.compareMain(c)||this.comparePre(c)}compareMain(c){return c instanceof a||(c=new a(c,this.options)),i(this.major,c.major)||i(this.minor,c.minor)||i(this.patch,c.patch)}comparePre(c){if(c instanceof a||(c=new a(c,this.options)),this.prerelease.length&&!c.prerelease.length)return-1;if(!this.prerelease.length&&c.prerelease.length)return 1;if(!this.prerelease.length&&!c.prerelease.length)return 0;let l=0;do{const f=this.prerelease[l],m=c.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(c){c instanceof a||(c=new a(c,this.options));let l=0;do{const f=this.build[l],m=c.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(c,l,f){if(c.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(c){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: ${c}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return vr=a,vr}var br,As;function xe(){if(As)return br;As=1;const e=ne();return br=(r,n,o=!1)=>{if(r instanceof e)return r;try{return new e(r,n)}catch(s){if(!o)return null;throw s}},br}var _r,ws;function Hm(){if(ws)return _r;ws=1;const e=xe();return _r=(r,n)=>{const o=e(r,n);return o?o.version:null},_r}var Sr,Is;function Ym(){if(Is)return Sr;Is=1;const e=xe();return Sr=(r,n)=>{const o=e(r.trim().replace(/^[=v]+/,""),n);return o?o.version:null},Sr}var Er,ks;function Km(){if(ks)return Er;ks=1;const e=ne();return Er=(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}},Er}var yr,Cs;function Qm(){if(Cs)return yr;Cs=1;const e=xe();return yr=(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,u=a?o:s,c=a?s:o,l=!!u.prerelease.length;if(!!c.prerelease.length&&!l){if(!c.patch&&!c.minor)return"major";if(c.compareMain(u)===0)return c.minor&&!c.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"},yr}var $r,Ps;function ed(){if(Ps)return $r;Ps=1;const e=ne();return $r=(r,n)=>new e(r,n).major,$r}var Rr,Os;function td(){if(Os)return Rr;Os=1;const e=ne();return Rr=(r,n)=>new e(r,n).minor,Rr}var Ar,Ns;function rd(){if(Ns)return Ar;Ns=1;const e=ne();return Ar=(r,n)=>new e(r,n).patch,Ar}var wr,zs;function nd(){if(zs)return wr;zs=1;const e=xe();return wr=(r,n)=>{const o=e(r,n);return o&&o.prerelease.length?o.prerelease:null},wr}var Ir,Ls;function ue(){if(Ls)return Ir;Ls=1;const e=ne();return Ir=(r,n,o)=>new e(r,o).compare(new e(n,o)),Ir}var kr,Ts;function od(){if(Ts)return kr;Ts=1;const e=ue();return kr=(r,n,o)=>e(n,r,o),kr}var Cr,xs;function sd(){if(xs)return Cr;xs=1;const e=ue();return Cr=(r,n)=>e(r,n,!0),Cr}var Pr,Zs;function Or(){if(Zs)return Pr;Zs=1;const e=ne();return Pr=(r,n,o)=>{const s=new e(r,o),i=new e(n,o);return s.compare(i)||s.compareBuild(i)},Pr}var Nr,qs;function id(){if(qs)return Nr;qs=1;const e=Or();return Nr=(r,n)=>r.sort((o,s)=>e(o,s,n)),Nr}var zr,js;function ad(){if(js)return zr;js=1;const e=Or();return zr=(r,n)=>r.sort((o,s)=>e(s,o,n)),zr}var Lr,Ds;function _t(){if(Ds)return Lr;Ds=1;const e=ue();return Lr=(r,n,o)=>e(r,n,o)>0,Lr}var Tr,Us;function xr(){if(Us)return Tr;Us=1;const e=ue();return Tr=(r,n,o)=>e(r,n,o)<0,Tr}var Zr,Bs;function Vs(){if(Bs)return Zr;Bs=1;const e=ue();return Zr=(r,n,o)=>e(r,n,o)===0,Zr}var qr,Fs;function Js(){if(Fs)return qr;Fs=1;const e=ue();return qr=(r,n,o)=>e(r,n,o)!==0,qr}var jr,Ms;function Dr(){if(Ms)return jr;Ms=1;const e=ue();return jr=(r,n,o)=>e(r,n,o)>=0,jr}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 Xs(){if(Gs)return Vr;Gs=1;const e=Vs(),t=Js(),r=_t(),n=Dr(),o=xr(),s=Br();return Vr=(a,u,c,l)=>{switch(u){case"===":return typeof a=="object"&&(a=a.version),typeof c=="object"&&(c=c.version),a===c;case"!==":return typeof a=="object"&&(a=a.version),typeof c=="object"&&(c=c.version),a!==c;case"":case"=":case"==":return e(a,c,l);case"!=":return t(a,c,l);case">":return r(a,c,l);case">=":return n(a,c,l);case"<":return o(a,c,l);case"<=":return s(a,c,l);default:throw new TypeError(`Invalid operator: ${u}`)}},Vr}var Fr,Hs;function cd(){if(Hs)return Fr;Hs=1;const e=ne(),t=xe(),{safeRe:r,t:n}=Me();return Fr=(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 u=a[2],c=a[3]||"0",l=a[4]||"0",f=i.includePrerelease&&a[5]?`-${a[5]}`:"",m=i.includePrerelease&&a[6]?`+${a[6]}`:"";return t(`${u}.${c}.${l}${f}${m}`,i)},Fr}var Jr,Ys;function ud(){if(Ys)return Jr;Ys=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 Jr=e,Jr}var Mr,Ks;function le(){if(Ks)return Mr;Ks=1;const e=/\s+/g;class t{constructor(_,I){if(I=o(I),_ instanceof t)return _.loose===!!I.loose&&_.includePrerelease===!!I.includePrerelease?_:new t(_.raw,I);if(_ instanceof s)return this.raw=_.value,this.set=[[_]],this.formatted=void 0,this;if(this.options=I,this.loose=!!I.loose,this.includePrerelease=!!I.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(k=>!b(k[0])),this.set.length===0)this.set=[R];else if(this.set.length>1){for(const k of this.set)if(k.length===1&&O(k[0])){this.set=[k];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let _=0;_<this.set.length;_++){_>0&&(this.formatted+="||");const I=this.set[_];for(let R=0;R<I.length;R++)R>0&&(this.formatted+=" "),this.formatted+=I[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))+":"+_,k=n.get(R);if(k)return k;const A=this.options.loose,N=A?u[c.HYPHENRANGELOOSE]:u[c.HYPHENRANGE];_=_.replace(N,pn(this.options.includePrerelease)),i("hyphen replace",_),_=_.replace(u[c.COMPARATORTRIM],l),i("comparator trim",_),_=_.replace(u[c.TILDETRIM],f),i("tilde trim",_),_=_.replace(u[c.CARETTRIM],m),i("caret trim",_);let j=_.split(" ").map(ee=>K(ee,this.options)).join(" ").split(/\s+/).map(ee=>ln(ee,this.options));A&&(j=j.filter(ee=>(i("loose invalid filter",ee,this.options),!!ee.match(u[c.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(_,I){if(!(_ instanceof t))throw new TypeError("a Range is required");return this.set.some(R=>q(R,I)&&_.set.some(k=>q(k,I)&&R.every(A=>k.every(N=>A.intersects(N,I)))))}test(_){if(!_)return!1;if(typeof _=="string")try{_=new a(_,this.options)}catch{return!1}for(let I=0;I<this.set.length;I++)if(hn(this.set[I],_,this.options))return!0;return!1}}Mr=t;const r=ud(),n=new r,o=dr(),s=St(),i=bt(),a=ne(),{safeRe:u,t:c,comparatorTrimReplace:l,tildeTrimReplace:f,caretTrimReplace:m}=Me(),{FLAG_INCLUDE_PRERELEASE:g,FLAG_LOOSE:P}=vt(),b=S=>S.value==="<0.0.0-0",O=S=>S.value==="",q=(S,_)=>{let I=!0;const R=S.slice();let k=R.pop();for(;I&&R.length;)I=R.every(A=>k.intersects(A,_)),k=R.pop();return I},K=(S,_)=>(i("comp",S,_),S=W(S,_),i("caret",S),S=B(S,_),i("tildes",S),S=z(S,_),i("xrange",S),S=un(S,_),i("stars",S),S),L=S=>!S||S.toLowerCase()==="x"||S==="*",B=(S,_)=>S.trim().split(/\s+/).map(I=>Q(I,_)).join(" "),Q=(S,_)=>{const I=_.loose?u[c.TILDELOOSE]:u[c.TILDE];return S.replace(I,(R,k,A,N,j)=>{i("tilde",S,R,k,A,N,j);let T;return L(k)?T="":L(A)?T=`>=${k}.0.0 <${+k+1}.0.0-0`:L(N)?T=`>=${k}.${A}.0 <${k}.${+A+1}.0-0`:j?(i("replaceTilde pr",j),T=`>=${k}.${A}.${N}-${j} <${k}.${+A+1}.0-0`):T=`>=${k}.${A}.${N} <${k}.${+A+1}.0-0`,i("tilde return",T),T})},W=(S,_)=>S.trim().split(/\s+/).map(I=>te(I,_)).join(" "),te=(S,_)=>{i("caret",S,_);const I=_.loose?u[c.CARETLOOSE]:u[c.CARET],R=_.includePrerelease?"-0":"";return S.replace(I,(k,A,N,j,T)=>{i("caret",S,k,A,N,j,T);let F;return L(A)?F="":L(N)?F=`>=${A}.0.0${R} <${+A+1}.0.0-0`:L(j)?A==="0"?F=`>=${A}.${N}.0${R} <${A}.${+N+1}.0-0`:F=`>=${A}.${N}.0${R} <${+A+1}.0.0-0`:T?(i("replaceCaret pr",T),A==="0"?N==="0"?F=`>=${A}.${N}.${j}-${T} <${A}.${N}.${+j+1}-0`:F=`>=${A}.${N}.${j}-${T} <${A}.${+N+1}.0-0`:F=`>=${A}.${N}.${j}-${T} <${+A+1}.0.0-0`):(i("no pr"),A==="0"?N==="0"?F=`>=${A}.${N}.${j}${R} <${A}.${N}.${+j+1}-0`:F=`>=${A}.${N}.${j}${R} <${A}.${+N+1}.0-0`:F=`>=${A}.${N}.${j} <${+A+1}.0.0-0`),i("caret return",F),F})},z=(S,_)=>(i("replaceXRanges",S,_),S.split(/\s+/).map(I=>We(I,_)).join(" ")),We=(S,_)=>{S=S.trim();const I=_.loose?u[c.XRANGELOOSE]:u[c.XRANGE];return S.replace(I,(R,k,A,N,j,T)=>{i("xRange",S,R,k,A,N,j,T);const F=L(A),oe=F||L(N),ee=oe||L(j),Ge=ee;return k==="="&&Ge&&(k=""),T=_.includePrerelease?"-0":"",F?k===">"||k==="<"?R="<0.0.0-0":R="*":k&&Ge?(oe&&(N=0),j=0,k===">"?(k=">=",oe?(A=+A+1,N=0,j=0):(N=+N+1,j=0)):k==="<="&&(k="<",oe?A=+A+1:N=+N+1),k==="<"&&(T="-0"),R=`${k+A}.${N}.${j}${T}`):oe?R=`>=${A}.0.0${T} <${+A+1}.0.0-0`:ee&&(R=`>=${A}.${N}.0${T} <${A}.${+N+1}.0-0`),i("xRange return",R),R})},un=(S,_)=>(i("replaceStars",S,_),S.trim().replace(u[c.STAR],"")),ln=(S,_)=>(i("replaceGTE0",S,_),S.trim().replace(u[_.includePrerelease?c.GTE0PRE:c.GTE0],"")),pn=S=>(_,I,R,k,A,N,j,T,F,oe,ee,Ge)=>(L(R)?I="":L(k)?I=`>=${R}.0.0${S?"-0":""}`:L(A)?I=`>=${R}.${k}.0${S?"-0":""}`:N?I=`>=${I}`:I=`>=${I}${S?"-0":""}`,L(F)?T="":L(oe)?T=`<${+F+1}.0.0-0`:L(ee)?T=`<${F}.${+oe+1}.0-0`:Ge?T=`<=${F}.${oe}.${ee}-${Ge}`:S?T=`<${F}.${oe}.${+ee+1}-0`:T=`<=${T}`,`${I} ${T}`.trim()),hn=(S,_,I)=>{for(let R=0;R<S.length;R++)if(!S[R].test(_))return!1;if(_.prerelease.length&&!I.includePrerelease){for(let R=0;R<S.length;R++)if(i(S[R].semver),S[R].semver!==s.ANY&&S[R].semver.prerelease.length>0){const k=S[R].semver;if(k.major===_.major&&k.minor===_.minor&&k.patch===_.patch)return!0}return!1}return!0};return Mr}var Wr,Qs;function St(){if(Qs)return Wr;Qs=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 u(l.value,f).test(this.value):l.operator===""?l.value===""?!0:new u(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(">")))}}Wr=t;const r=dr(),{safeRe:n,t:o}=Me(),s=Xs(),i=bt(),a=ne(),u=le();return Wr}var Gr,ei;function Et(){if(ei)return Gr;ei=1;const e=le();return Gr=(r,n,o)=>{try{n=new e(n,o)}catch{return!1}return n.test(r)},Gr}var Xr,ti;function ld(){if(ti)return Xr;ti=1;const e=le();return Xr=(r,n)=>new e(r,n).set.map(o=>o.map(s=>s.value).join(" ").trim().split(" ")),Xr}var Hr,ri;function pd(){if(ri)return Hr;ri=1;const e=ne(),t=le();return Hr=(n,o,s)=>{let i=null,a=null,u=null;try{u=new t(o,s)}catch{return null}return n.forEach(c=>{u.test(c)&&(!i||a.compare(c)===-1)&&(i=c,a=new e(i,s))}),i},Hr}var Yr,ni;function hd(){if(ni)return Yr;ni=1;const e=ne(),t=le();return Yr=(n,o,s)=>{let i=null,a=null,u=null;try{u=new t(o,s)}catch{return null}return n.forEach(c=>{u.test(c)&&(!i||a.compare(c)===1)&&(i=c,a=new e(i,s))}),i},Yr}var Kr,oi;function fd(){if(oi)return Kr;oi=1;const e=ne(),t=le(),r=_t();return Kr=(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 u=o.set[a];let c=null;u.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">=":(!c||r(f,c))&&(c=f);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${l.operator}`)}}),c&&(!i||r(i,c))&&(i=c)}return i&&o.test(i)?i:null},Kr}var Qr,si;function md(){if(si)return Qr;si=1;const e=le();return Qr=(r,n)=>{try{return new e(r,n).range||"*"}catch{return null}},Qr}var en,ii;function tn(){if(ii)return en;ii=1;const e=ne(),t=St(),{ANY:r}=t,n=le(),o=Et(),s=_t(),i=xr(),a=Br(),u=Dr();return en=(l,f,m,g)=>{l=new e(l,g),f=new n(f,g);let P,b,O,q,K;switch(m){case">":P=s,b=a,O=i,q=">",K=">=";break;case"<":P=i,b=u,O=s,q="<",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===q||Q.operator===K||(!W.operator||W.operator===q)&&b(l,W.semver))return!1;if(W.operator===K&&O(l,W.semver))return!1}return!0},en}var rn,ai;function dd(){if(ai)return rn;ai=1;const e=tn();return rn=(r,n,o)=>e(r,n,">",o),rn}var nn,ci;function gd(){if(ci)return nn;ci=1;const e=tn();return nn=(r,n,o)=>e(r,n,"<",o),nn}var on,ui;function vd(){if(ui)return on;ui=1;const e=le();return on=(r,n,o)=>(r=new e(r,o),n=new e(n,o),r.intersects(n,o)),on}var sn,li;function bd(){if(li)return sn;li=1;const e=Et(),t=ue();return sn=(r,n,o)=>{const s=[];let i=null,a=null;const u=r.sort((m,g)=>t(m,g,o));for(const m of u)e(m,n,o)?(a=m,i||(i=m)):(a&&s.push([i,a]),a=null,i=null);i&&s.push([i,null]);const c=[];for(const[m,g]of s)m===g?c.push(m):!g&&m===u[0]?c.push("*"):g?m===u[0]?c.push(`<=${g}`):c.push(`${m} - ${g}`):c.push(`>=${m}`);const l=c.join(" || "),f=typeof n.raw=="string"?n.raw:String(n);return l.length<f.length?l:n},sn}var an,pi;function _d(){if(pi)return an;pi=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 q=u(b,O,g);if(P=P||q!==null,q)continue e}if(P)return!1}return!0},i=[new t(">=0.0.0-0")],a=[new t(">=0.0.0")],u=(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=c(b,z,g):z.operator==="<"||z.operator==="<="?O=l(O,z,g):P.add(z.semver);if(P.size>1)return null;let q;if(b&&O){if(q=o(b.semver,O.semver,g),q>0)return null;if(q===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 We of m)if(!n(z,String(We),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=c(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)&&q!==0)return!1}return!(b&&B&&!O&&q!==0||O&&Q&&!b&&q!==0||te||W)},c=(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 an=s,an}var cn,hi;function Sd(){if(hi)return cn;hi=1;const e=Me(),t=vt(),r=ne(),n=$s(),o=xe(),s=Hm(),i=Ym(),a=Km(),u=Qm(),c=ed(),l=td(),f=rd(),m=nd(),g=ue(),P=od(),b=sd(),O=Or(),q=id(),K=ad(),L=_t(),B=xr(),Q=Vs(),W=Js(),te=Dr(),z=Br(),We=Xs(),un=cd(),ln=St(),pn=le(),hn=Et(),S=ld(),_=pd(),I=hd(),R=fd(),k=md(),A=tn(),N=dd(),j=gd(),T=vd(),F=bd(),oe=_d();return cn={parse:o,valid:s,clean:i,inc:a,diff:u,major:c,minor:l,patch:f,prerelease:m,compare:g,rcompare:P,compareLoose:b,compareBuild:O,sort:q,rsort:K,gt:L,lt:B,eq:Q,neq:W,gte:te,lte:z,cmp:We,coerce:un,Comparator:ln,Range:pn,satisfies:hn,toComparators:S,maxSatisfying:_,minSatisfying:I,minVersion:R,validRange:k,outside:A,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},cn}var Ed=Sd();const yd=(e,t)=>$d(t)?t.hostnames.includes(new URL(e).hostname):Rd(t)?!!e.match(t.regexp):!1,$d=e=>cr.safeParse(e).success,Rd=e=>ur.safeParse(e).success,Ad=(e,t)=>t?Ed.satisfies(e,t):!0,wd=(e,t,r)=>Ad(t,r.libraryVersionRange)&&yd(e,r.matcher),Id=(e,t)=>e.siteRegistrations.filter(r=>wd(t,ar(),r)),kd=(e,t)=>Id(e,t).flatMap(({parsers:o,name:s})=>o.filter(i=>gs(i)&&i in ir).map(i=>({parser:ir[i],parserType:i,name:s}))),fi=(e,t)=>{const r=kd(e,t.url);for(const{parser:n,parserType:o,name:s}of r){const i=n(t);if(ut(i)||Zo(i)||qo(i))return{...i,meta:{parserName:s,parserType:o,uri:t.url,referrer:t.url}}}return{...Lo(),meta:{parserName:null,parserType:Z.NoResourceFound,uri:t.url,referrer:t.url}}},Cd=(e,t)=>{const r=fi(e,t),{uri:n,...o}=r.meta;return{...r,meta:o}},Pd=(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`)}},Od=(e,t)=>{const r=Pd(e,t);return new URL("/ui/forms/bookmarklet.html",r)},Nd=(e,t,r)=>{const n=fo(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=_o,v.CustomerSchema=Zt,v.DirectLinkOnlyResultSchema=Ut,v.Genre=y,v.HostnamesMatcherSchema=cr,v.JournalGenresSchema=Al,v.NON_OPENURL_PROPERTIES=Tt,v.NonOpenUrlPropertiesSchema=Lt,v.NothingParsedResultSchema=Dt,v.OPENURL_KEYS=po,v.OpenUrlAudioVisualResourceSchema=kl,v.OpenUrlBookResourceSchema=wl,v.OpenUrlDocumentResourceSchema=Pl,v.OpenUrlImageResourceSchema=Cl,v.OpenUrlJournalResourceSchema=Il,v.OpenUrlResourceSchema=fe,v.OpenUrlResultSchema=Bt,v.OpenUrlWebpageResourceSchema=Ol,v.PARSERS=ir,v.ParserRegistrySchema=ds,v.ParserType=Z,v.ParsingMetadataSchema=qt,v.ParsingMetadataV2Schema=jt,v.ParsingRequestSchema=bo,v.ParsingResponseSchema=$o,v.ParsingResponseV2Schema=Ro,v.ParsingResultSchema=at,v.REGISTRY=Fm,v.RegExpMatcherSchema=ur,v.ResourceDataSchema=vs,v.ResourceSchema=ao,v.SiteRegistrationSchema=pr,v.SummonSearchResultSchema=Ft,v.TenantRegion=_e,v.TenantRegistrySchema=Zl,v.TenantSchema=xt,v.UrlMatcherSchema=lr,v.Z3988SearchResultSchema=Vt,v.convertCustomerListToTenantRegistry=Dl,v.createAudioVisual=be,v.createBook=Y,v.createDocument=uo,v.createImage=co,v.createJournal=U,v.createWebpage=it,v.directLinkOnly=Bl,v.fromOpenUrl=go,v.getBaseBookmarkingUrl=Od,v.getLibraryVersion=ar,v.isCustomer=So,v.isCustomerList=Eo,v.isDirectLinkOnlyResult=rh,v.isGenre=xl,v.isNothingParsedResult=nh,v.isOpenUrlResult=ut,v.isParserRegistry=Jm,v.isParserType=gs,v.isParsingMetadata=eh,v.isParsingMetadataV2=th,v.isParsingRequest=ql,v.isParsingResponse=Kp,v.isParsingResponseV2=Qp,v.isParsingResult=Yp,v.isResourceData=Xm,v.isSiteRegistration=Mm,v.isSummonSearchResult=qo,v.isTenant=yo,v.isTenantRegion=jl,v.isUrlMatcher=Wm,v.isZ3988SearchResult=Zo,v.nothingParsed=x,v.openUrlResource=w,v.parseResource=fi,v.parseResourceV2=Cd,v.summonSearchResult=wo,v.toBookmarkingWorkflowUrl=Nd,v.toOpenUrl=fo,v.z3988SearchResult=Ao,Object.defineProperty(v,Symbol.toStringTag,{value:"Module"})}));
|