@yamlresume/core 0.12.1 → 0.12.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import {capitalize,startCase,transform,isObject,get,cloneDeep,merge,isArray}from'lodash-es';import Mn from'escape-latex';import jn from'remark-parse';import {unified}from'unified';import gi from'js-beautify';import {z as z$1}from'zod';function De(a,e){if(!a||a.length===0)return e;let n=new Set(e),i=[],r=new Set;for(let o of a)n.has(o)&&!r.has(o)&&(i.push(o),r.add(o));let t=e.filter(o=>!r.has(o));return [...i,...t]}function d(a){return a==null||typeof a=="object"&&Object.keys(a).length===0||typeof a=="string"&&a.trim().length===0}function vn(a,e){return transform(a,(n,i,r)=>{e.includes(r)||(n[r]=isObject(i)?vn(i,e):i);})}function Ke(a,e=new Set,n=new WeakSet){if(a==null)return e;if(typeof a=="object"){if(n.has(a))return e;n.add(a),Array.isArray(a)?a.forEach(i=>{Ke(i,e,n);}):Object.keys(a).forEach(i=>{e.add(i),Ke(a[i],e,n);});}return e}function kr(a){if(d(a))return null;try{let e=new Date(a);return Number.isNaN(e.getTime())?null:e}catch{return null}}function N(a,e){if(a==="")return "";if(/^\d{4}$/.test(a))return a;let n={year:"numeric",month:"short"},i=new Date(a);return Number.isNaN(i.getTime())?a:i.toLocaleDateString(d(e)?"en":e,n)}function He(a,e,n){if(!a)return "";if(!e)switch(n){case "zh-hans":case "zh-hant-hk":case "zh-hant-tw":return `${N(a,n)}\u81F3\u4ECA`;case "es":return `${N(a,n)} hasta la fecha`;case "no":return `${N(a,n)}\u2013N\xE5`;case "nl":return `${N(a,n)}\u2013Huidig`;case "ja":return `${N(a,n)}\uFF5E\u73FE\u5728`;case "de":return `${N(a,n)}\u2013Heute`;case "id":return `${N(a,n)}\u2013Sekarang`;default:return `${N(a,n)}\u2013Present`}let i=n==="ja"?"\uFF5E":"\u2013";return `${N(a,n)}${i}${N(e,n)}`}var Ir=24*60*60;function vr(){return Math.floor(Date.now()/1e3)}function Mr(a,e="en-US"){return new Date(a*1e3).toLocaleDateString(e,{day:"numeric",month:"short",year:"numeric"})}function Ar(a){return Math.floor(a/1e3)}function E(a){let e={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};return a.replace(/[&<>"']/g,n=>e[n])}function V(a){return d(a)?a:Mn(a)}function An(a){return typeof a=="string"&&a.trim().length===0}function b(a,e){return a?e:""}function s(a,e){return b(!d(a),e)}function l(a,e=`
1
+ import {capitalize,startCase,transform,isObject,get,cloneDeep,merge,isArray}from'lodash-es';import Mn from'escape-latex';import jn from'remark-parse';import {unified}from'unified';import gi from'js-beautify';import {z as z$1}from'zod';function De(a,e){if(!a||a.length===0)return e;let n=new Set(e),i=[],r=new Set;for(let o of a)n.has(o)&&!r.has(o)&&(i.push(o),r.add(o));let t=e.filter(o=>!r.has(o));return [...i,...t]}function d(a){return a==null||typeof a=="object"&&Object.keys(a).length===0||typeof a=="string"&&a.trim().length===0}function vn(a,e){return transform(a,(n,i,r)=>{e.includes(r)||(n[r]=isObject(i)?vn(i,e):i);})}function Ke(a,e=new Set,n=new WeakSet){if(a==null)return e;if(typeof a=="object"){if(n.has(a))return e;n.add(a),Array.isArray(a)?a.forEach(i=>{Ke(i,e,n);}):Object.keys(a).forEach(i=>{e.add(i),Ke(a[i],e,n);});}return e}function kr(a){if(d(a))return null;try{let e=new Date(a);return Number.isNaN(e.getTime())?null:e}catch{return null}}function N(a,e){if(a==="")return "";if(/^\d{4}$/.test(a))return a;let n={year:"numeric",month:"short"},i=new Date(a);return Number.isNaN(i.getTime())?a:i.toLocaleDateString(d(e)?"en":e,n)}function He(a,e,n){if(!a)return "";if(!e)switch(n){case "zh-hans":case "zh-hant-hk":case "zh-hant-tw":return `${N(a,n)}\u81F3\u4ECA`;case "es":return `${N(a,n)} hasta la fecha`;case "no":return `${N(a,n)}\u2013N\xE5`;case "nl":return `${N(a,n)}\u2013Heden`;case "ja":return `${N(a,n)}\uFF5E\u73FE\u5728`;case "de":return `${N(a,n)}\u2013Heute`;case "id":return `${N(a,n)}\u2013Sekarang`;default:return `${N(a,n)}\u2013Present`}let i=n==="ja"?"\uFF5E":"\u2013";return `${N(a,n)}${i}${N(e,n)}`}var Ir=24*60*60;function vr(){return Math.floor(Date.now()/1e3)}function Mr(a,e="en-US"){return new Date(a*1e3).toLocaleDateString(e,{day:"numeric",month:"short",year:"numeric"})}function Ar(a){return Math.floor(a/1e3)}function E(a){let e={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};return a.replace(/[&<>"']/g,n=>e[n])}function V(a){return d(a)?a:Mn(a)}function An(a){return typeof a=="string"&&a.trim().length===0}function b(a,e){return a?e:""}function s(a,e){return b(!d(a),e)}function l(a,e=`
2
2
 
3
3
  `){return a.filter(n=>!An(n)).join(e)}function wr(a,e){return d(a)?"":`\`\`\`${e||""}
4
4
  ${a}
@@ -1092,6 +1092,6 @@ ${g}`)])).join(`
1092
1092
 
1093
1093
  `)}`}render(){let e=[this.renderBasics(),this.renderLocation(),this.renderProfiles(),this.renderOrderedSections()];return l(e,`
1094
1094
 
1095
- `)}};var fi={jake:Z,"moderncv-banking":z,"moderncv-classic":ee,"moderncv-casual":Q};function yi(a,e,n=new I){let i=a.layouts?.[e];if(!i)throw new Error(`Layout not found in resume.layouts at index: ${e}.`);if(!i.engine)throw new Error(`Layout engine not found at index: ${e}.`);switch(i.engine){case "html":return new Y(a,e,n);case "markdown":return new ae(a,e,n);case "latex":{let r=i.template;return r?new(get(fi,r,z))(a,e,n):new z(a,e,n)}default:throw new Error(`Unknown engine: ${i.engine}`)}}function Ti(a,e){return l([`${e} option is invalid,`,"it must be one of the following:",`[${a.map(n=>`"${n}"`).join(", ")}].`]," ")}function v(a,e){return z$1.enum(a,{error:n=>n.input===void 0?{message:`${e} option is required.`}:{message:Ti(a,e)}}).meta({title:`${capitalize(e)} option`,description:`A predefined option from the available ${e} choices.`})}var y=(a,e,n)=>z$1.string({message:`${a} is required.`}).min(e,{message:`${a} should be ${e} characters or more.`}).max(n,{message:`${a} should be ${n} characters or less.`}),Ca=v(Je,"country");function k(a){return y(a,4,32).check(e=>{if(e.value.length<4){e.issues=[{code:"too_small",input:e.value,minimum:4,message:`${a} should be 4 characters or more.`,origin:"string"}];return}if(e.value.length>32){e.issues=[{code:"too_big",input:e.value,maximum:32,message:`${a} should be 32 characters or less.`,origin:"string"}];return}Date.parse(e.value)||(e.issues=[{code:"invalid_value",input:e.value,message:`${a} is invalid.`,origin:"string",values:[e.value]}]);}).meta({title:capitalize(startCase(a)),description:"A valid date string that can be parsed by `Date.parse`.",examples:["2025","2025-01-01","Jul 2025","July 3, 2025","2025-02-02T00:00:03.123Z"]})}var Na=v(ta,"degree"),ce=z$1.email({message:"email is invalid."}).meta({id:"email",title:"Email",description:"A valid email address.",examples:["hi@ppresume.com","first.last@company.org","test+tag@domain.co.uk"]}),La=v(oa,"fluency"),wa=z$1.string().meta({title:"Font Family",description:"A comma-separated list of font families to use. The first available font will be used.",example:"Monaco, Helvetica"}),Pa=v(la,"HTML font size"),Ea=v(ca,"HTML template"),B=z$1.array(y("keyword",1,32)).meta({id:"keywords",title:"Keywords",description:"An array of keyword, each between 1 and 32 characters.",examples:[["Javascript","React","Typescript"],["Design","UI","UX"],["Python","Data Science"]]}),xa=v(pa,"language"),Ba=z$1.string().meta({title:"Font Family",description:"A comma-separated list of font families to use. The first available font will be used.",example:"Monaco, Helvetica"}),Ra=v(oe,"LaTeX font size"),$a=v(ua,"LaTeX fontspec numbers"),Ga=v(sa,"LaTeX paper size"),za=v(da,"LaTeX template"),ue=v(ma,"line spacing"),Oa=v(ha,"locale language"),Fa=v(ga,"level"),M=a=>y(a,2,128).meta({title:capitalize(a),description:`A ${a} between 2 and 128 characters.`,examples:["Andy Dufresne","Xiao Hanyu","Jane Smith","Dr. Robert John"]}),ja=v(Sa,"network"),ki=/^[+]?[(]?[0-9\s-]{1,15}[)]?[0-9\s-]{1,15}$/im,de=z$1.string().regex(ki,{message:"phone number may be invalid."}).meta({id:"phone",title:"Phone",description:l(["A valid phone number that may include","country code, parentheses, spaces, and hyphens."]," "),examples:["555-123-4567","+44 20 7946 0958","(555) 123-4567"]}),A=y("summary",16,1024).meta({id:"summary",title:"Summary",description:"A summary text between 16 and 1024 characters.",examples:["Experienced software engineer with 5+ years in full-stack development.",l(["Creative designer passionate about","user experience and modern design principles."]," "),l(["Dedicated project manager with proven track record of","delivering complex projects on time and budget."]," ")]}),w=a=>y(a,2,128).meta({title:capitalize(a),description:"An organization name between 2 and 128 characters.",examples:["Google Inc.","Microsoft Corporation","Startup XYZ","Non-Profit Organization"]}),C=z$1.url({message:"URL is invalid."}).max(256,{message:"URL should be 256 characters or less."}).meta({id:"url",title:"URL",description:"A valid URL with maximum length of 256 characters.",examples:["https://yamlresume.dev","https://ppresume.com","https://github.com/yamlresume/yamlresume","https://linkedin.com/in/xiaohanyu1988","https://www.example.com"]});function m(a){let e={title:`[optional] ${a.meta().title}`,description:`${a.meta().description.replace(/\.$/,"")} or \`null\`.`,examples:a.meta().examples};return a.meta(e).nullish().meta(e)}var Ii=w("awarder").meta({title:"Awarder",description:"The organization or institution that presented the award.",examples:["Academy Awards","Tech Conference","Microsoft Scholarship"]}),vi=M("title").meta({title:"Title",description:"The title of the award.",examples:["Dean's List","Outstanding Student","Best Supporting Engineer"]}),Mi=z$1.object({awarder:Ii,title:vi,date:m(k("date")),summary:m(A)}),Da=z$1.object({awards:z$1.array(Mi).nullish().meta({title:"Awards",description:l(["The awards section contains your achievements and recognitions,","including awards, honors, and special acknowledgments."]," ")})});var Ai=y("headline",2,128).meta({title:"Headline",description:"A short and catchy headline for your resume.",examples:["Full-stack software engineer","Data Scientist with a passion for Machine Learning","Product Manager driving innovation"]}),Ci=z$1.object({name:M("name").describe("Your personal name."),email:m(ce),headline:m(Ai),phone:m(de),summary:m(A),url:m(C)},{error:a=>a.input===void 0?{message:"basics is required."}:{message:a.message}}),Ha=z$1.object({basics:Ci.meta({title:"Basics",description:l(["The basics section contains your personal information,","such as your name, email, phone number, and a brief summary."]," ")})});var Ni=w("issuer").meta({title:"Issuer",description:"The organization that issued the certificate.",examples:["AWS","Microsoft","Coursera","Google Cloud"]}),Li=z$1.object({issuer:Ni,name:M("name").describe("The name of the certificate."),date:m(k("date")),url:m(C)}),Ua=z$1.object({certificates:z$1.array(Li).nullish().meta({title:"Certificates",description:l(["The certificates section contains your professional certifications,","including training programs and industry-recognized credentials."]," ")})});var wi=y("area",2,64).meta({title:"Area",description:"Your field of study or major.",examples:["Computer Science","Business Administration","Engineering","Arts"]}),Pi=z$1.array(y("courses",2,128)).meta({title:"Courses",description:"A list of relevant courses you have taken.",examples:[["Data Structures","Algorithms","Database Systems"],["Marketing","Finance","Operations Management"],["Calculus","Physics","Chemistry"]]}),Ei=w("institution").meta({title:"Institution",description:"The institution that awarded the degree.",examples:["University of California, Los Angeles","Harvard University","Zhejiang University"]}),xi=y("score",2,32).meta({title:"Score",description:"Your GPA, grade, or other academic score.",examples:["3.8","3.8/4.0","A+","95%","First Class Honours"]}),Bi=z$1.object({area:wi,institution:Ei,degree:Na,startDate:k("startDate"),courses:m(Pi),endDate:m(k("endDate")),summary:m(A),score:m(xi),url:m(C)}),Va=z$1.object({education:z$1.array(Bi,{error:a=>a.input===void 0?{message:"education is required."}:{message:a.message}}).meta({title:"Education",description:l(["The education section contains your academic background,","including degrees, institutions, and relevant coursework."]," ")})});var Ri=M("name").describe("The name of the interest."),$i=z$1.object({name:Ri,keywords:m(B)}),_a=z$1.object({interests:z$1.array($i).nullish().meta({title:"Interests",description:l(["The interests section contains your personal interests and hobbies,","including activities and topics you are passionate about."]," ")})});var Gi=z$1.object({fluency:La,language:xa,keywords:m(B)}),Ja=z$1.object({languages:z$1.array(Gi).nullish().meta({title:"Languages",description:l(["The languages section contains your language proficiencies,","including fluency levels and related skills."]," ")})});var zi=y("city",2,64).meta({title:"City",description:"The city where you are located.",examples:["San Francisco","New York","London","Tokyo"]}),Oi=y("address",4,256).meta({title:"Address",description:"Your full address including street, apartment, etc.",examples:["123 Main Street, Apt 4B","456 Oak Avenue","789 Pine Road, Suite 100"]}),Fi=y("postalCode",2,16).meta({title:"Postal Code",description:"Your postal or ZIP code.",examples:["94102","10001","SW1A 1AA","100-0001"]}),ji=y("region",2,64).meta({title:"Region",description:"Your state, province, or region.",examples:["California","New York","England","Tokyo"]}),Di=z$1.object({city:zi,address:m(Oi),country:m(Ca),postalCode:m(Fi),region:m(ji)}),qa=z$1.object({location:Di.nullish().meta({title:"Location",description:l(["The location section contains your geographical information,","such as city, address, country, and postal code."]," ")})});var Ki=y("username",2,64).meta({title:"Username",description:"Your username or handle on the social network.",examples:["john_doe","jane.smith","dev_engineer","designer_123"]}),Hi=z$1.object({network:ja,username:Ki,url:m(C)}),Ya=z$1.object({profiles:z$1.array(Hi).nullish().meta({title:"Profiles",description:l(["The profiles section contains your online presence,","including social media and professional network profiles."]," ")})});var Ui=M("name").describe("The name of the project."),Vi=y("description",4,128).meta({title:"Description",description:"A detailed description of the project and your role.",examples:["Led development of a full-stack web application","Designed and implemented REST API endpoints","Managed team of 5 developers for mobile app development"]}),_i=z$1.object({name:Ui,startDate:k("startDate"),summary:A,description:m(Vi),endDate:m(k("endDate")),keywords:m(B),url:m(C)}),Za=z$1.object({projects:z$1.array(_i).nullish().meta({title:"Projects",description:l(["The projects section contains your personal and professional projects,","including technical details, timelines, and outcomes."]," ")})});var Ji=M("name").describe("The name of the publication."),Wi=w("publisher").meta({title:"Publisher",description:"The organization that published the work.",examples:["ACM","IEEE","Springer","Nature Publishing Group"]}),qi=z$1.object({name:Ji,publisher:Wi,releaseDate:m(k("Release date")),summary:m(A),url:m(C)}),Xa=z$1.object({publications:z$1.array(qi).nullish().meta({title:"Publications",description:l(["The publications section contains your academic and professional publications,","including papers, articles, and research works."]," ")})});var Yi=M("name").describe("The name of the reference."),Zi=y("relationship",2,128).meta({title:"Relationship",description:"Your professional relationship with the reference.",examples:["Former Manager","Colleague","Professor","Client"]}),Xi=z$1.object({name:Yi,summary:A,email:m(ce),phone:m(de),relationship:m(Zi)}),Qa=z$1.object({references:z$1.array(Xi).nullish().meta({title:"References",description:l(["The references section contains your professional references,","including contact information and relationships."]," ")})});var Qi=M("name").describe("The name of the skill."),er=z$1.object({level:Fa,name:Qi,keywords:m(B)}),en=z$1.object({skills:z$1.array(er).nullish().meta({title:"Skills",description:l(["The skills section contains your technical and professional skills,","including proficiency levels and related keywords."]," ")})});var ar=w("organization").meta({title:"Organization",description:"The organization where you volunteered.",examples:["Red Cross","Habitat for Humanity","Local Food Bank","Animal Shelter"]}),nr=y("position",2,64).meta({title:"Position",description:"Your role or position in the volunteer organization.",examples:["Event Coordinator","Tutor","Fundraiser","Board Member"]}),ir=z$1.object({organization:ar,position:nr,startDate:k("startDate"),summary:A,endDate:m(k("endDate")),url:m(C)}),an=z$1.object({volunteer:z$1.array(ir).nullish().meta({title:"Volunteer",description:l(["The volunteer section contains your community service and volunteer work,","including organizations, roles, and contributions."]," ")})});var rr=w("name").meta({title:"Name",description:"The name of the company or organization you worked for.",examples:["Google","Microsoft","Apple","Amazon"]}),tr=y("position",2,64).meta({title:"Position",description:"Your job title or position at the company.",examples:["Software Engineer","Product Manager","Data Scientist","UX Designer"]}),or=z$1.object({name:rr,position:tr,startDate:k("startDate"),summary:A,endDate:m(k("endDate")),keywords:m(B),url:m(C)}),nn=z$1.object({work:z$1.array(or).nullish().meta({title:"Work",description:l(["The work section contains your professional experience,","including job titles, companies, and responsibilities."]," ")})});var $e=z$1.object({content:z$1.object({...Ha.shape,...Va.shape,...Da.shape,...Ua.shape,..._a.shape,...Ja.shape,...qa.shape,...Ya.shape,...Za.shape,...Xa.shape,...Qa.shape,...en.shape,...an.shape,...nn.shape},{error:a=>a.input===void 0?{message:"content is required."}:{message:a.message}})});function lr(a){return l([`invalid ${a} margin size,`,`${a} margin must be a positive number followed by`,'"cm", "pt" or "in", eg: "2.5cm", "1in", "72pt"']," ")}function pe(a){return y(`${a} margin`,2,32).check(e=>{if(e.value.length<2){e.issues=[{code:"too_small",input:e.value,minimum:2,message:`${a} margin should be 2 characters or more.`,origin:"string"}];return}if(e.value.length>32){e.issues=[{code:"too_big",input:e.value,maximum:32,message:`${a} margin should be 32 characters or less.`,origin:"string"}];return}e.value.match(/^\d+(\.\d+)?(cm|pt|in)$/)||(e.issues=[{code:"invalid_value",input:e.value,message:lr(a),origin:"string",values:[e.value]}]);}).meta({title:capitalize(`${a} margin size`),description:l(["A positive number followed by valid units: cm, pt, or in.",'Examples: "2.5cm", "1in", "72pt".']," "),examples:["2.5cm","1in","72pt","0.5cm","12pt"]})}var Ge=z$1.object({margins:z$1.object({top:m(pe("top")),bottom:m(pe("bottom")),left:m(pe("left")),right:m(pe("right"))}).nullish().meta({title:"Margins",description:l(["The margins section contains page margin settings,","including top, bottom, left, and right margins."]," ")})});function P(a){return y(`${a} alias`,2,128).meta({title:a,description:`The name of the alias for ${a} section.`})}var cr=z$1.object({aliases:z$1.object({basics:m(P("basics")),education:m(P("education")),work:m(P("work")),volunteer:m(P("volunteer")),awards:m(P("awards")),certificates:m(P("certificates")),publications:m(P("publications")),skills:m(P("skills")),languages:m(P("languages")),interests:m(P("interests")),references:m(P("references")),projects:m(P("projects"))}).nullish().meta({title:"Aliases",description:"Section alias customization settings."})}),ur=z$1.object({order:z$1.array(v(fa,"section")).nullish().meta({title:"Order",description:"Custom order for sections in the final output."})}),H=z$1.object({sections:z$1.object({...cr.shape,...ur.shape}).nullish().meta({title:"Sections",description:"Section customization settings."})});var on=z$1.object({advanced:z$1.object({showIcons:z$1.boolean().default(true),title:z$1.string().optional(),footer:z$1.string().default('Generated by <a href="https://yamlresume.dev">YAMLResume</a>'),description:z$1.string().optional(),keywords:z$1.string().optional()}).nullish().meta({title:"Advanced",description:l(["The Advanced section contains advanced HTML settings."]," ")})});var sn=z$1.object({template:m(Ea).meta({title:"Template",description:l(["The template section contains the resume template selection,","determining the overall visual style and layout."]," ")})});var cn=z$1.object({typography:z$1.object({fontSize:m(Pa),fontFamily:m(wa),lineSpacing:m(ue)}).nullish().meta({title:"Typography",description:l(["The typography section contains font settings,","including font size and line spacing options for HTML output."]," ")})});var dn=z$1.object({engine:z$1.literal("html"),...sn.shape,...cn.shape,...on.shape,...H.shape}).meta({title:"HTML Engine Layout"});var mn=z$1.object({advanced:z$1.object({fontspec:z$1.object({numbers:m($a)}).nullish(),showIcons:z$1.boolean().default(true)}).nullish().meta({title:"Advanced",description:l(["The Advanced section contains advanced latex settings,","including fontspec package configurations."]," ")})});var mr=z$1.boolean().meta({title:"Show Page Numbers",description:"Whether to show page numbers on the page."}),pn=z$1.object({page:z$1.object({showPageNumbers:m(mr),paperSize:m(Ga),...Ge.shape}).nullish().meta({title:"Page",description:l(["The page section contains page display settings,","including whether to show page numbers and margins."]," ")})});var gn=z$1.object({template:m(za).meta({title:"Template",description:l(["The template section contains the resume template selection,","determining the overall visual style and layout."]," ")})});var gr=z$1.object({links:z$1.object({underline:z$1.boolean().default(false).meta({title:"Underline Links",description:"Whether to underline links in the document.",examples:[false,true]})}).nullish().meta({title:"Typography Links",description:"Link styling settings for typography."})}),hn=z$1.object({typography:z$1.object({fontSize:m(Ra),fontFamily:m(Ba),lineSpacing:m(ue),...gr.shape}).nullish().meta({title:"Typography",description:l(["The typography section contains font settings,","including font size options and link styling."]," ")})});var fn=z$1.object({engine:z$1.literal("latex"),...pn.shape,...gn.shape,...hn.shape,...mn.shape,...H.shape}).meta({title:"LaTeX Engine Layout"});var bn=z$1.object({engine:z$1.literal("markdown"),...H.shape}).meta({title:"Markdown Engine Layout"});var Fe=z$1.object({layouts:z$1.array(z$1.discriminatedUnion("engine",[dn,fn,bn])).nullish().meta({title:"Layouts",description:l(["Multiple output layouts configuration as a discriminated union array,",'supporting engines like "latex", "markdown", and "html".']," ")})});var je=z$1.object({locale:z$1.object({language:m(Oa)}).nullish().meta({title:"Locale",description:l(["Top-level locale language settings,","determining the language used for the resume."]," ")})});var Sr=z$1.object({...$e.shape,...je.shape,...Fe.shape}).meta({$id:"https://yamlresume.dev/schema.json",title:"YAMLResume Schema",description:"JSON Schema for YAMLResume resume format.",version:"0.12.1",license:"MIT",keywords:["Resume","CV","YAML","LaTeX","PDF","YAMLResume","Markdown"]});
1095
+ `)}};var fi={jake:Z,"moderncv-banking":z,"moderncv-classic":ee,"moderncv-casual":Q};function yi(a,e,n=new I){let i=a.layouts?.[e];if(!i)throw new Error(`Layout not found in resume.layouts at index: ${e}.`);if(!i.engine)throw new Error(`Layout engine not found at index: ${e}.`);switch(i.engine){case "html":return new Y(a,e,n);case "markdown":return new ae(a,e,n);case "latex":{let r=i.template;return r?new(get(fi,r,z))(a,e,n):new z(a,e,n)}default:throw new Error(`Unknown engine: ${i.engine}`)}}function Ti(a,e){return l([`${e} option is invalid,`,"it must be one of the following:",`[${a.map(n=>`"${n}"`).join(", ")}].`]," ")}function v(a,e){return z$1.enum(a,{error:n=>n.input===void 0?{message:`${e} option is required.`}:{message:Ti(a,e)}}).meta({title:`${capitalize(e)} option`,description:`A predefined option from the available ${e} choices.`})}var y=(a,e,n)=>z$1.string({message:`${a} is required.`}).min(e,{message:`${a} should be ${e} characters or more.`}).max(n,{message:`${a} should be ${n} characters or less.`}),Ca=v(Je,"country");function k(a){return y(a,4,32).check(e=>{if(e.value.length<4){e.issues=[{code:"too_small",input:e.value,minimum:4,message:`${a} should be 4 characters or more.`,origin:"string"}];return}if(e.value.length>32){e.issues=[{code:"too_big",input:e.value,maximum:32,message:`${a} should be 32 characters or less.`,origin:"string"}];return}Date.parse(e.value)||(e.issues=[{code:"invalid_value",input:e.value,message:`${a} is invalid.`,origin:"string",values:[e.value]}]);}).meta({title:capitalize(startCase(a)),description:"A valid date string that can be parsed by `Date.parse`.",examples:["2025","2025-01-01","Jul 2025","July 3, 2025","2025-02-02T00:00:03.123Z"]})}var Na=v(ta,"degree"),ce=z$1.email({message:"email is invalid."}).meta({id:"email",title:"Email",description:"A valid email address.",examples:["hi@ppresume.com","first.last@company.org","test+tag@domain.co.uk"]}),La=v(oa,"fluency"),wa=z$1.string().meta({title:"Font Family",description:"A comma-separated list of font families to use. The first available font will be used.",example:"Monaco, Helvetica"}),Pa=v(la,"HTML font size"),Ea=v(ca,"HTML template"),B=z$1.array(y("keyword",1,32)).meta({id:"keywords",title:"Keywords",description:"An array of keyword, each between 1 and 32 characters.",examples:[["Javascript","React","Typescript"],["Design","UI","UX"],["Python","Data Science"]]}),xa=v(pa,"language"),Ba=z$1.string().meta({title:"Font Family",description:"A comma-separated list of font families to use. The first available font will be used.",example:"Monaco, Helvetica"}),Ra=v(oe,"LaTeX font size"),$a=v(ua,"LaTeX fontspec numbers"),Ga=v(sa,"LaTeX paper size"),za=v(da,"LaTeX template"),ue=v(ma,"line spacing"),Oa=v(ha,"locale language"),Fa=v(ga,"level"),M=a=>y(a,2,128).meta({title:capitalize(a),description:`A ${a} between 2 and 128 characters.`,examples:["Andy Dufresne","Xiao Hanyu","Jane Smith","Dr. Robert John"]}),ja=v(Sa,"network"),ki=/^[+]?[(]?[0-9\s-]{1,15}[)]?[0-9\s-]{1,15}$/im,de=z$1.string().regex(ki,{message:"phone number may be invalid."}).meta({id:"phone",title:"Phone",description:l(["A valid phone number that may include","country code, parentheses, spaces, and hyphens."]," "),examples:["555-123-4567","+44 20 7946 0958","(555) 123-4567"]}),A=y("summary",16,1024).meta({id:"summary",title:"Summary",description:"A summary text between 16 and 1024 characters.",examples:["Experienced software engineer with 5+ years in full-stack development.",l(["Creative designer passionate about","user experience and modern design principles."]," "),l(["Dedicated project manager with proven track record of","delivering complex projects on time and budget."]," ")]}),w=a=>y(a,2,128).meta({title:capitalize(a),description:"An organization name between 2 and 128 characters.",examples:["Google Inc.","Microsoft Corporation","Startup XYZ","Non-Profit Organization"]}),C=z$1.url({message:"URL is invalid."}).max(256,{message:"URL should be 256 characters or less."}).meta({id:"url",title:"URL",description:"A valid URL with maximum length of 256 characters.",examples:["https://yamlresume.dev","https://ppresume.com","https://github.com/yamlresume/yamlresume","https://linkedin.com/in/xiaohanyu1988","https://www.example.com"]});function m(a){let e={title:`[optional] ${a.meta().title}`,description:`${a.meta().description.replace(/\.$/,"")} or \`null\`.`,examples:a.meta().examples};return a.meta(e).nullish().meta(e)}var Ii=w("awarder").meta({title:"Awarder",description:"The organization or institution that presented the award.",examples:["Academy Awards","Tech Conference","Microsoft Scholarship"]}),vi=M("title").meta({title:"Title",description:"The title of the award.",examples:["Dean's List","Outstanding Student","Best Supporting Engineer"]}),Mi=z$1.object({awarder:Ii,title:vi,date:m(k("date")),summary:m(A)}),Da=z$1.object({awards:z$1.array(Mi).nullish().meta({title:"Awards",description:l(["The awards section contains your achievements and recognitions,","including awards, honors, and special acknowledgments."]," ")})});var Ai=y("headline",2,128).meta({title:"Headline",description:"A short and catchy headline for your resume.",examples:["Full-stack software engineer","Data Scientist with a passion for Machine Learning","Product Manager driving innovation"]}),Ci=z$1.object({name:M("name").describe("Your personal name."),email:m(ce),headline:m(Ai),phone:m(de),summary:m(A),url:m(C)},{error:a=>a.input===void 0?{message:"basics is required."}:{message:a.message}}),Ha=z$1.object({basics:Ci.meta({title:"Basics",description:l(["The basics section contains your personal information,","such as your name, email, phone number, and a brief summary."]," ")})});var Ni=w("issuer").meta({title:"Issuer",description:"The organization that issued the certificate.",examples:["AWS","Microsoft","Coursera","Google Cloud"]}),Li=z$1.object({issuer:Ni,name:M("name").describe("The name of the certificate."),date:m(k("date")),url:m(C)}),Ua=z$1.object({certificates:z$1.array(Li).nullish().meta({title:"Certificates",description:l(["The certificates section contains your professional certifications,","including training programs and industry-recognized credentials."]," ")})});var wi=y("area",2,64).meta({title:"Area",description:"Your field of study or major.",examples:["Computer Science","Business Administration","Engineering","Arts"]}),Pi=z$1.array(y("courses",2,128)).meta({title:"Courses",description:"A list of relevant courses you have taken.",examples:[["Data Structures","Algorithms","Database Systems"],["Marketing","Finance","Operations Management"],["Calculus","Physics","Chemistry"]]}),Ei=w("institution").meta({title:"Institution",description:"The institution that awarded the degree.",examples:["University of California, Los Angeles","Harvard University","Zhejiang University"]}),xi=y("score",2,32).meta({title:"Score",description:"Your GPA, grade, or other academic score.",examples:["3.8","3.8/4.0","A+","95%","First Class Honours"]}),Bi=z$1.object({area:wi,institution:Ei,degree:Na,startDate:k("startDate"),courses:m(Pi),endDate:m(k("endDate")),summary:m(A),score:m(xi),url:m(C)}),Va=z$1.object({education:z$1.array(Bi,{error:a=>a.input===void 0?{message:"education is required."}:{message:a.message}}).meta({title:"Education",description:l(["The education section contains your academic background,","including degrees, institutions, and relevant coursework."]," ")})});var Ri=M("name").describe("The name of the interest."),$i=z$1.object({name:Ri,keywords:m(B)}),_a=z$1.object({interests:z$1.array($i).nullish().meta({title:"Interests",description:l(["The interests section contains your personal interests and hobbies,","including activities and topics you are passionate about."]," ")})});var Gi=z$1.object({fluency:La,language:xa,keywords:m(B)}),Ja=z$1.object({languages:z$1.array(Gi).nullish().meta({title:"Languages",description:l(["The languages section contains your language proficiencies,","including fluency levels and related skills."]," ")})});var zi=y("city",2,64).meta({title:"City",description:"The city where you are located.",examples:["San Francisco","New York","London","Tokyo"]}),Oi=y("address",4,256).meta({title:"Address",description:"Your full address including street, apartment, etc.",examples:["123 Main Street, Apt 4B","456 Oak Avenue","789 Pine Road, Suite 100"]}),Fi=y("postalCode",2,16).meta({title:"Postal Code",description:"Your postal or ZIP code.",examples:["94102","10001","SW1A 1AA","100-0001"]}),ji=y("region",2,64).meta({title:"Region",description:"Your state, province, or region.",examples:["California","New York","England","Tokyo"]}),Di=z$1.object({city:zi,address:m(Oi),country:m(Ca),postalCode:m(Fi),region:m(ji)}),qa=z$1.object({location:Di.nullish().meta({title:"Location",description:l(["The location section contains your geographical information,","such as city, address, country, and postal code."]," ")})});var Ki=y("username",2,64).meta({title:"Username",description:"Your username or handle on the social network.",examples:["john_doe","jane.smith","dev_engineer","designer_123"]}),Hi=z$1.object({network:ja,username:Ki,url:m(C)}),Ya=z$1.object({profiles:z$1.array(Hi).nullish().meta({title:"Profiles",description:l(["The profiles section contains your online presence,","including social media and professional network profiles."]," ")})});var Ui=M("name").describe("The name of the project."),Vi=y("description",4,128).meta({title:"Description",description:"A detailed description of the project and your role.",examples:["Led development of a full-stack web application","Designed and implemented REST API endpoints","Managed team of 5 developers for mobile app development"]}),_i=z$1.object({name:Ui,startDate:k("startDate"),summary:A,description:m(Vi),endDate:m(k("endDate")),keywords:m(B),url:m(C)}),Za=z$1.object({projects:z$1.array(_i).nullish().meta({title:"Projects",description:l(["The projects section contains your personal and professional projects,","including technical details, timelines, and outcomes."]," ")})});var Ji=M("name").describe("The name of the publication."),Wi=w("publisher").meta({title:"Publisher",description:"The organization that published the work.",examples:["ACM","IEEE","Springer","Nature Publishing Group"]}),qi=z$1.object({name:Ji,publisher:Wi,releaseDate:m(k("Release date")),summary:m(A),url:m(C)}),Xa=z$1.object({publications:z$1.array(qi).nullish().meta({title:"Publications",description:l(["The publications section contains your academic and professional publications,","including papers, articles, and research works."]," ")})});var Yi=M("name").describe("The name of the reference."),Zi=y("relationship",2,128).meta({title:"Relationship",description:"Your professional relationship with the reference.",examples:["Former Manager","Colleague","Professor","Client"]}),Xi=z$1.object({name:Yi,summary:A,email:m(ce),phone:m(de),relationship:m(Zi)}),Qa=z$1.object({references:z$1.array(Xi).nullish().meta({title:"References",description:l(["The references section contains your professional references,","including contact information and relationships."]," ")})});var Qi=M("name").describe("The name of the skill."),er=z$1.object({level:Fa,name:Qi,keywords:m(B)}),en=z$1.object({skills:z$1.array(er).nullish().meta({title:"Skills",description:l(["The skills section contains your technical and professional skills,","including proficiency levels and related keywords."]," ")})});var ar=w("organization").meta({title:"Organization",description:"The organization where you volunteered.",examples:["Red Cross","Habitat for Humanity","Local Food Bank","Animal Shelter"]}),nr=y("position",2,64).meta({title:"Position",description:"Your role or position in the volunteer organization.",examples:["Event Coordinator","Tutor","Fundraiser","Board Member"]}),ir=z$1.object({organization:ar,position:nr,startDate:k("startDate"),summary:A,endDate:m(k("endDate")),url:m(C)}),an=z$1.object({volunteer:z$1.array(ir).nullish().meta({title:"Volunteer",description:l(["The volunteer section contains your community service and volunteer work,","including organizations, roles, and contributions."]," ")})});var rr=w("name").meta({title:"Name",description:"The name of the company or organization you worked for.",examples:["Google","Microsoft","Apple","Amazon"]}),tr=y("position",2,64).meta({title:"Position",description:"Your job title or position at the company.",examples:["Software Engineer","Product Manager","Data Scientist","UX Designer"]}),or=z$1.object({name:rr,position:tr,startDate:k("startDate"),summary:A,endDate:m(k("endDate")),keywords:m(B),url:m(C)}),nn=z$1.object({work:z$1.array(or).nullish().meta({title:"Work",description:l(["The work section contains your professional experience,","including job titles, companies, and responsibilities."]," ")})});var $e=z$1.object({content:z$1.object({...Ha.shape,...Va.shape,...Da.shape,...Ua.shape,..._a.shape,...Ja.shape,...qa.shape,...Ya.shape,...Za.shape,...Xa.shape,...Qa.shape,...en.shape,...an.shape,...nn.shape},{error:a=>a.input===void 0?{message:"content is required."}:{message:a.message}})});function lr(a){return l([`invalid ${a} margin size,`,`${a} margin must be a positive number followed by`,'"cm", "pt" or "in", eg: "2.5cm", "1in", "72pt"']," ")}function pe(a){return y(`${a} margin`,2,32).check(e=>{if(e.value.length<2){e.issues=[{code:"too_small",input:e.value,minimum:2,message:`${a} margin should be 2 characters or more.`,origin:"string"}];return}if(e.value.length>32){e.issues=[{code:"too_big",input:e.value,maximum:32,message:`${a} margin should be 32 characters or less.`,origin:"string"}];return}e.value.match(/^\d+(\.\d+)?(cm|pt|in)$/)||(e.issues=[{code:"invalid_value",input:e.value,message:lr(a),origin:"string",values:[e.value]}]);}).meta({title:capitalize(`${a} margin size`),description:l(["A positive number followed by valid units: cm, pt, or in.",'Examples: "2.5cm", "1in", "72pt".']," "),examples:["2.5cm","1in","72pt","0.5cm","12pt"]})}var Ge=z$1.object({margins:z$1.object({top:m(pe("top")),bottom:m(pe("bottom")),left:m(pe("left")),right:m(pe("right"))}).nullish().meta({title:"Margins",description:l(["The margins section contains page margin settings,","including top, bottom, left, and right margins."]," ")})});function P(a){return y(`${a} alias`,2,128).meta({title:a,description:`The name of the alias for ${a} section.`})}var cr=z$1.object({aliases:z$1.object({basics:m(P("basics")),education:m(P("education")),work:m(P("work")),volunteer:m(P("volunteer")),awards:m(P("awards")),certificates:m(P("certificates")),publications:m(P("publications")),skills:m(P("skills")),languages:m(P("languages")),interests:m(P("interests")),references:m(P("references")),projects:m(P("projects"))}).nullish().meta({title:"Aliases",description:"Section alias customization settings."})}),ur=z$1.object({order:z$1.array(v(fa,"section")).nullish().meta({title:"Order",description:"Custom order for sections in the final output."})}),H=z$1.object({sections:z$1.object({...cr.shape,...ur.shape}).nullish().meta({title:"Sections",description:"Section customization settings."})});var on=z$1.object({advanced:z$1.object({showIcons:z$1.boolean().default(true),title:z$1.string().optional(),footer:z$1.string().default('Generated by <a href="https://yamlresume.dev">YAMLResume</a>'),description:z$1.string().optional(),keywords:z$1.string().optional()}).nullish().meta({title:"Advanced",description:l(["The Advanced section contains advanced HTML settings."]," ")})});var sn=z$1.object({template:m(Ea).meta({title:"Template",description:l(["The template section contains the resume template selection,","determining the overall visual style and layout."]," ")})});var cn=z$1.object({typography:z$1.object({fontSize:m(Pa),fontFamily:m(wa),lineSpacing:m(ue)}).nullish().meta({title:"Typography",description:l(["The typography section contains font settings,","including font size and line spacing options for HTML output."]," ")})});var dn=z$1.object({engine:z$1.literal("html"),...sn.shape,...cn.shape,...on.shape,...H.shape}).meta({title:"HTML Engine Layout"});var mn=z$1.object({advanced:z$1.object({fontspec:z$1.object({numbers:m($a)}).nullish(),showIcons:z$1.boolean().default(true)}).nullish().meta({title:"Advanced",description:l(["The Advanced section contains advanced latex settings,","including fontspec package configurations."]," ")})});var mr=z$1.boolean().meta({title:"Show Page Numbers",description:"Whether to show page numbers on the page."}),pn=z$1.object({page:z$1.object({showPageNumbers:m(mr),paperSize:m(Ga),...Ge.shape}).nullish().meta({title:"Page",description:l(["The page section contains page display settings,","including whether to show page numbers and margins."]," ")})});var gn=z$1.object({template:m(za).meta({title:"Template",description:l(["The template section contains the resume template selection,","determining the overall visual style and layout."]," ")})});var gr=z$1.object({links:z$1.object({underline:z$1.boolean().default(false).meta({title:"Underline Links",description:"Whether to underline links in the document.",examples:[false,true]})}).nullish().meta({title:"Typography Links",description:"Link styling settings for typography."})}),hn=z$1.object({typography:z$1.object({fontSize:m(Ra),fontFamily:m(Ba),lineSpacing:m(ue),...gr.shape}).nullish().meta({title:"Typography",description:l(["The typography section contains font settings,","including font size options and link styling."]," ")})});var fn=z$1.object({engine:z$1.literal("latex"),...pn.shape,...gn.shape,...hn.shape,...mn.shape,...H.shape}).meta({title:"LaTeX Engine Layout"});var bn=z$1.object({engine:z$1.literal("markdown"),...H.shape}).meta({title:"Markdown Engine Layout"});var Fe=z$1.object({layouts:z$1.array(z$1.discriminatedUnion("engine",[dn,fn,bn])).nullish().meta({title:"Layouts",description:l(["Multiple output layouts configuration as a discriminated union array,",'supporting engines like "latex", "markdown", and "html".']," ")})});var je=z$1.object({locale:z$1.object({language:m(Oa)}).nullish().meta({title:"Locale",description:l(["Top-level locale language settings,","determining the language used for the resume."]," ")})});var Sr=z$1.object({...$e.shape,...je.shape,...Fe.shape}).meta({$id:"https://yamlresume.dev/schema.json",title:"YAMLResume Schema",description:"JSON Schema for YAMLResume resume format.",version:"0.12.2",license:"MIT",keywords:["Resume","CV","YAML","LaTeX","PDF","YAMLResume","Markdown"]});
1096
1096
  export{Je as COUNTRY_OPTIONS,be as DEFAULT_HTML_LAYOUT,ke as DEFAULT_LATEX_LAYOUT,Te as DEFAULT_MARKDOWN_LAYOUT,ct as DEFAULT_RESUME,Kn as DEFAULT_RESUME_CONTENT,se as DEFAULT_RESUME_LAYOUTS,q as DEFAULT_RESUME_LOCALE,ya as DEFAULT_SECTIONS_ORDER,ta as DEGREE_OPTIONS,aa as DutchCountryNames,We as EnglishCountryNames,_e as ErrorType,ut as FILLED_RESUME,F as FILLED_RESUME_CONTENT,oa as FLUENCY_OPTIONS,Qe as FrenchCountryNames,ia as GermanCountryNames,la as HTML_FONT_SIZE_OPTIONS,ca as HTML_TEMPLATE_OPTIONS,_ as HtmlCodeGenerator,Y as HtmlRenderer,ra as IndonesianCountryNames,Z as JakeRenderer,na as JapaneseCountryNames,pa as LANGUAGE_OPTIONS,ua as LATEX_FONTSPEC_NUMBERS_OPTIONS,oe as LATEX_FONT_SIZE_OPTIONS,sa as LATEX_PAPER_SIZE_OPTIONS,da as LATEX_TEMPLATE_OPTIONS,ga as LEVEL_OPTIONS,ma as LINE_SPACING_OPTIONS,ha as LOCALE_LANGUAGE_OPTIONS,J as LatexCodeGenerator,st as MARGIN_OPTIONS,I as MarkdownParser,ae as MarkdownRenderer,z as ModerncvBankingRenderer,Q as ModerncvCasualRenderer,ee as ModerncvClassicRenderer,Sa as NETWORK_OPTIONS,ea as NorwegianCountryNames,Ir as ONE_DAY,fa as ORDERABLE_SECTION_IDS,It as PUNCTUATIONS,T as RESUME_SECTION_ITEMS,Sr as ResumeSchema,rt as SECTION_IDS,qe as SimplifiedChineseCountryNames,Xe as SpanishCountryNames,vt as TERMS,Ye as TraditionalChineseCountryHKNames,Ze as TraditionalChineseCountryTWNames,Se as YAMLResumeError,Ke as collectAllKeys,Mr as epochSecondsToLocaleDateString,E as escapeHtml,V as escapeLatex,He as getDateRange,ot as getHtmlTemplateDetail,tt as getLatexTemplateDetail,lt as getLocaleLanguageDetail,j as getOptionTranslation,yi as getResumeRenderer,h as getTemplateTranslations,An as isEmptyString,d as isEmptyValue,l as joinNonEmptyString,N as localizeDate,De as mergeArrayWithOrder,Ar as milliSecondsToSeconds,vr as nowInUTCSeconds,kr as parseDate,vn as removeKeysFromObject,b as showIf,s as showIfNotEmpty,wr as toCodeBlock,R as transformResume};//# sourceMappingURL=index.js.map
1097
1097
  //# sourceMappingURL=index.js.map