satori 0.1.0 → 0.1.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/README.md CHANGED
@@ -290,7 +290,7 @@ await satori(
290
290
  {
291
291
  ...,
292
292
  graphemeImages: {
293
- '🤯': 'https://twemoji.maxcdn.com/v/13.1.0/svg/1f92f.svg',
293
+ '🤯': 'https://cdnjs.cloudflare.com/ajax/libs/twemoji/14.0.2/svg/1f92f.svg',
294
294
  },
295
295
  }
296
296
  )
package/dist/index.cjs CHANGED
@@ -5,6 +5,6 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
5
5
  in CSS rule \`${a}: ${u}\`.${$o(a)}`))}}}if(n.backgroundImage){let{backgrounds:s}=(0,qo.parseElementStyle)(n);n.backgroundImage=s}let r=typeof n.fontSize=="number"?n.fontSize:t.fontSize;if(typeof r=="string")try{let s=new Ge(r);switch(s.unit){case"em":r=s.value*t.fontSize;break;case"rem":r=s.value*16;break}}catch{r=16}typeof n.fontSize<"u"&&(n.fontSize=r),n.transformOrigin&&(n.transformOrigin=un(n.transformOrigin,r));for(let s in n){let o=n[s];if(s==="lineHeight")typeof o=="string"&&(o=n[s]=be(o,r,r,t,!0)/r);else{if(typeof o=="string"){let a=be(o,r,r,t);typeof a<"u"&&(n[s]=a),o=n[s]}if(typeof o=="string"||typeof o=="object"){let a=Uo(o);a&&(n[s]=a),o=n[s]}}if(s==="opacity"&&(o=n[s]=o*t.opacity),s==="transform"){let a=o;for(let u of a){let l=Object.keys(u)[0],f=u[l],d=typeof f=="string"&&(i=be(f,r,r,t))!=null?i:f;u[l]=d}}}return n}function ml(e,t){return e&&e.toLowerCase()!=="currentcolor"?e:t}function gl(e,t){return e.replace(/currentcolor/ig,t)}function vl(e,t){return Fo(e)&&(e=gl(e,t)),e}c();var bl="image/avif",yl="image/webp",gr="image/png",vr="image/jpeg",br="image/gif",cn="image/svg+xml";function zo(e){let t=new DataView(e),n=4,r=t.byteLength;for(;n<r;){let i=t.getUint16(n,!1);if(i>r)throw new TypeError("Invalid JPEG");let s=t.getUint8(i+1+n);if(s===192||s===193||s===194)return[t.getUint16(i+7+n,!1),t.getUint16(i+5+n,!1)];n+=i+2}throw new TypeError("Invalid JPEG")}function Go(e){let t=new Uint8Array(e.slice(6,10));return[t[0]|t[1]<<8,t[2]|t[3]<<8]}function Vo(e){let t=new DataView(e);return[t.getUint16(18,!1),t.getUint16(22,!1)]}var ln=Lo(100),fn=new Map,xl=[gr,vr,br,cn];function wl(e){let t="",n=new Uint8Array(e);for(let r=0;r<n.byteLength;r++)t+=String.fromCharCode(n[r]);return btoa(t)}function _l(e){let t=atob(e),n=t.length,r=new Uint8Array(n);for(let i=0;i<n;i++)r[i]=t.charCodeAt(i);return r.buffer}function Ho(e,t){let n=t.match(/<svg[^>]*>/)[0],r=n.match(/viewBox=['"](.+)['"]/),i=r?bt(r[1]):null,s=n.match(/width=['"](\d*\.\d+|\d+)['"]/),o=n.match(/height=['"](\d*\.\d+|\d+)['"]/);if(!i&&(!s||!o))throw new Error(`Failed to parse SVG from ${e}: missing "viewBox"`);let a=i?[i[2],i[3]]:[+s[1],+o[1]],u=a[0]/a[1];return s&&o?[+s[1],+o[1]]:s?[+s[1],+s[1]/u]:o?[+o[1]*u,+o[1]]:[a[0],a[1]]}async function yr(e){if(!e)throw new Error("Image source is not provided.");if((e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))&&(e=e.slice(1,-1)),e.startsWith("data:")){let r;try{r=/data:(?<imageType>[a-z/+]+)(;(?<encodingType>base64|utf8))?,(?<dataString>.*)/g.exec(e).groups}catch{return console.warn("Image data URI resolved without size:"+e),[e]}let{imageType:i,encodingType:s,dataString:o}=r;if(i===cn){let a=s==="base64"?atob(o):decodeURIComponent(o.replace(/ /g,"%20")),u=s==="base64"?e:`data:image/svg+xml;base64,${btoa(a)}`,l=Ho(e,a);return[u,...l]}else if(s==="base64"){let a,u=_l(o);switch(i){case gr:a=Vo(u);break;case br:a=Go(u);break;case vr:a=zo(u);break}return[e,...a]}else return console.warn("Image data URI resolved without size:"+e),[e]}if(!globalThis.fetch)throw new Error("`fetch` is required to be polyfilled to load images.");if(fn.has(e))return fn.get(e);let t=ln.get(e);if(t)return t;let n=new Promise((r,i)=>{fetch(e).then(s=>{let o=s.headers.get("content-type");return o==="image/svg+xml"||o==="application/svg+xml"?s.text():s.arrayBuffer()}).then(s=>{if(typeof s=="string")try{let l=`data:image/svg+xml;base64,${btoa(s)}`,f=Ho(e,s);ln.set(e,[l,...f]),r([l,...f]);return}catch(l){throw new Error(`Failed to parse SVG image: ${l.message}`)}let o,a=Sl(new Uint8Array(s));switch(a){case gr:o=Vo(s);break;case br:o=Go(s);break;case vr:o=zo(s);break}if(!xl.includes(a))throw new Error(`Unsupported image type: ${a||"unknown"}`);let u=`data:${a};base64,${wl(s)}`;ln.set(e,[u,...o]),r([u,...o])}).catch(s=>{i(new Error(`Can't load image ${e}: `+s.message))})});return fn.set(e,n),n}function Sl(e){return[255,216,255].every((t,n)=>e[n]===t)?vr:[137,80,78,71,13,10,26,10].every((t,n)=>e[n]===t)?gr:[71,73,70,56].every((t,n)=>e[n]===t)?br:[82,73,70,70,0,0,0,0,87,69,66,80].every((t,n)=>!t||e[n]===t)?yl:[60,63,120,109,108].every((t,n)=>e[n]===t)?cn:[0,0,0,0,102,116,121,112,97,118,105,102].every((t,n)=>!t||e[n]===t)?bl:null}async function dn(e,t,n,r,i){let s=Fe(),o={...n,...mr(Mo[t],n),...mr(r,n)};if(t==="img"){let[a,u,l]=await yr(i.src);if(u===void 0&&l===void 0){if(i.width===void 0||i.height===void 0)throw new Error("Image size cannot be determined. Please provide the width and height of the image.");u=parseInt(i.width),l=parseInt(i.height)}let f=l/u,d=(o.borderLeftWidth||0)+(o.borderRightWidth||0)+(o.paddingLeft||0)+(o.paddingRight||0),g=(o.borderTopWidth||0)+(o.borderBottomWidth||0)+(o.paddingTop||0)+(o.paddingBottom||0),p=o.width||i.width,h=o.height||i.height,v=typeof p!="string"&&typeof h!="string";typeof p=="number"&&v&&(p-=d),typeof h=="number"&&v&&(h-=g),p===void 0&&h===void 0?(p=u,h=l):p===void 0?typeof h=="number"?p=h/f:e.setAspectRatio(1/f):h===void 0&&(typeof p=="number"?h=p*f:e.setAspectRatio(1/f)),o.width=v?p+d:p,o.height=v?h+g:h,o.__src=a}if(t==="svg"){let a=i.viewBox||i.viewbox,u=bt(a),l=u?u[3]/u[2]:null,{width:f,height:d}=i;typeof f>"u"&&d?l==null?f=0:typeof d=="string"&&d.endsWith("%")?f=parseInt(d)/l+"%":(d=be(d,n.fontSize,1,n),f=d/l):typeof d>"u"&&f?l==null?f=0:typeof f=="string"&&f.endsWith("%")?d=parseInt(f)*l+"%":(f=be(f,n.fontSize,1,n),d=f*l):(typeof f<"u"&&(f=be(f,n.fontSize,1,n)||f),typeof d<"u"&&(d=be(d,n.fontSize,1,n)||d),f||(f=u==null?void 0:u[2]),d||(d=u==null?void 0:u[3])),!o.width&&f&&(o.width=f),!o.height&&d&&(o.height=d)}return e.setDisplay(ce(o.display,{flex:s.DISPLAY_FLEX,none:s.DISPLAY_NONE},s.DISPLAY_FLEX,"display")),e.setAlignContent(ce(o.alignContent,{stretch:s.ALIGN_STRETCH,center:s.ALIGN_CENTER,"flex-start":s.ALIGN_FLEX_START,"flex-end":s.ALIGN_FLEX_END,"space-between":s.ALIGN_SPACE_BETWEEN,"space-around":s.ALIGN_SPACE_AROUND,baseline:s.ALIGN_BASELINE,normal:s.ALIGN_AUTO},s.ALIGN_AUTO,"alignContent")),e.setAlignItems(ce(o.alignItems,{stretch:s.ALIGN_STRETCH,center:s.ALIGN_CENTER,"flex-start":s.ALIGN_FLEX_START,"flex-end":s.ALIGN_FLEX_END,baseline:s.ALIGN_BASELINE,normal:s.ALIGN_AUTO},s.ALIGN_FLEX_START,"alignItems")),e.setAlignSelf(ce(o.alignSelf,{stretch:s.ALIGN_STRETCH,center:s.ALIGN_CENTER,"flex-start":s.ALIGN_FLEX_START,"flex-end":s.ALIGN_FLEX_END,baseline:s.ALIGN_BASELINE,normal:s.ALIGN_AUTO},s.ALIGN_AUTO,"alignSelf")),e.setJustifyContent(ce(o.justifyContent,{center:s.JUSTIFY_CENTER,"flex-start":s.JUSTIFY_FLEX_START,"flex-end":s.JUSTIFY_FLEX_END,"space-between":s.JUSTIFY_SPACE_BETWEEN,"space-around":s.JUSTIFY_SPACE_AROUND},s.JUSTIFY_FLEX_START,"justifyContent")),e.setFlexDirection(ce(o.flexDirection,{row:s.FLEX_DIRECTION_ROW,column:s.FLEX_DIRECTION_COLUMN,"row-reverse":s.FLEX_DIRECTION_ROW_REVERSE,"column-reverse":s.FLEX_DIRECTION_COLUMN_REVERSE},s.FLEX_DIRECTION_ROW,"flexDirection")),e.setFlexWrap(ce(o.flexWrap,{wrap:s.WRAP_WRAP,nowrap:s.WRAP_NO_WRAP,"wrap-reverse":s.WRAP_WRAP_REVERSE},s.WRAP_NO_WRAP,"flexWrap")),typeof e.setGap<"u"&&typeof e.getGap<"u"&&(typeof o.gap<"u"&&e.setGap(s.GUTTER_ALL,o.gap),typeof o.rowGap<"u"&&e.setGap(s.GUTTER_ROW,o.rowGap),typeof o.columnGap<"u"&&e.setGap(s.GUTTER_COLUMN,o.columnGap)),typeof o.flexBasis<"u"&&e.setFlexBasis(o.flexBasis),e.setFlexGrow(typeof o.flexGrow>"u"?0:o.flexGrow),e.setFlexShrink(typeof o.flexShrink>"u"?0:o.flexShrink),typeof o.maxHeight<"u"&&e.setMaxHeight(o.maxHeight),typeof o.maxWidth<"u"&&e.setMaxWidth(o.maxWidth),typeof o.minHeight<"u"&&e.setMinHeight(o.minHeight),typeof o.minWidth<"u"&&e.setMinWidth(o.minWidth),e.setOverflow(ce(o.overflow,{visible:s.OVERFLOW_VISIBLE,hidden:s.OVERFLOW_HIDDEN},s.OVERFLOW_VISIBLE,"overflow")),e.setMargin(s.EDGE_TOP,o.marginTop||0),e.setMargin(s.EDGE_BOTTOM,o.marginBottom||0),e.setMargin(s.EDGE_LEFT,o.marginLeft||0),e.setMargin(s.EDGE_RIGHT,o.marginRight||0),e.setBorder(s.EDGE_TOP,o.borderTopWidth||0),e.setBorder(s.EDGE_BOTTOM,o.borderBottomWidth||0),e.setBorder(s.EDGE_LEFT,o.borderLeftWidth||0),e.setBorder(s.EDGE_RIGHT,o.borderRightWidth||0),e.setPadding(s.EDGE_TOP,o.paddingTop||0),e.setPadding(s.EDGE_BOTTOM,o.paddingBottom||0),e.setPadding(s.EDGE_LEFT,o.paddingLeft||0),e.setPadding(s.EDGE_RIGHT,o.paddingRight||0),e.setPositionType(ce(o.position,{absolute:s.POSITION_TYPE_ABSOLUTE,relative:s.POSITION_TYPE_RELATIVE},s.POSITION_TYPE_RELATIVE,"position")),typeof o.top<"u"&&e.setPosition(s.EDGE_TOP,o.top),typeof o.bottom<"u"&&e.setPosition(s.EDGE_BOTTOM,o.bottom),typeof o.left<"u"&&e.setPosition(s.EDGE_LEFT,o.left),typeof o.right<"u"&&e.setPosition(s.EDGE_RIGHT,o.right),typeof o.height<"u"?e.setHeight(o.height):e.setHeightAuto(),typeof o.width<"u"?e.setWidth(o.width):e.setWidthAuto(),[o,sn(o)]}c();c();c();var jo=[1,0,0,1,0,0];function kl(e,t,n){let r=[...jo];for(let i of e){let s=Object.keys(i)[0],o=i[s];if(typeof o=="string")if(s==="translateX")o=parseFloat(o)/100*t,i[s]=o;else if(s==="translateY")o=parseFloat(o)/100*n,i[s]=o;else throw new Error(`Invalid transform: "${s}: ${o}".`);let a=o,u=[...jo];switch(s){case"translateX":u[4]=a;break;case"translateY":u[5]=a;break;case"scale":u[0]=a,u[3]=a;break;case"scaleX":u[0]=a;break;case"scaleY":u[3]=a;break;case"rotate":{let l=a*Math.PI/180,f=Math.cos(l),d=Math.sin(l);u[0]=f,u[1]=d,u[2]=-d,u[3]=f;break}case"skewX":u[2]=Math.tan(a*Math.PI/180);break;case"skewY":u[1]=Math.tan(a*Math.PI/180);break}r=gt(u,r)}e.splice(0,e.length),e.push(...r),e.__resolved=!0}function xt({left:e,top:t,width:n,height:r},i,s,o){var l,f,d,g;let a;i.__resolved||kl(i,n,r);let u=i;if(s)a=u;else{let p=(f=o==null?void 0:o.xAbsolute)!=null?f:((l=o==null?void 0:o.xRelative)!=null?l:50)*n/100,h=(g=o==null?void 0:o.yAbsolute)!=null?g:((d=o==null?void 0:o.yRelative)!=null?d:50)*r/100,v=e+p,w=t+h;a=gt([1,0,0,1,v,w],gt(u,[1,0,0,1,-v,-w])),u.__parent&&(a=gt(u.__parent,a)),u.splice(0,6,...a)}return`matrix(${a.map(p=>p.toFixed(2)).join(",")})`}function Yo({left:e,top:t,width:n,height:r,isInheritingTransform:i},s){let o="",a=1;return s.transform&&(o=xt({left:e,top:t,width:n,height:r},s.transform,i,s.transformOrigin)),s.opacity!==void 0&&(a=+s.opacity),{matrix:o,opacity:a}}function pn({id:e,content:t,filter:n,left:r,top:i,width:s,height:o,matrix:a,opacity:u,image:l,clipPathId:f,debug:d,shape:g,decorationShape:p},h){let v="";if(d&&(v=I("rect",{x:r,y:i-o,width:s,height:o,fill:"transparent",stroke:"#575eff","stroke-width":1,transform:a||void 0,"clip-path":f?`url(#${f})`:void 0})),l){let b={href:l,x:r,y:i,width:s,height:o,transform:a||void 0,"clip-path":f?`url(#${f})`:void 0,style:h.filter?`filter:${h.filter}`:void 0};return[(n?`${n}<g filter="url(#satori_s-${e})">`:"")+I("image",{...b,opacity:u!==1?u:void 0})+(p||"")+(n?"</g>":"")+v,""]}let w={x:r,y:i,width:s,height:o,"font-weight":h.fontWeight,"font-style":h.fontStyle,"font-size":h.fontSize,"font-family":h.fontFamily,"letter-spacing":h.letterSpacing||void 0,transform:a||void 0,"clip-path":f?`url(#${f})`:void 0,style:h.filter?`filter:${h.filter}`:void 0};return[(n?`${n}<g filter="url(#satori_s-${e})">`:"")+I("text",{...w,fill:h.color,opacity:u!==1?u:void 0},t)+(p||"")+(n?"</g>":"")+v,g?I("text",w,t):""]}c();function Tl(e,t,n){return e.replace(/([MA])([0-9.-]+),([0-9.-]+)/g,function(r,i,s,o){return i+(parseFloat(s)+t)+","+(parseFloat(o)+n)})}function Xo({id:e,width:t,height:n},r){if(!r.shadowColor||!r.shadowOffset||typeof r.shadowRadius>"u")return"";let i=r.shadowRadius*r.shadowRadius/4,s=Math.min(r.shadowOffset.width-i,0),o=Math.max(r.shadowOffset.width+i+t,t),a=Math.min(r.shadowOffset.height-i,0),u=Math.max(r.shadowOffset.height+i+n,n);return`<defs><filter id="satori_s-${e}" x="${s/t*100}%" y="${a/n*100}%" width="${(o-s)/t*100}%" height="${(u-a)/n*100}%"><feDropShadow dx="${r.shadowOffset.width}" dy="${r.shadowOffset.height}" stdDeviation="${r.shadowRadius/2}" flood-color="${r.shadowColor}" flood-opacity="1"/></filter></defs>`}function Qo({width:e,height:t,shape:n,opacity:r,id:i},s){if(!s.boxShadow)return null;let o="",a="";for(let u=s.boxShadow.length-1;u>=0;u--){let l="",f=s.boxShadow[u];f.spreadRadius&&f.inset&&(f.spreadRadius=-f.spreadRadius);let d=f.blurRadius*f.blurRadius/4+(f.spreadRadius||0),g=Math.min(-d-(f.inset?f.offsetX:0),0),p=Math.max(d+e-(f.inset?f.offsetX:0),e),h=Math.min(-d-(f.inset?f.offsetY:0),0),v=Math.max(d+t-(f.inset?f.offsetY:0),t),w=`satori_s-${i}-${u}`,b=`satori_ms-${i}-${u}`,y=f.spreadRadius?n.replace('stroke-width="0"',`stroke-width="${f.spreadRadius*2}"`):n;l+=I("mask",{id:b,maskUnits:"userSpaceOnUse"},I("rect",{x:0,y:0,width:s._viewportWidth,height:s._viewportHeight,fill:f.inset?"#000":"#fff"})+y.replace('fill="#fff"',f.inset?'fill="#fff"':'fill="#000"').replace('stroke="#fff"',""));let _=y.replace(/d="([^"]+)"/,(O,k)=>'d="'+Tl(k,f.offsetX,f.offsetY)+'"').replace(/x="([^"]+)"/,(O,k)=>'x="'+(parseFloat(k)+f.offsetX)+'"').replace(/y="([^"]+)"/,(O,k)=>'y="'+(parseFloat(k)+f.offsetY)+'"');f.spreadRadius&&f.spreadRadius<0&&(l+=I("mask",{id:b+"-neg",maskUnits:"userSpaceOnUse"},_.replace('stroke="#fff"','stroke="#000"').replace(/stroke-width="[^"]+"/,`stroke-width="${-f.spreadRadius*2}"`))),f.spreadRadius&&f.spreadRadius<0&&(_=I("g",{mask:`url(#${b}-neg)`},_)),l+=I("defs",{},I("filter",{id:w,x:`${g/e*100}%`,y:`${h/t*100}%`,width:`${(p-g)/e*100}%`,height:`${(v-h)/t*100}%`},I("feGaussianBlur",{stdDeviation:f.blurRadius/2,result:"b"})+I("feFlood",{"flood-color":f.color,in:"SourceGraphic",result:"f"})+I("feComposite",{in:"f",in2:"b",operator:f.inset?"out":"in"})))+I("g",{mask:`url(#${b})`,filter:`url(#${w})`,opacity:r},_),f.inset?a+=l:o+=l}return[o,a]}c();function hn({width:e,left:t,top:n,ascender:r,clipPathId:i},s){let{textDecorationColor:o,textDecorationStyle:a,textDecorationLine:u,fontSize:l}=s;if(!u||u==="none")return"";let f=Math.max(1,l*.1),d=u==="line-through"?n+r*.5:u==="underline"?n+r*1.1:n,g=a==="dashed"?`${f*1.2} ${f*2}`:a==="dotted"?`0 ${f*2}`:void 0;return I("line",{x1:t,y1:d,x2:t+e,y2:d,stroke:o,"stroke-width":f,"stroke-dasharray":g,"stroke-linecap":a==="dotted"?"round":"square","clip-path":i?`url(#${i})`:void 0})}async function*mn(e,t){var wo;let n=Fe(),{parentStyle:r,inheritedStyle:i,parent:s,font:o,id:a,isInheritingTransform:u,debug:l,embedFont:f,graphemeImages:d,locale:g,canLoadAdditionalAssets:p}=t;r.textTransform==="uppercase"?e=e.toLocaleUpperCase(g):r.textTransform==="lowercase"?e=e.toLocaleLowerCase(g):r.textTransform==="capitalize"&&(e=Me(e,"word",g).map(q=>Me(q,"grapheme",g).map((K,V)=>V===0?K.toLocaleUpperCase(g):K).join("")).join(""));let h=r.wordBreak==="break-word",v=ce(r.wordBreak,{normal:"word","break-all":"grapheme","break-word":"word","keep-all":"word"},"word","wordBreak"),w=Me(e,v,g),b=n.Node.create();b.setAlignItems(n.ALIGN_BASELINE),b.setJustifyContent(ce(r.textAlign,{left:n.JUSTIFY_FLEX_START,right:n.JUSTIFY_FLEX_END,center:n.JUSTIFY_CENTER,justify:n.JUSTIFY_SPACE_BETWEEN,start:n.JUSTIFY_FLEX_START,end:n.JUSTIFY_FLEX_END},n.JUSTIFY_FLEX_START,"textAlign")),s.insertChild(b,s.getChildCount());let{textAlign:y,textOverflow:_,whiteSpace:O,lineHeight:k,filter:C,_inheritedBackgroundClipTextPath:D}=r,L=r.fontSize,F=o.getEngine(L,k,r,g),G=p?w.filter(q=>!F.has(q)):[];yield G.map(q=>({word:q,locale:g})),G.length&&(F=o.getEngine(L,k,r,g));let B=[],W=[],$=[],te=[],Q=new Map,re=q=>{let K=0;for(let V of q){if(Q.has(V)){K+=Q.get(V);continue}let de=F.measure(V,r);Q.set(V,de),K+=de}return K},ie=0,A=[],N=0;for(let q of w){let K=!1,V=d&&d[q];O==="pre"?K=q[0]===`
6
6
  `:O!=="nowrap"&&(V||vt.includes(q[0]))&&(K=!0),K?(O==="nowrap"?N+=re(A)+r.fontSize:(ie=Math.max(ie,re(A)),V&&(ie=Math.max(ie,r.fontSize))),A=[]):(!vt.includes(q[0])||!A.length)&&A.push(q===`
7
7
  `?" ":q)}ie=Math.max(ie,re(A)+N);let H=s.getMinWidth(),M=s.getMaxWidth(),Oe=s.getWidth();isNaN(Oe.value)&&(isNaN(H.value)||H.unit===1&&H.value>ie)&&(isNaN(M.value)||M.unit===1&&(ie=Math.min(ie,M.value)),s.setMinWidth(ie)),typeof r.flexShrink>"u"&&s.setFlexShrink(1);let ct=["pre","pre-wrap","pre-line"].includes(O),Bu=!["pre","pre-wrap"].includes(O);b.setMeasureFunc(q=>{let K=0,V="",de=0,oe=0,pe=0,fe=-1,Ue=0,J=0,Ce=0;B=[],$=[0];for(let De=0;De<w.length;De++){let se=w[De],Ee=ct&&se===`
8
- `;if(Bu&&vt.includes(se[0])&&!Ee)V||(V=" "),de=re([V]),te[De]=null;else{let he=Ee?0:d&&d[se]?r.fontSize:re([se]);Ee&&J===0&&(J=F.height(se)),oe||(V="",de=0);let ae=de||",.!?:-@)>]}%#".indexOf(se[0])<0,le=!oe||!!de,ze=De&&ae&&oe+de+he>q&&O!=="nowrap"&&O!=="pre";if(h&&he>q&&(!oe||ze||Ee)){let Xe=Me(se,"grapheme");w.splice(De,1,"",...Xe),oe>0&&(B.push(oe),W.push(Ce),K++,Ue+=J,oe=0,J=0,Ce=0,$.push(1),fe=-1);continue}if(Ee||ze)B.push(oe),W.push(Ce),K++,Ue+=J,oe=he,J=he?F.height(se):0,Ce=he?F.baseline(se):0,$.push(1),fe=-1,Ee||(pe=Math.max(pe,q));else{oe+=de+he;let Xe=F.height(se);Xe>J&&(J=Xe,Ce=F.baseline(se)),le&&$[$.length-1]++}V="",de=0,le&&fe++,pe=Math.max(pe,oe),te[De]={y:Ue,x:oe-he,width:he,line:K,lineIndex:fe}}}return oe&&(K++,B.push(oe),W.push(Ce),Ue+=J),{width:pe,height:Ue}});let[Uu,zu]=yield,Vr="",ar="",qe=i._inheritedClipPathId,ho=i._inheritedMaskId,{left:mo,top:go,width:ur,height:vo}=b.getComputedLayout(),Hr=s.getComputedWidth()-s.getComputedPadding(n.EDGE_LEFT)-s.getComputedPadding(n.EDGE_RIGHT)-s.getComputedBorder(n.EDGE_LEFT)-s.getComputedBorder(n.EDGE_RIGHT),rt=Uu+mo,nt=zu+go,{matrix:Le,opacity:lr}=Yo({left:mo,top:go,width:ur,height:vo,isInheritingTransform:u},r),fr="";r.textShadowOffset&&(fr=Xo({width:ur,height:vo,id:a},{shadowColor:r.textShadowColor,shadowOffset:r.textShadowOffset,shadowRadius:r.textShadowRadius}));let dt="",cr="",bo="",jr=-1,yo=_==="ellipsis"?re(["\u2026"]):0,Gu=_==="ellipsis"?re([" "]):0,dr={},Be=null,xo=0;for(let q=0;q<w.length;q++){if(!te[q])continue;let K=te[q],V=w[q],de=null,oe=d?d[V]:null,pe=K.y,fe=K.x,Ue=K.width,J=K.line;if(J===jr)continue;let Ce=!1;if(B.length>1){let ae=ur-B[J];if(y==="right"||y==="end")fe+=ae;else if(y==="center")fe+=ae/2;else if(y==="justify"&&J<B.length-1){let le=$[J];fe+=(le>1?ae/(le-1):0)*K.lineIndex,Ce=!0}}if(dr[J]||(dr[J]=[fe,Ce?ur:B[J]]),_==="ellipsis"&&B[J]>Hr&&K.x+Ue+yo+Gu>Hr){let ae=Me(V,"grapheme",g),le="",ze=0;for(let Yr of ae){let Xe=K.x+re([le+Yr]);if(le&&Xe+yo>Hr)break;le+=Yr,ze=Xe}V=le+"\u2026",jr=J,dr[J][1]=ze}let De=W[J],se=F.baseline(V),Ee=F.height(V),he=De-se;if(oe)pe+=0;else if(f){if(!vt.includes(V)&&w[q+1]&&!d[w[q+1]]&&te[q+1]&&pe===te[q+1].y){Be===null&&(xo=fe),Be=Be===null?V:Be+V;continue}let ae=Be===null?V:Be+V,le=Be===null?fe:xo,ze=K.width+fe-le;de=F.getSVG(ae,{...r,left:rt+le,top:nt+pe+se+he,letterSpacing:r.letterSpacing}),Be=null,l&&(bo+=I("rect",{x:rt+le,y:nt+pe+he,width:ze,height:Ee,fill:"transparent",stroke:"#575eff","stroke-width":1,transform:Le||void 0,"clip-path":qe?`url(#${qe})`:void 0})+I("line",{x1:rt+fe,x2:rt+fe+K.width,y1:nt+pe+he+se,y2:nt+pe+he+se,stroke:"#14c000","stroke-width":1,transform:Le||void 0,"clip-path":qe?`url(#${qe})`:void 0}))}else pe+=se+he;if(r.textDecorationLine&&(J!==((wo=te[q+1])==null?void 0:wo.line)||jr===J)){let ae=dr[J];ae&&!ae[2]&&(dt+=hn({left:rt+ae[0],top:nt+Ee*+J,width:ae[1],ascender:F.baseline(V),clipPathId:qe},r),ae[2]=1)}if(de!==null)cr+=de+" ";else{let[ae,le]=pn({content:V,filter:fr,id:a,left:rt+fe,top:nt+pe,width:Ue,height:Ee,matrix:Le,opacity:lr,image:oe,clipPathId:qe,debug:l,shape:!!D,decorationShape:dt},r);Vr+=ae,ar+=le,dt=""}}if(cr){let q=r.color!=="transparent"&&lr!==0?I("path",{fill:r.color,d:cr,transform:Le||void 0,opacity:lr!==1?lr:void 0,"clip-path":qe?`url(#${qe})`:void 0,mask:ho?`url(#${ho})`:void 0,style:C?`filter:${C}`:void 0}):"";D&&(ar=I("path",{d:cr,transform:Le||void 0})),Vr+=(fr?fr+I("g",{filter:`url(#satori_s-${a})`},q+dt):q+dt)+bo}return ar&&(r._inheritedBackgroundClipTextPath.value+=ar),Vr}c();c();c();var gn=gn||{},Ko={type:"directional",value:"bottom"};gn.parse=function(){var e={linearGradient:/^(\-(webkit|o|ms|moz)\-)?(linear\-gradient)/i,repeatingLinearGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-linear\-gradient)/i,radialGradient:/^(\-(webkit|o|ms|moz)\-)?(radial\-gradient)/i,repeatingRadialGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-radial\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,zeroValue:/[0]/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/},t="";function n(A){var N=new Error(t+": "+A);throw N.source=t,N}function r(){var A=i();return t.length>0&&n("Invalid input not EOF"),A}function i(){return O(s)}function s(){return o("linear-gradient",e.linearGradient,u,Ko)||o("repeating-linear-gradient",e.repeatingLinearGradient,u,Ko)||o("radial-gradient",e.radialGradient,g)||o("repeating-radial-gradient",e.repeatingRadialGradient,g)}function o(A,N,H,M){return a(N,function(Oe){var ct=H();return ct?re(e.comma)||n("Missing comma before color stops"):ct=M,{type:A,orientation:ct,colorStops:O(k)}})}function a(A,N){var H=re(A);if(H){re(e.startCall)||n("Missing (");var M=N(H);return re(e.endCall)||n("Missing )"),M}}function u(){return l()||f()||d()}function l(){return Q("directional",e.sideOrCorner,1)}function f(){return Q("angular",e.angleValue,1)}function d(){return Q("directional",e.zeroValue,0)}function g(){var A,N=p(),H;return N&&(A=[],A.push(N),H=t,re(e.comma)&&(N=p(),N?A.push(N):t=H)),A}function p(){var A=h()||v();if(A)A.at=b();else{var N=w();if(N){A=N;var H=b();H&&(A.at=H)}else{var M=y();M&&(A={type:"default-radial",at:M})}}return A}function h(){var A=Q("shape",/^(circle)/i,0);return A&&(A.style=te()||w()),A}function v(){var A=Q("shape",/^(ellipse)/i,0);return A&&(A.style=W()||w()),A}function w(){return Q("extent-keyword",e.extentKeywords,1)}function b(){if(Q("position",/^at/,0)){var A=y();return A||n("Missing positioning value"),A}}function y(){var A=_();if(A.x||A.y)return{type:"position",value:A}}function _(){return{x:W(),y:W()}}function O(A){var N=A(),H=[];if(N)for(H.push(N);re(e.comma);)N=A(),N?H.push(N):n("One extra comma");return H}function k(){var A=C();return A||n("Expected color definition"),A.length=W(),A}function C(){return L()||G()||F()||D()}function D(){return Q("literal",e.literalColor,0)}function L(){return Q("hex",e.hexColor,1)}function F(){return a(e.rgbColor,function(){return{type:"rgb",value:O(B)}})}function G(){return a(e.rgbaColor,function(){return{type:"rgba",value:O(B)}})}function B(){return re(e.number)[1]}function W(){return Q("%",e.percentageValue,1)||$()||te()}function $(){return Q("position-keyword",e.positionKeywords,1)}function te(){return Q("px",e.pixelValue,1)||Q("em",e.emValue,1)}function Q(A,N,H){var M=re(N);if(M)return{type:A,value:M[H]}}function re(A){var N,H;return H=/^[\n\r\t\s]+/.exec(t),H&&ie(H[0].length),N=A.exec(t),N&&ie(N[0].length),N}function ie(A){t=t.substr(A)}return function(A){return t=A.toString(),r()}}();var vn=gn;function Ol(e){return e.type==="literal"?e.value:e.type==="hex"?`#${e.value}`:e.type==="rgb"?`rgb(${e.value.join(",")})`:e.type==="rgba"?`rgba(${e.value.join(",")})`:"transparent"}function El(e){let t=0,n=0,r=0,i=0;return e.includes("top")?n=1:e.includes("bottom")&&(i=1),e.includes("left")?t=1:e.includes("right")&&(r=1),!t&&!r&&!n&&!i&&(n=1),[t,n,r,i]}function Pl(e,t){return typeof e=="string"&&e.endsWith("%")?t*parseFloat(e)/100:+e}function bn(e,{x:t,y:n,defaultX:r,defaultY:i}){return(e?e.split(" ").map(s=>{try{let o=new Ge(s);return o.type==="length"||o.type==="number"?o.value:o.value+o.unit}catch{return null}}).filter(s=>s!==null):[r,i]).map((s,o)=>Pl(s,[t,n][o]))}function Jo(e,t){let n=[];for(let o of t){let a=Ol(o);if(!n.length&&(n.push({offset:0,color:a}),typeof o.length>"u"||o.length.value==="0"))continue;let u=typeof o.length>"u"?void 0:o.length.type==="%"?o.length.value/100:o.length.value/e;n.push({offset:u,color:a})}n.length||n.push({offset:0,color:"transparent"});let r=n[n.length-1];r.offset!==1&&(typeof r.offset>"u"?r.offset=1:n.push({offset:1,color:r.color}));let i=0,s=1;for(let o=0;o<n.length;o++)if(typeof n[o].offset>"u"){for(s<o&&(s=o);typeof n[s].offset>"u";)s++;n[o].offset=(n[s].offset-n[i].offset)/(s-i)*(o-i)+n[i].offset}else i=o;return n}async function yn({id:e,width:t,height:n,left:r,top:i},{image:s,size:o,position:a,repeat:u}){u=u||"repeat";let l=u==="repeat-x"||u==="repeat",f=u==="repeat-y"||u==="repeat",d=bn(o,{x:t,y:n,defaultX:t,defaultY:n}),g=bn(a,{x:t,y:n,defaultX:0,defaultY:0});if(s.startsWith("linear-gradient(")){let p=vn.parse(s)[0],[h,v]=d,w,b,y,_;if(p.orientation.type==="directional")[w,b,y,_]=El(p.orientation.value);else if(p.orientation.type==="angular"){let L=+p.orientation.value/180*Math.PI-Math.PI/2,F=Math.cos(L),G=Math.sin(L);w=0,b=0,y=F,_=G,y<0&&(w-=y,y=0),_<0&&(b-=_,_=0)}let O=Jo(t,p.colorStops),k=`satori_bi${e}`,C=`satori_pattern_${e}`,D=I("pattern",{id:C,x:g[0]/t,y:g[1]/n,width:l?h/t:"1",height:f?v/n:"1",patternUnits:"objectBoundingBox"},I("linearGradient",{id:k,x1:w,y1:b,x2:y,y2:_},O.map(L=>I("stop",{offset:L.offset*100+"%","stop-color":L.color})).join(""))+I("rect",{x:0,y:0,width:h,height:v,fill:`url(#${k})`}));return[C,D]}if(s.startsWith("radial-gradient(")){let p=vn.parse(s)[0],h=p.orientation[0],[v,w]=d,b="circle",y=v/2,_=w/2;if(h.type==="shape"){if(b=h.value,h.at)if(h.at.type==="position")y=h.at.value.x.value,_=h.at.value.y.value;else throw new Error("orientation.at.type not implemented: "+h.at.type)}else throw new Error("orientation.type not implemented: "+h.type);let O=Jo(t,p.colorStops),k=`satori_radial_${e}`,C=`satori_pattern_${e}`,D=`satori_mask_${e}`,L={},F=Math.max(Math.abs(v-y),Math.abs(y)),G=Math.max(Math.abs(w-_),Math.abs(_));if(b==="circle")L.r=Math.sqrt(F*F+G*G);else if(b==="ellipse"){let $=G!==0?F/G:1;L.ry=Math.sqrt(F*F+G*G*$*$)/$,L.rx=L.ry*$}let B=I("pattern",{id:C,x:g[0]/t,y:g[1]/n,width:l?v/t:"1",height:f?w/n:"1",patternUnits:"objectBoundingBox"},I("radialGradient",{id:k},O.map($=>I("stop",{offset:$.offset,"stop-color":$.color})).join(""))+I("mask",{id:D},I("rect",{x:0,y:0,width:v,height:w,fill:"#fff"}))+I(b,{cx:y,cy:_,width:v,height:w,...L,fill:`url(#${k})`,mask:`url(#${D})`}));return[C,B]}if(s.startsWith("url(")){let p=bn(o,{x:t,y:n,defaultX:0,defaultY:0}),[h,v,w]=await yr(s.slice(4,-1)),b=p[0]||v,y=p[1]||w;return[`satori_bi${e}`,I("pattern",{id:`satori_bi${e}`,patternContentUnits:"userSpaceOnUse",patternUnits:"userSpaceOnUse",x:g[0]+r,y:g[1]+i,width:l?b:"100%",height:f?y:"100%"},I("image",{x:0,y:0,width:b,height:y,preserveAspectRatio:"none",href:h}))]}throw new Error(`Invalid background image: "${s}"`)}c();function Al([e,t]){return Math.round(e*1e3)===0&&Math.round(t*1e3)===0?0:Math.round(e*t/Math.sqrt(e*e+t*t)*1e3)/1e3}function xr(e,t,n){return n<e+t&&(n/2<e&&n/2<t?e=t=n/2:n/2<e?e=n-t:n/2<t&&(t=n-e)),[e,t]}function wr(e){e[0]=e[1]=Math.min(e[0],e[1])}function _r(e,t,n,r,i){if(typeof e=="string"){let s=e.split(" ").map(a=>a.trim()),o=!s[1]&&!s[0].endsWith("%");return s[1]=s[1]||s[0],[o,[Math.min(be(s[0],r,t,i,!0),t),Math.min(be(s[1],r,n,i,!0),n)]]}return typeof e=="number"?[!0,[Math.min(e,t),Math.min(e,n)]]:[!0,void 0]}function it({left:e,top:t,width:n,height:r},i,s){let{borderTopLeftRadius:o,borderTopRightRadius:a,borderBottomLeftRadius:u,borderBottomRightRadius:l,fontSize:f}=i,d,g,p,h;if([d,o]=_r(o,n,r,f,i),[g,a]=_r(a,n,r,f,i),[p,u]=_r(u,n,r,f,i),[h,l]=_r(l,n,r,f,i),!s&&!o&&!a&&!u&&!l)return"";o||(o=[0,0]),a||(a=[0,0]),u||(u=[0,0]),l||(l=[0,0]),[o[0],a[0]]=xr(o[0],a[0],n),[u[0],l[0]]=xr(u[0],l[0],n),[o[1],u[1]]=xr(o[1],u[1],r),[a[1],l[1]]=xr(a[1],l[1],r),d&&wr(o),g&&wr(a),p&&wr(u),h&&wr(l);let v=[];v[0]=[a,a],v[1]=[l,[-l[0],l[1]]],v[2]=[u,[-u[0],-u[1]]],v[3]=[o,[o[0],-o[1]]];let w=`h${n-o[0]-a[0]} a${v[0][0]} 0 0 1 ${v[0][1]}`,b=`v${r-a[1]-l[1]} a${v[1][0]} 0 0 1 ${v[1][1]}`,y=`h${l[0]+u[0]-n} a${v[2][0]} 0 0 1 ${v[2][1]}`,_=`v${u[1]+o[1]-r} a${v[3][0]} 0 0 1 ${v[3][1]}`;if(s){let k=function(W){let $=Al([o,a,l,u][W]);return W===0?[[e+o[0]-$,t+o[1]-$],[e+o[0],t]]:W===1?[[e+n-a[0]+$,t+a[1]-$],[e+n,t+a[1]]]:W===2?[[e+n-l[0]+$,t+r-l[1]+$],[e+n-l[0],t+r]]:[[e+u[0]-$,t+r-u[1]+$],[e,t+r-u[1]]]},O=s.indexOf(!1);if(!s.includes(!0))throw new Error("Invalid `partialSides`.");if(O===-1)O=0;else for(;!s[O];)O=(O+1)%4;let C="",D=k(O),L=`M${D[0]} A${v[(O+3)%4][0]} 0 0 1 ${D[1]}`,F=0;for(;F<4&&s[(O+F)%4];F++)C+=L+" ",L=[w,b,y,_][(O+F)%4];let G=(O+F)%4;C+=L.split(" ")[0];let B=k(G);return C+=` A${v[(G+3)%4][0]} 0 0 1 ${B[0]}`,C}return`M${e+o[0]},${t} ${w} ${b} ${y} ${_}`}c();c();c();function Zo(e,t,n){return n[e+"Width"]===n[t+"Width"]&&n[e+"Style"]===n[t+"Style"]&&n[e+"Color"]===n[t+"Color"]}function es({id:e,currentClipPathId:t,borderPath:n,borderType:r,left:i,top:s,width:o,height:a},u){if(!(u.borderTopWidth||u.borderRightWidth||u.borderBottomWidth||u.borderLeftWidth))return null;let f=`satori_bc-${e}`;return[I("clipPath",{id:f,"clip-path":t?`url(#${t})`:void 0},I(r,{x:i,y:s,width:o,height:a,d:n||void 0})),f]}function wt({left:e,top:t,width:n,height:r,props:i,asContentMask:s,maskBorderOnly:o},a){let u=["borderTop","borderRight","borderBottom","borderLeft"];if(!s&&!u.some(p=>a[p+"Width"]))return"";let l="",f=0;for(;f>0&&Zo(u[f],u[(f+3)%4],a);)f=(f+3)%4;let d=[!1,!1,!1,!1],g=[];for(let p=0;p<4;p++){let h=(f+p)%4,v=(f+p+1)%4,w=u[h],b=u[v];if(d[h]=!0,g=[a[w+"Width"],a[w+"Style"],a[w+"Color"],w],!Zo(w,b,a)){let y=(g[0]||0)+(s&&!o&&a[w.replace("border","padding")]||0);y&&(l+=I("path",{width:n,height:r,...i,fill:"none",stroke:s?"#000":g[2],"stroke-width":y*2,"stroke-dasharray":!s&&g[1]==="dashed"?y*2+" "+y:void 0,d:it({left:e,top:t,width:n,height:r},a,d)})),d=[!1,!1,!1,!1]}}if(d.some(Boolean)){let p=(g[0]||0)+(s&&!o&&a[g[3].replace("border","padding")]||0);p&&(l+=I("path",{width:n,height:r,...i,fill:"none",stroke:s?"#000":g[2],"stroke-width":p*2,"stroke-dasharray":!s&&g[1]==="dashed"?p*2+" "+p:void 0,d:it({left:e,top:t,width:n,height:r},a,d)}))}return l}function xn({id:e,left:t,top:n,width:r,height:i,matrix:s,borderOnly:o},a){let u=(a.borderLeftWidth||0)+(o?0:a.paddingLeft||0),l=(a.borderTopWidth||0)+(o?0:a.paddingTop||0),f=(a.borderRightWidth||0)+(o?0:a.paddingRight||0),d=(a.borderBottomWidth||0)+(o?0:a.paddingBottom||0),g={x:t+u,y:n+l,width:r-u-f,height:i-l-d};return I("mask",{id:e},I("rect",{...g,fill:"#fff",mask:a._inheritedMaskId?`url(#${a._inheritedMaskId})`:void 0})+wt({left:t,top:n,width:r,height:i,props:{transform:s||void 0},asContentMask:!0,maskBorderOnly:o},a))}function wn({left:e,top:t,width:n,height:r,path:i,matrix:s,id:o,currentClipPath:a,src:u},l){if(l.overflow!=="hidden"&&!u)return"";let f=xn({id:`satori_om-${o}`,left:e,top:t,width:n,height:r,matrix:s,borderOnly:!u},l);return I("clipPath",{id:`satori_cp-${o}`,"clip-path":a},I(i?"path":"rect",{x:e,y:t,width:n,height:r,d:i||void 0}))+f}async function _t({id:e,left:t,top:n,width:r,height:i,isInheritingTransform:s,src:o,debug:a},u){if(u.display==="none")return"";let l=!!o,f="rect",d="",g="",p=[],h=1,v="";u.backgroundColor&&p.push(u.backgroundColor),u.opacity!==void 0&&(h=+u.opacity),u.transform&&(d=xt({left:t,top:n,width:r,height:i},u.transform,s,u.transformOrigin));let w="";if(u.backgroundImage){let B=[];for(let W=0;W<u.backgroundImage.length;W++){let $=u.backgroundImage[W],te=await yn({id:e+"_"+W,width:r,height:i,left:t,top:n},$);te&&B.unshift(te)}for(let W of B)p.push(`url(#${W[0]})`),g+=W[1],W[2]&&(w+=W[2])}let b=it({left:t,top:n,width:r,height:i},u);b&&(f="path");let y=u._inheritedClipPathId,_=u._inheritedMaskId;a&&(v=I("rect",{x:t,y:n,width:r,height:i,fill:"transparent",stroke:"#ff5757","stroke-width":1,transform:d||void 0,"clip-path":y?`url(#${y})`:void 0}));let{backgroundClip:O,filter:k}=u,C=O==="text"?`url(#satori_bct-${e})`:y?`url(#${y})`:void 0,D=wn({left:t,top:n,width:r,height:i,path:b,id:e,matrix:d,currentClipPath:C,src:o},u),L=p.map(B=>I(f,{x:t,y:n,width:r,height:i,fill:B,d:b||void 0,transform:d||void 0,"clip-path":C,style:k?`filter:${k}`:void 0,mask:_?`url(#${_})`:void 0})).join(""),F=es({id:e,left:t,top:n,width:r,height:i,currentClipPathId:y,borderPath:b,borderType:f},u);if(l){let B=(u.borderLeftWidth||0)+(u.paddingLeft||0),W=(u.borderTopWidth||0)+(u.paddingTop||0),$=(u.borderRightWidth||0)+(u.paddingRight||0),te=(u.borderBottomWidth||0)+(u.paddingBottom||0),Q=u.objectFit==="contain"?"xMidYMid":u.objectFit==="cover"?"xMidYMid slice":"none";L+=I("image",{x:t+B,y:n+W,width:r-B-$,height:i-W-te,href:o,preserveAspectRatio:Q,transform:d||void 0,style:k?`filter:${k}`:void 0,"clip-path":`url(#satori_cp-${e})`,mask:`url(#satori_om-${e})`})}if(F){g+=F[0];let B=F[1];L+=wt({left:t,top:n,width:r,height:i,props:{transform:d||void 0,"clip-path":`url(#${B})`}},u)}let G=Qo({width:r,height:i,id:e,opacity:h,shape:I(f,{x:t,y:n,width:r,height:i,fill:"#fff",stroke:"#fff","stroke-width":0,d:b||void 0,transform:d||void 0,"clip-path":C,mask:_?`url(#${_})`:void 0})},u);return(g?I("defs",{},g):"")+(G?G[0]:"")+D+(h!==1?`<g opacity="${h}">`:"")+(w||L)+(h!==1?"</g>":"")+(G?G[1]:"")+v}c();var ts=pt(require("emoji-regex"),1),Il=new RegExp((0,ts.default)(),""),_n={emoji:Il,symbol:/\p{Symbol}/u,math:/\p{Math}/u},St={"ja-JP":/\p{scx=Hira}|\p{scx=Kana}|\p{scx=Han}|[\u3000]|[\uFF00-\uFFEF]/u,"ko-KR":/\p{scx=Hangul}/u,"zh-CN":/\p{scx=Han}/u,"zh-TW":/\p{scx=Han}/u,"zh-HK":/\p{scx=Han}/u,"th-TH":/\p{scx=Thai}/u,"bn-IN":/\p{scx=Bengali}/u,"ar-AR":/\p{scx=Arabic}/u,"ta-IN":/\p{scx=Tamil}/u,"ml-IN":/\p{scx=Malayalam}/u,"he-IL":/\p{scx=Hebrew}/u,"te-IN":/\p{scx=Telugu}/u,devanagari:/\p{scx=Devanagari}/u,kannada:/\p{scx=Kannada}/u},Sr=Object.keys({...St,..._n});function rs(e){return Sr.includes(e)}function ns(e,t){if(t&&St[t]&&St[t].test(e))return t;for(let n of Object.keys(_n))if(_n[n].test(e))return n;for(let n of Object.keys(St))if(St[n].test(e))return n;return"unknown"}function is(e){if(e)return Sr.find(t=>t.toLowerCase()===e.toLowerCase()||t.toLowerCase().startsWith(e.toLowerCase()))}async function*kt(e,t){let n=Fe(),{id:r,inheritedStyle:i,parent:s,font:o,debug:a,locale:u,embedFont:l=!0,graphemeImages:f,canLoadAdditionalAssets:d,getTwStyles:g}=t;if(e===null||typeof e>"u")return yield,yield,"";if(!on(e)||typeof e.type=="function"){let M;if(!on(e))M=mn(String(e),t),yield(await M.next()).value;else{if(Ao(e.type))throw new Error("Class component is not supported.");M=kt(e.type(e.props),t),yield(await M.next()).value}await M.next();let Oe=yield;return(await M.next(Oe)).value}let{type:p,props:h}=e;if(h&&Io(h))throw new Error("dangerouslySetInnerHTML property is not supported. See documentation for more information https://github.com/vercel/satori#jsx.");let{style:v,children:w,tw:b,lang:y=u}=h||{},_=is(y);if(b){let M=g(b,v);v=Object.assign(M,v)}let O=n.Node.create();s.insertChild(O,s.getChildCount());let[k,C]=await dn(O,p,i,v,h),D=k.transform===i.transform;if(D||(k.transform.__parent=i.transform),k.overflow==="hidden"&&(C._inheritedClipPathId=`satori_cp-${r}`,C._inheritedMaskId=`satori_om-${r}`),k.backgroundClip==="text"){let M={value:""};C._inheritedBackgroundClipTextPath=M,k._inheritedBackgroundClipTextPath=M}let L=Ro(w),F=[],G=0,B=[];for(let M of L){let Oe=kt(M,{id:r+"-"+G++,parentStyle:k,inheritedStyle:C,isInheritingTransform:!0,parent:O,font:o,embedFont:l,debug:a,graphemeImages:f,canLoadAdditionalAssets:d,locale:_,getTwStyles:g});d?B.push(...(await Oe.next()).value||[]):await Oe.next(),F.push(Oe)}yield B;for(let M of F)await M.next();let[W,$]=yield,{left:te,top:Q,width:re,height:ie}=O.getComputedLayout();te+=W,Q+=$;let A="",N="",H="";if(p==="img"){let M=k.__src;N=await _t({id:r,left:te,top:Q,width:re,height:ie,src:M,isInheritingTransform:D,debug:a},k)}else if(p==="svg"){let M=k.color,Oe=Do(e,M);N=await _t({id:r,left:te,top:Q,width:re,height:ie,src:Oe,isInheritingTransform:D,debug:a},k)}else{let M=v==null?void 0:v.display;if(p==="div"&&w&&typeof w!="string"&&M!=="flex"&&M!=="none")throw new Error('Expected <div> to have explicit "display: flex" or "display: none" if it has more than one child node.');N=await _t({id:r,left:te,top:Q,width:re,height:ie,isInheritingTransform:D,debug:a},k)}for(let M of F)A+=(await M.next([te,Q])).value;return k._inheritedBackgroundClipTextPath&&(H+=I("clipPath",{id:`satori_bct-${r}`,"clip-path":k._inheritedClipPathId?`url(#${k._inheritedClipPathId})`:void 0},k._inheritedBackgroundClipTextPath.value)),H+N+A}c();var kr=pt(require("@shuding/opentype.js"),1);var os="unknown";function Rl(e,t,[n,r],[i,s]){if(n!==i)return n?!i||n===e?-1:i===e?1:e===400&&n===500||e===500&&n===400?-1:e===400&&i===500||e===500&&i===400?1:e<400?n<e&&i<e?i-n:n<e?-1:i<e?1:n-i:e<n&&e<i?n-i:e<n?-1:e<i?1:i-n:1;if(r!==s){if(r===t)return-1;if(s===t)return 1}return-1}var Tt=class{constructor(t){this.fonts=new Map;this.addFonts(t)}get({name:t,weight:n,style:r}){if(!this.fonts.has(t))return null;n==="normal"&&(n=400),n==="bold"&&(n=700),typeof n=="string"&&(n=Number.parseInt(n,10));let i=[...this.fonts.get(t)],s=i[0];for(let o=1;o<i.length;o++){let[,a,u]=s,[,l,f]=i[o];Rl(n,r,[a,u],[l,f])>0&&(s=i[o])}return s[0]}addFonts(t){for(let n of t){let{name:r,data:i,lang:s}=n;if(s&&!rs(s))throw new Error(`Invalid value for props \`lang\`: "${s}". The value must be one of the following: ${Sr.join(", ")}.`);let o=s!=null?s:os,a=kr.default.parse("buffer"in i?i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength):i,{lowMemory:!0}),u=a.charToGlyphIndex;a.charToGlyphIndex=f=>{let d=u.call(a,f);return d===0&&a._trackBrokenChars&&a._trackBrokenChars.push(f),d},this.defaultFont||(this.defaultFont=a);let l=`${r.toLowerCase()}_${o}`;this.fonts.has(l)||this.fonts.set(l,[]),this.fonts.get(l).push([a,n.weight,n.style])}}getEngine(t=16,n=1.2,{fontFamily:r,fontWeight:i=400,fontStyle:s="normal"},o){if(!this.fonts.size)throw new Error("No fonts are loaded. At least one font is required to calculate the layout.");r=(Array.isArray(r)?r:[r]).map(y=>y.toLowerCase());let a=r.map(y=>this.get({name:y,weight:i,style:s})).filter(Boolean),u=Array.from(this.fonts.keys()),l=[],f=[],d=[];for(let y of u)if(!r.includes(y))if(o){let _=Ll(y);_?_===o?l.push(this.get({name:y,weight:i,style:s})):f.push(this.get({name:y,weight:i,style:s})):d.push(this.get({name:y,weight:i,style:s}))}else d.push(this.get({name:y,weight:i,style:s}));let g=new Map,p=(y,_=!0)=>{let O=y.charCodeAt(0);if(g.has(O))return g.get(O);let k=[...a,...d,...l,..._?f:[]],C=k.find((D,L)=>!!D.charToGlyphIndex(y)||_&&L===k.length-1);return C&&g.set(O,C),C},h=(y,_=!1)=>{var k,C;return((_?(C=(k=y.tables)==null?void 0:k.os2)==null?void 0:C.sTypoAscender:0)||y.ascender)/y.unitsPerEm*t},v=(y,_=!1)=>{var k,C;return((_?(C=(k=y.tables)==null?void 0:k.os2)==null?void 0:C.sTypoDescender:0)||y.descender)/y.unitsPerEm*t},w=y=>p(y,!1),b={has:y=>{if(y===`
8
+ `;if(Bu&&vt.includes(se[0])&&!Ee)V||(V=" "),de=re([V]),te[De]=null;else{let he=Ee?0:d&&d[se]?r.fontSize:re([se]);Ee&&J===0&&(J=F.height(se)),oe||(V="",de=0);let ae=de||",.!?:-@)>]}%#".indexOf(se[0])<0,le=!oe||!!de,ze=De&&ae&&oe+de+he>q&&O!=="nowrap"&&O!=="pre";if(h&&he>q&&(!oe||ze||Ee)){let Xe=Me(se,"grapheme");w.splice(De,1,"",...Xe),oe>0&&(B.push(oe),W.push(Ce),K++,Ue+=J,oe=0,J=0,Ce=0,$.push(1),fe=-1);continue}if(Ee||ze)B.push(oe),W.push(Ce),K++,Ue+=J,oe=he,J=he?F.height(se):0,Ce=he?F.baseline(se):0,$.push(1),fe=-1,Ee||(pe=Math.max(pe,q));else{oe+=de+he;let Xe=F.height(se);Xe>J&&(J=Xe,Ce=F.baseline(se)),le&&$[$.length-1]++}V="",de=0,le&&fe++,pe=Math.max(pe,oe),te[De]={y:Ue,x:oe-he,width:he,line:K,lineIndex:fe}}}return oe&&(K++,B.push(oe),W.push(Ce),Ue+=J),{width:pe,height:Ue}});let[Uu,zu]=yield,Vr="",ar="",qe=i._inheritedClipPathId,ho=i._inheritedMaskId,{left:mo,top:go,width:ur,height:vo}=b.getComputedLayout(),Hr=s.getComputedWidth()-s.getComputedPadding(n.EDGE_LEFT)-s.getComputedPadding(n.EDGE_RIGHT)-s.getComputedBorder(n.EDGE_LEFT)-s.getComputedBorder(n.EDGE_RIGHT),rt=Uu+mo,nt=zu+go,{matrix:Le,opacity:lr}=Yo({left:mo,top:go,width:ur,height:vo,isInheritingTransform:u},r),fr="";r.textShadowOffset&&(fr=Xo({width:ur,height:vo,id:a},{shadowColor:r.textShadowColor,shadowOffset:r.textShadowOffset,shadowRadius:r.textShadowRadius}));let dt="",cr="",bo="",jr=-1,yo=_==="ellipsis"?re(["\u2026"]):0,Gu=_==="ellipsis"?re([" "]):0,dr={},Be=null,xo=0;for(let q=0;q<w.length;q++){if(!te[q])continue;let K=te[q],V=w[q],de=null,oe=d?d[V]:null,pe=K.y,fe=K.x,Ue=K.width,J=K.line;if(J===jr)continue;let Ce=!1;if(B.length>1){let ae=ur-B[J];if(y==="right"||y==="end")fe+=ae;else if(y==="center")fe+=ae/2;else if(y==="justify"&&J<B.length-1){let le=$[J];fe+=(le>1?ae/(le-1):0)*K.lineIndex,Ce=!0}}if(dr[J]||(dr[J]=[fe,Ce?ur:B[J]]),_==="ellipsis"&&B[J]>Hr&&K.x+Ue+yo+Gu>Hr){let ae=Me(V,"grapheme",g),le="",ze=0;for(let Yr of ae){let Xe=K.x+re([le+Yr]);if(le&&Xe+yo>Hr)break;le+=Yr,ze=Xe}V=le+"\u2026",jr=J,dr[J][1]=ze}let De=W[J],se=F.baseline(V),Ee=F.height(V),he=De-se;if(oe)pe+=0;else if(f){if(!vt.includes(V)&&w[q+1]&&!d[w[q+1]]&&te[q+1]&&pe===te[q+1].y){Be===null&&(xo=fe),Be=Be===null?V:Be+V;continue}let ae=Be===null?V:Be+V,le=Be===null?fe:xo,ze=K.width+fe-le;de=F.getSVG(ae,{...r,left:rt+le,top:nt+pe+se+he,letterSpacing:r.letterSpacing}),Be=null,l&&(bo+=I("rect",{x:rt+le,y:nt+pe+he,width:ze,height:Ee,fill:"transparent",stroke:"#575eff","stroke-width":1,transform:Le||void 0,"clip-path":qe?`url(#${qe})`:void 0})+I("line",{x1:rt+fe,x2:rt+fe+K.width,y1:nt+pe+he+se,y2:nt+pe+he+se,stroke:"#14c000","stroke-width":1,transform:Le||void 0,"clip-path":qe?`url(#${qe})`:void 0}))}else pe+=se+he;if(r.textDecorationLine&&(J!==((wo=te[q+1])==null?void 0:wo.line)||jr===J)){let ae=dr[J];ae&&!ae[2]&&(dt+=hn({left:rt+ae[0],top:nt+Ee*+J,width:ae[1],ascender:F.baseline(V),clipPathId:qe},r),ae[2]=1)}if(de!==null)cr+=de+" ";else{let[ae,le]=pn({content:V,filter:fr,id:a,left:rt+fe,top:nt+pe,width:Ue,height:Ee,matrix:Le,opacity:lr,image:oe,clipPathId:qe,debug:l,shape:!!D,decorationShape:dt},r);Vr+=ae,ar+=le,dt=""}}if(cr){let q=r.color!=="transparent"&&lr!==0?I("path",{fill:r.color,d:cr,transform:Le||void 0,opacity:lr!==1?lr:void 0,"clip-path":qe?`url(#${qe})`:void 0,mask:ho?`url(#${ho})`:void 0,style:C?`filter:${C}`:void 0}):"";D&&(ar=I("path",{d:cr,transform:Le||void 0})),Vr+=(fr?fr+I("g",{filter:`url(#satori_s-${a})`},q+dt):q+dt)+bo}return ar&&(r._inheritedBackgroundClipTextPath.value+=ar),Vr}c();c();c();var gn=gn||{},Ko={type:"directional",value:"bottom"};gn.parse=function(){var e={linearGradient:/^(\-(webkit|o|ms|moz)\-)?(linear\-gradient)/i,repeatingLinearGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-linear\-gradient)/i,radialGradient:/^(\-(webkit|o|ms|moz)\-)?(radial\-gradient)/i,repeatingRadialGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-radial\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,zeroValue:/[0]/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/},t="";function n(A){var N=new Error(t+": "+A);throw N.source=t,N}function r(){var A=i();return t.length>0&&n("Invalid input not EOF"),A}function i(){return O(s)}function s(){return o("linear-gradient",e.linearGradient,u,Ko)||o("repeating-linear-gradient",e.repeatingLinearGradient,u,Ko)||o("radial-gradient",e.radialGradient,g)||o("repeating-radial-gradient",e.repeatingRadialGradient,g)}function o(A,N,H,M){return a(N,function(Oe){var ct=H();return ct?re(e.comma)||n("Missing comma before color stops"):ct=M,{type:A,orientation:ct,colorStops:O(k)}})}function a(A,N){var H=re(A);if(H){re(e.startCall)||n("Missing (");var M=N(H);return re(e.endCall)||n("Missing )"),M}}function u(){return l()||f()||d()}function l(){return Q("directional",e.sideOrCorner,1)}function f(){return Q("angular",e.angleValue,1)}function d(){return Q("directional",e.zeroValue,0)}function g(){var A,N=p(),H;return N&&(A=[],A.push(N),H=t,re(e.comma)&&(N=p(),N?A.push(N):t=H)),A}function p(){var A=h()||v();if(A)A.at=b();else{var N=w();if(N){A=N;var H=b();H&&(A.at=H)}else{var M=y();M&&(A={type:"default-radial",at:M})}}return A}function h(){var A=Q("shape",/^(circle)/i,0);return A&&(A.style=te()||w()),A}function v(){var A=Q("shape",/^(ellipse)/i,0);return A&&(A.style=W()||w()),A}function w(){return Q("extent-keyword",e.extentKeywords,1)}function b(){if(Q("position",/^at/,0)){var A=y();return A||n("Missing positioning value"),A}}function y(){var A=_();if(A.x||A.y)return{type:"position",value:A}}function _(){return{x:W(),y:W()}}function O(A){var N=A(),H=[];if(N)for(H.push(N);re(e.comma);)N=A(),N?H.push(N):n("One extra comma");return H}function k(){var A=C();return A||n("Expected color definition"),A.length=W(),A}function C(){return L()||G()||F()||D()}function D(){return Q("literal",e.literalColor,0)}function L(){return Q("hex",e.hexColor,1)}function F(){return a(e.rgbColor,function(){return{type:"rgb",value:O(B)}})}function G(){return a(e.rgbaColor,function(){return{type:"rgba",value:O(B)}})}function B(){return re(e.number)[1]}function W(){return Q("%",e.percentageValue,1)||$()||te()}function $(){return Q("position-keyword",e.positionKeywords,1)}function te(){return Q("px",e.pixelValue,1)||Q("em",e.emValue,1)}function Q(A,N,H){var M=re(N);if(M)return{type:A,value:M[H]}}function re(A){var N,H;return H=/^[\n\r\t\s]+/.exec(t),H&&ie(H[0].length),N=A.exec(t),N&&ie(N[0].length),N}function ie(A){t=t.substr(A)}return function(A){return t=A.toString(),r()}}();var vn=gn;function Ol(e){return e.type==="literal"?e.value:e.type==="hex"?`#${e.value}`:e.type==="rgb"?`rgb(${e.value.join(",")})`:e.type==="rgba"?`rgba(${e.value.join(",")})`:"transparent"}function El(e){let t=0,n=0,r=0,i=0;return e.includes("top")?n=1:e.includes("bottom")&&(i=1),e.includes("left")?t=1:e.includes("right")&&(r=1),!t&&!r&&!n&&!i&&(n=1),[t,n,r,i]}function Pl(e,t){return typeof e=="string"&&e.endsWith("%")?t*parseFloat(e)/100:+e}function bn(e,{x:t,y:n,defaultX:r,defaultY:i}){return(e?e.split(" ").map(s=>{try{let o=new Ge(s);return o.type==="length"||o.type==="number"?o.value:o.value+o.unit}catch{return null}}).filter(s=>s!==null):[r,i]).map((s,o)=>Pl(s,[t,n][o]))}function Jo(e,t){let n=[];for(let o of t){let a=Ol(o);if(!n.length&&(n.push({offset:0,color:a}),typeof o.length>"u"||o.length.value==="0"))continue;let u=typeof o.length>"u"?void 0:o.length.type==="%"?o.length.value/100:o.length.value/e;n.push({offset:u,color:a})}n.length||n.push({offset:0,color:"transparent"});let r=n[n.length-1];r.offset!==1&&(typeof r.offset>"u"?r.offset=1:n.push({offset:1,color:r.color}));let i=0,s=1;for(let o=0;o<n.length;o++)if(typeof n[o].offset>"u"){for(s<o&&(s=o);typeof n[s].offset>"u";)s++;n[o].offset=(n[s].offset-n[i].offset)/(s-i)*(o-i)+n[i].offset}else i=o;return n}async function yn({id:e,width:t,height:n,left:r,top:i},{image:s,size:o,position:a,repeat:u}){u=u||"repeat";let l=u==="repeat-x"||u==="repeat",f=u==="repeat-y"||u==="repeat",d=bn(o,{x:t,y:n,defaultX:t,defaultY:n}),g=bn(a,{x:t,y:n,defaultX:0,defaultY:0});if(s.startsWith("linear-gradient(")){let p=vn.parse(s)[0],[h,v]=d,w,b,y,_;if(p.orientation.type==="directional")[w,b,y,_]=El(p.orientation.value);else if(p.orientation.type==="angular"){let L=+p.orientation.value/180*Math.PI-Math.PI/2,F=Math.cos(L),G=Math.sin(L);w=0,b=0,y=F,_=G,y<0&&(w-=y,y=0),_<0&&(b-=_,_=0)}let O=Jo(t,p.colorStops),k=`satori_bi${e}`,C=`satori_pattern_${e}`,D=I("pattern",{id:C,x:g[0]/t,y:g[1]/n,width:l?h/t:"1",height:f?v/n:"1",patternUnits:"objectBoundingBox"},I("linearGradient",{id:k,x1:w,y1:b,x2:y,y2:_},O.map(L=>I("stop",{offset:L.offset*100+"%","stop-color":L.color})).join(""))+I("rect",{x:0,y:0,width:h,height:v,fill:`url(#${k})`}));return[C,D]}if(s.startsWith("radial-gradient(")){let p=vn.parse(s)[0],h=p.orientation[0],[v,w]=d,b="circle",y=v/2,_=w/2;if(h.type==="shape"){if(b=h.value,h.at)if(h.at.type==="position")y=h.at.value.x.value,_=h.at.value.y.value;else throw new Error("orientation.at.type not implemented: "+h.at.type)}else throw new Error("orientation.type not implemented: "+h.type);let O=Jo(t,p.colorStops),k=`satori_radial_${e}`,C=`satori_pattern_${e}`,D=`satori_mask_${e}`,L={},F=Math.max(Math.abs(v-y),Math.abs(y)),G=Math.max(Math.abs(w-_),Math.abs(_));if(b==="circle")L.r=Math.sqrt(F*F+G*G);else if(b==="ellipse"){let $=G!==0?F/G:1;L.ry=Math.sqrt(F*F+G*G*$*$)/$,L.rx=L.ry*$}let B=I("pattern",{id:C,x:g[0]/t,y:g[1]/n,width:l?v/t:"1",height:f?w/n:"1",patternUnits:"objectBoundingBox"},I("radialGradient",{id:k},O.map($=>I("stop",{offset:$.offset,"stop-color":$.color})).join(""))+I("mask",{id:D},I("rect",{x:0,y:0,width:v,height:w,fill:"#fff"}))+I(b,{cx:y,cy:_,width:v,height:w,...L,fill:`url(#${k})`,mask:`url(#${D})`}));return[C,B]}if(s.startsWith("url(")){let p=bn(o,{x:t,y:n,defaultX:0,defaultY:0}),[h,v,w]=await yr(s.slice(4,-1)),b=p[0]||v,y=p[1]||w;return[`satori_bi${e}`,I("pattern",{id:`satori_bi${e}`,patternContentUnits:"userSpaceOnUse",patternUnits:"userSpaceOnUse",x:g[0]+r,y:g[1]+i,width:l?b:"100%",height:f?y:"100%"},I("image",{x:0,y:0,width:b,height:y,preserveAspectRatio:"none",href:h}))]}throw new Error(`Invalid background image: "${s}"`)}c();function Al([e,t]){return Math.round(e*1e3)===0&&Math.round(t*1e3)===0?0:Math.round(e*t/Math.sqrt(e*e+t*t)*1e3)/1e3}function xr(e,t,n){return n<e+t&&(n/2<e&&n/2<t?e=t=n/2:n/2<e?e=n-t:n/2<t&&(t=n-e)),[e,t]}function wr(e){e[0]=e[1]=Math.min(e[0],e[1])}function _r(e,t,n,r,i){if(typeof e=="string"){let s=e.split(" ").map(a=>a.trim()),o=!s[1]&&!s[0].endsWith("%");return s[1]=s[1]||s[0],[o,[Math.min(be(s[0],r,t,i,!0),t),Math.min(be(s[1],r,n,i,!0),n)]]}return typeof e=="number"?[!0,[Math.min(e,t),Math.min(e,n)]]:[!0,void 0]}function it({left:e,top:t,width:n,height:r},i,s){let{borderTopLeftRadius:o,borderTopRightRadius:a,borderBottomLeftRadius:u,borderBottomRightRadius:l,fontSize:f}=i,d,g,p,h;if([d,o]=_r(o,n,r,f,i),[g,a]=_r(a,n,r,f,i),[p,u]=_r(u,n,r,f,i),[h,l]=_r(l,n,r,f,i),!s&&!o&&!a&&!u&&!l)return"";o||(o=[0,0]),a||(a=[0,0]),u||(u=[0,0]),l||(l=[0,0]),[o[0],a[0]]=xr(o[0],a[0],n),[u[0],l[0]]=xr(u[0],l[0],n),[o[1],u[1]]=xr(o[1],u[1],r),[a[1],l[1]]=xr(a[1],l[1],r),d&&wr(o),g&&wr(a),p&&wr(u),h&&wr(l);let v=[];v[0]=[a,a],v[1]=[l,[-l[0],l[1]]],v[2]=[u,[-u[0],-u[1]]],v[3]=[o,[o[0],-o[1]]];let w=`h${n-o[0]-a[0]} a${v[0][0]} 0 0 1 ${v[0][1]}`,b=`v${r-a[1]-l[1]} a${v[1][0]} 0 0 1 ${v[1][1]}`,y=`h${l[0]+u[0]-n} a${v[2][0]} 0 0 1 ${v[2][1]}`,_=`v${u[1]+o[1]-r} a${v[3][0]} 0 0 1 ${v[3][1]}`;if(s){let k=function(W){let $=Al([o,a,l,u][W]);return W===0?[[e+o[0]-$,t+o[1]-$],[e+o[0],t]]:W===1?[[e+n-a[0]+$,t+a[1]-$],[e+n,t+a[1]]]:W===2?[[e+n-l[0]+$,t+r-l[1]+$],[e+n-l[0],t+r]]:[[e+u[0]-$,t+r-u[1]+$],[e,t+r-u[1]]]},O=s.indexOf(!1);if(!s.includes(!0))throw new Error("Invalid `partialSides`.");if(O===-1)O=0;else for(;!s[O];)O=(O+1)%4;let C="",D=k(O),L=`M${D[0]} A${v[(O+3)%4][0]} 0 0 1 ${D[1]}`,F=0;for(;F<4&&s[(O+F)%4];F++)C+=L+" ",L=[w,b,y,_][(O+F)%4];let G=(O+F)%4;C+=L.split(" ")[0];let B=k(G);return C+=` A${v[(G+3)%4][0]} 0 0 1 ${B[0]}`,C}return`M${e+o[0]},${t} ${w} ${b} ${y} ${_}`}c();c();c();function Zo(e,t,n){return n[e+"Width"]===n[t+"Width"]&&n[e+"Style"]===n[t+"Style"]&&n[e+"Color"]===n[t+"Color"]}function es({id:e,currentClipPathId:t,borderPath:n,borderType:r,left:i,top:s,width:o,height:a},u){if(!(u.borderTopWidth||u.borderRightWidth||u.borderBottomWidth||u.borderLeftWidth))return null;let f=`satori_bc-${e}`;return[I("clipPath",{id:f,"clip-path":t?`url(#${t})`:void 0},I(r,{x:i,y:s,width:o,height:a,d:n||void 0})),f]}function wt({left:e,top:t,width:n,height:r,props:i,asContentMask:s,maskBorderOnly:o},a){let u=["borderTop","borderRight","borderBottom","borderLeft"];if(!s&&!u.some(p=>a[p+"Width"]))return"";let l="",f=0;for(;f>0&&Zo(u[f],u[(f+3)%4],a);)f=(f+3)%4;let d=[!1,!1,!1,!1],g=[];for(let p=0;p<4;p++){let h=(f+p)%4,v=(f+p+1)%4,w=u[h],b=u[v];if(d[h]=!0,g=[a[w+"Width"],a[w+"Style"],a[w+"Color"],w],!Zo(w,b,a)){let y=(g[0]||0)+(s&&!o&&a[w.replace("border","padding")]||0);y&&(l+=I("path",{width:n,height:r,...i,fill:"none",stroke:s?"#000":g[2],"stroke-width":y*2,"stroke-dasharray":!s&&g[1]==="dashed"?y*2+" "+y:void 0,d:it({left:e,top:t,width:n,height:r},a,d)})),d=[!1,!1,!1,!1]}}if(d.some(Boolean)){let p=(g[0]||0)+(s&&!o&&a[g[3].replace("border","padding")]||0);p&&(l+=I("path",{width:n,height:r,...i,fill:"none",stroke:s?"#000":g[2],"stroke-width":p*2,"stroke-dasharray":!s&&g[1]==="dashed"?p*2+" "+p:void 0,d:it({left:e,top:t,width:n,height:r},a,d)}))}return l}function xn({id:e,left:t,top:n,width:r,height:i,matrix:s,borderOnly:o},a){let u=(a.borderLeftWidth||0)+(o?0:a.paddingLeft||0),l=(a.borderTopWidth||0)+(o?0:a.paddingTop||0),f=(a.borderRightWidth||0)+(o?0:a.paddingRight||0),d=(a.borderBottomWidth||0)+(o?0:a.paddingBottom||0),g={x:t+u,y:n+l,width:r-u-f,height:i-l-d};return I("mask",{id:e},I("rect",{...g,fill:"#fff",mask:a._inheritedMaskId?`url(#${a._inheritedMaskId})`:void 0})+wt({left:t,top:n,width:r,height:i,props:{transform:s||void 0},asContentMask:!0,maskBorderOnly:o},a))}function wn({left:e,top:t,width:n,height:r,path:i,matrix:s,id:o,currentClipPath:a,src:u},l){if(l.overflow!=="hidden"&&!u)return"";let f=xn({id:`satori_om-${o}`,left:e,top:t,width:n,height:r,matrix:s,borderOnly:!u},l);return I("clipPath",{id:`satori_cp-${o}`,"clip-path":a},I(i?"path":"rect",{x:e,y:t,width:n,height:r,d:i||void 0}))+f}async function _t({id:e,left:t,top:n,width:r,height:i,isInheritingTransform:s,src:o,debug:a},u){if(u.display==="none")return"";let l=!!o,f="rect",d="",g="",p=[],h=1,v="";u.backgroundColor&&p.push(u.backgroundColor),u.opacity!==void 0&&(h=+u.opacity),u.transform&&(d=xt({left:t,top:n,width:r,height:i},u.transform,s,u.transformOrigin));let w="";if(u.backgroundImage){let B=[];for(let W=0;W<u.backgroundImage.length;W++){let $=u.backgroundImage[W],te=await yn({id:e+"_"+W,width:r,height:i,left:t,top:n},$);te&&B.unshift(te)}for(let W of B)p.push(`url(#${W[0]})`),g+=W[1],W[2]&&(w+=W[2])}let b=it({left:t,top:n,width:r,height:i},u);b&&(f="path");let y=u._inheritedClipPathId,_=u._inheritedMaskId;a&&(v=I("rect",{x:t,y:n,width:r,height:i,fill:"transparent",stroke:"#ff5757","stroke-width":1,transform:d||void 0,"clip-path":y?`url(#${y})`:void 0}));let{backgroundClip:O,filter:k}=u,C=O==="text"?`url(#satori_bct-${e})`:y?`url(#${y})`:void 0,D=wn({left:t,top:n,width:r,height:i,path:b,id:e,matrix:d,currentClipPath:C,src:o},u),L=p.map(B=>I(f,{x:t,y:n,width:r,height:i,fill:B,d:b||void 0,transform:d||void 0,"clip-path":C,style:k?`filter:${k}`:void 0,mask:_?`url(#${_})`:void 0})).join(""),F=es({id:e,left:t,top:n,width:r,height:i,currentClipPathId:y,borderPath:b,borderType:f},u);if(l){let B=(u.borderLeftWidth||0)+(u.paddingLeft||0),W=(u.borderTopWidth||0)+(u.paddingTop||0),$=(u.borderRightWidth||0)+(u.paddingRight||0),te=(u.borderBottomWidth||0)+(u.paddingBottom||0),Q=u.objectFit==="contain"?"xMidYMid":u.objectFit==="cover"?"xMidYMid slice":"none";L+=I("image",{x:t+B,y:n+W,width:r-B-$,height:i-W-te,href:o,preserveAspectRatio:Q,transform:d||void 0,style:k?`filter:${k}`:void 0,"clip-path":`url(#satori_cp-${e})`,mask:`url(#satori_om-${e})`})}if(F){g+=F[0];let B=F[1];L+=wt({left:t,top:n,width:r,height:i,props:{transform:d||void 0,"clip-path":`url(#${B})`}},u)}let G=Qo({width:r,height:i,id:e,opacity:h,shape:I(f,{x:t,y:n,width:r,height:i,fill:"#fff",stroke:"#fff","stroke-width":0,d:b||void 0,transform:d||void 0,"clip-path":C,mask:_?`url(#${_})`:void 0})},u);return(g?I("defs",{},g):"")+(G?G[0]:"")+D+(h!==1?`<g opacity="${h}">`:"")+(w||L)+(h!==1?"</g>":"")+(G?G[1]:"")+v}c();var ts=pt(require("emoji-regex"),1),Il=new RegExp((0,ts.default)(),""),_n={emoji:Il,symbol:/\p{Symbol}/u,math:/\p{Math}/u},St={"ja-JP":/\p{scx=Hira}|\p{scx=Kana}|\p{scx=Han}|[\u3000]|[\uFF00-\uFFEF]/u,"ko-KR":/\p{scx=Hangul}/u,"zh-CN":/\p{scx=Han}/u,"zh-TW":/\p{scx=Han}/u,"zh-HK":/\p{scx=Han}/u,"th-TH":/\p{scx=Thai}/u,"bn-IN":/\p{scx=Bengali}/u,"ar-AR":/\p{scx=Arabic}/u,"ta-IN":/\p{scx=Tamil}/u,"ml-IN":/\p{scx=Malayalam}/u,"he-IL":/\p{scx=Hebrew}/u,"te-IN":/\p{scx=Telugu}/u,devanagari:/\p{scx=Devanagari}/u,kannada:/\p{scx=Kannada}/u},Sr=Object.keys({...St,..._n});function rs(e){return Sr.includes(e)}function ns(e,t){if(t&&St[t]&&St[t].test(e))return t;for(let n of Object.keys(_n))if(_n[n].test(e))return n;for(let n of Object.keys(St))if(St[n].test(e))return n;return"unknown"}function is(e){if(e)return Sr.find(t=>t.toLowerCase()===e.toLowerCase()||t.toLowerCase().startsWith(e.toLowerCase()))}async function*kt(e,t){let n=Fe(),{id:r,inheritedStyle:i,parent:s,font:o,debug:a,locale:u,embedFont:l=!0,graphemeImages:f,canLoadAdditionalAssets:d,getTwStyles:g}=t;if(e===null||typeof e>"u")return yield,yield,"";if(!on(e)||typeof e.type=="function"){let M;if(!on(e))M=mn(String(e),t),yield(await M.next()).value;else{if(Ao(e.type))throw new Error("Class component is not supported.");M=kt(e.type(e.props),t),yield(await M.next()).value}await M.next();let Oe=yield;return(await M.next(Oe)).value}let{type:p,props:h}=e;if(h&&Io(h))throw new Error("dangerouslySetInnerHTML property is not supported. See documentation for more information https://github.com/vercel/satori#jsx.");let{style:v,children:w,tw:b,lang:y=u}=h||{},_=is(y);if(b){let M=g(b,v);v=Object.assign(M,v)}let O=n.Node.create();s.insertChild(O,s.getChildCount());let[k,C]=await dn(O,p,i,v,h),D=k.transform===i.transform;if(D||(k.transform.__parent=i.transform),k.overflow==="hidden"&&(C._inheritedClipPathId=`satori_cp-${r}`,C._inheritedMaskId=`satori_om-${r}`),k.backgroundClip==="text"){let M={value:""};C._inheritedBackgroundClipTextPath=M,k._inheritedBackgroundClipTextPath=M}let L=Ro(w),F=[],G=0,B=[];for(let M of L){let Oe=kt(M,{id:r+"-"+G++,parentStyle:k,inheritedStyle:C,isInheritingTransform:!0,parent:O,font:o,embedFont:l,debug:a,graphemeImages:f,canLoadAdditionalAssets:d,locale:_,getTwStyles:g});d?B.push(...(await Oe.next()).value||[]):await Oe.next(),F.push(Oe)}yield B;for(let M of F)await M.next();let[W,$]=yield,{left:te,top:Q,width:re,height:ie}=O.getComputedLayout();te+=W,Q+=$;let A="",N="",H="";if(p==="img"){let M=k.__src;N=await _t({id:r,left:te,top:Q,width:re,height:ie,src:M,isInheritingTransform:D,debug:a},k)}else if(p==="svg"){let M=k.color,Oe=Do(e,M);N=await _t({id:r,left:te,top:Q,width:re,height:ie,src:Oe,isInheritingTransform:D,debug:a},k)}else{let M=v==null?void 0:v.display;if(p==="div"&&w&&typeof w!="string"&&M!=="flex"&&M!=="none")throw new Error('Expected <div> to have explicit "display: flex" or "display: none" if it has more than one child node.');N=await _t({id:r,left:te,top:Q,width:re,height:ie,isInheritingTransform:D,debug:a},k)}for(let M of F)A+=(await M.next([te,Q])).value;return k._inheritedBackgroundClipTextPath&&(H+=I("clipPath",{id:`satori_bct-${r}`,"clip-path":k._inheritedClipPathId?`url(#${k._inheritedClipPathId})`:void 0},k._inheritedBackgroundClipTextPath.value)),H+N+A}c();var kr=pt(require("@shuding/opentype.js"),1);var os="unknown";function Rl(e,t,[n,r],[i,s]){if(n!==i)return n?!i||n===e?-1:i===e?1:e===400&&n===500||e===500&&n===400?-1:e===400&&i===500||e===500&&i===400?1:e<400?n<e&&i<e?i-n:n<e?-1:i<e?1:n-i:e<n&&e<i?n-i:e<n?-1:e<i?1:i-n:1;if(r!==s){if(r===t)return-1;if(s===t)return 1}return-1}var Tt=class{constructor(t){this.fonts=new Map;this.addFonts(t)}get({name:t,weight:n,style:r}){if(!this.fonts.has(t))return null;n==="normal"&&(n=400),n==="bold"&&(n=700),typeof n=="string"&&(n=Number.parseInt(n,10));let i=[...this.fonts.get(t)],s=i[0];for(let o=1;o<i.length;o++){let[,a,u]=s,[,l,f]=i[o];Rl(n,r,[a,u],[l,f])>0&&(s=i[o])}return s[0]}addFonts(t){for(let n of t){let{name:r,data:i,lang:s}=n;if(s&&!rs(s))throw new Error(`Invalid value for props \`lang\`: "${s}". The value must be one of the following: ${Sr.join(", ")}.`);let o=s!=null?s:os,a=kr.default.parse("buffer"in i?i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength):i,{lowMemory:!0}),u=a.charToGlyphIndex;a.charToGlyphIndex=f=>{let d=u.call(a,f);return d===0&&a._trackBrokenChars&&a._trackBrokenChars.push(f),d},this.defaultFont||(this.defaultFont=a);let l=`${r.toLowerCase()}_${o}`;this.fonts.has(l)||this.fonts.set(l,[]),this.fonts.get(l).push([a,n.weight,n.style])}}getEngine(t=16,n=1.2,{fontFamily:r,fontWeight:i=400,fontStyle:s="normal"},o){if(!this.fonts.size)throw new Error("No fonts are loaded. At least one font is required to calculate the layout.");r=(Array.isArray(r)?r:[r]).map(y=>y.toLowerCase());let a=[];r.forEach(y=>{let _=this.get({name:y,weight:i,style:s});if(_){a.push(_);return}let O=this.get({name:y+"_unknown",weight:i,style:s});if(O){a.push(O);return}});let u=Array.from(this.fonts.keys()),l=[],f=[],d=[];for(let y of u)if(!r.includes(y))if(o){let _=Ll(y);_?_===o?l.push(this.get({name:y,weight:i,style:s})):f.push(this.get({name:y,weight:i,style:s})):d.push(this.get({name:y,weight:i,style:s}))}else d.push(this.get({name:y,weight:i,style:s}));let g=new Map,p=(y,_=!0)=>{let O=y.charCodeAt(0);if(g.has(O))return g.get(O);let k=[...a,...d,...l,..._?f:[]],C=k.find((D,L)=>!!D.charToGlyphIndex(y)||_&&L===k.length-1);return C&&g.set(O,C),C},h=(y,_=!1)=>{var k,C;return((_?(C=(k=y.tables)==null?void 0:k.os2)==null?void 0:C.sTypoAscender:0)||y.ascender)/y.unitsPerEm*t},v=(y,_=!1)=>{var k,C;return((_?(C=(k=y.tables)==null?void 0:k.os2)==null?void 0:C.sTypoDescender:0)||y.descender)/y.unitsPerEm*t},w=y=>p(y,!1),b={has:y=>{if(y===`
9
9
  `)return!0;let _=w(y);return _?(_._trackBrokenChars=[],_.stringToGlyphs(y),_._trackBrokenChars.length?(_._trackBrokenChars=void 0,!1):!0):!1},baseline:(y,_=typeof y>"u"?a[0]:p(y))=>{let O=h(_,!0),k=v(_,!0),C=b.height(y,_),{yMax:D,yMin:L}=_.tables.head,F=O-k,G=(D/(D-L)-1)*F;return C*((1.2/n+1)/2)+G},height:(y,_=typeof y>"u"?a[0]:p(y))=>(h(_)-v(_))*(n/1.2),measure:(y,_)=>this.measure(p,y,_),getSVG:(y,_)=>this.getSVG(p,y,_)};return b}patchFontFallbackResolver(t,n){let r=[];t._trackBrokenChars=r;let i=t.stringToGlyphs;return t.stringToGlyphs=(s,...o)=>{let a=i.call(t,s,...o);for(let u=0;u<a.length;u++)if(a[u].unicode===void 0){let l=r.shift(),f=n(l);if(f!==t){let d=f.charToGlyph(l),g=t.unitsPerEm/f.unitsPerEm,p=new kr.default.Path;p.unitsPerEm=t.unitsPerEm,p.commands=d.path.commands.map(v=>{let w={...v};for(let b in w)typeof w[b]=="number"&&(w[b]*=g);return w});let h=new kr.default.Glyph({...d,advanceWidth:d.advanceWidth*g,xMin:d.xMin*g,xMax:d.xMax*g,yMin:d.yMin*g,yMax:d.yMax*g,path:p});a[u]=h}}return a},()=>{t.stringToGlyphs=i,t._trackBrokenChars=void 0}}measure(t,n,{fontSize:r,letterSpacing:i=0}){let s=t(n),o=this.patchFontFallbackResolver(s,t);try{return s.getAdvanceWidth(n,r,{letterSpacing:i/r})}finally{o()}}getSVG(t,n,{fontSize:r,top:i,left:s,letterSpacing:o=0}){let a=t(n),u=this.patchFontFallbackResolver(a,t);try{return r===0?"":a.getPath(n.replace(/\n/g,""),s,i,r,{letterSpacing:o/r}).toPathData(1)}finally{u()}}};function Ll(e){let t=e.split("_"),n=t[t.length-1];return n===os?void 0:n}c();function Sn({width:e,height:t,content:n}){return I("svg",{width:e,height:t,viewBox:`0 0 ${e} ${t}`,xmlns:"http://www.w3.org/2000/svg"},n)}c();c();var $u=pt(mu());c();c();c();c();var y0=["ios","android","windows","macos","web"];function vu(e){return y0.includes(e)}var x0=["portrait","landscape"];function bu(e){return x0.includes(e)}var gu;(function(e){e.fontSize="fontSize",e.lineHeight="lineHeight"})(gu||(gu={}));var z;(function(e){e.rem="rem",e.em="em",e.px="px",e.percent="%",e.vw="vw",e.vh="vh",e.none="<no-css-unit>"})(z||(z={}));function Xi(e){return typeof e=="string"}function Qi(e){return typeof e=="object"}var Ki;function m(e){return{kind:"complete",style:e}}function ne(e,t={}){let{fractions:n}=t;if(n&&e.includes("/")){let[s="",o=""]=e.split("/",2),a=ne(s),u=ne(o);return!a||!u?null:[a[0]/u[0],u[1]]}let r=parseFloat(e);if(Number.isNaN(r))return null;let i=e.match(/(([a-z]{2,}|%))$/);if(!i)return[r,z.none];switch(i==null?void 0:i[1]){case"rem":return[r,z.rem];case"px":return[r,z.px];case"em":return[r,z.em];case"%":return[r,z.percent];case"vw":return[r,z.vw];case"vh":return[r,z.vh];default:return null}}function We(e,t,n={}){let r=Ie(t,n);return r===null?null:m({[e]:r})}function Ur(e,t,n){let r=Ie(t);return r!==null&&(n[e]=r),n}function xu(e,t){let n=Ie(t);return n===null?null:{[e]:n}}function Ie(e,t={}){if(e===void 0)return null;let n=ne(String(e),t);return n?Ye(...n,t):null}function Ye(e,t,n={}){let{isNegative:r,device:i}=n;switch(t){case z.rem:return e*16*(r?-1:1);case z.px:return e*(r?-1:1);case z.percent:return`${r?"-":""}${e}%`;case z.none:return e*(r?-1:1);case z.vw:return i!=null&&i.windowDimensions?i.windowDimensions.width*(e/100):(ve("`vw` CSS unit requires configuration with `useDeviceContext()`"),null);case z.vh:return i!=null&&i.windowDimensions?i.windowDimensions.height*(e/100):(ve("`vh` CSS unit requires configuration with `useDeviceContext()`"),null);default:return null}}function Ji(e){let t=ne(e);if(!t)return null;let[n,r]=t;switch(r){case z.rem:return n*16;case z.px:return n;default:return null}}var w0={t:"Top",tr:"TopRight",tl:"TopLeft",b:"Bottom",br:"BottomRight",bl:"BottomLeft",l:"Left",r:"Right",x:"Horizontal",y:"Vertical"};function Zi(e){return w0[e!=null?e:""]||"All"}function eo(e){let t="All";return[e.replace(/^-(t|b|r|l|tr|tl|br|bl)(-|$)/,(r,i)=>(t=Zi(i),"")),t]}function et(e,t={}){if(e.includes("/")){let n=yu(e,{...t,fractions:!0});if(n)return n}return e[0]==="["&&(e=e.slice(1,-1)),yu(e,t)}function ke(e,t,n={}){let r=et(t,n);return r===null?null:m({[e]:r})}function yu(e,t={}){if(e==="px")return 1;let n=ne(e,t);if(!n)return null;let[r,i]=n;return t.fractions&&(i=z.percent,r*=100),i===z.none&&(r=r/4,i=z.rem),Ye(r,i,t)}function _0(...e){console.warn(...e)}function S0(...e){}var ve=typeof process>"u"||((Ki=process==null?void 0:process.env)===null||Ki===void 0?void 0:Ki.JEST_WORKER_ID)===void 0?_0:S0;var k0=[["aspect-square",m({aspectRatio:1})],["aspect-video",m({aspectRatio:16/9})],["items-center",m({alignItems:"center"})],["items-start",m({alignItems:"flex-start"})],["items-end",m({alignItems:"flex-end"})],["items-baseline",m({alignItems:"baseline"})],["items-stretch",m({alignItems:"stretch"})],["justify-start",m({justifyContent:"flex-start"})],["justify-end",m({justifyContent:"flex-end"})],["justify-center",m({justifyContent:"center"})],["justify-between",m({justifyContent:"space-between"})],["justify-around",m({justifyContent:"space-around"})],["justify-evenly",m({justifyContent:"space-evenly"})],["content-start",m({alignContent:"flex-start"})],["content-end",m({alignContent:"flex-end"})],["content-between",m({alignContent:"space-between"})],["content-around",m({alignContent:"space-around"})],["content-stretch",m({alignContent:"stretch"})],["content-center",m({alignContent:"center"})],["self-auto",m({alignSelf:"auto"})],["self-start",m({alignSelf:"flex-start"})],["self-end",m({alignSelf:"flex-end"})],["self-center",m({alignSelf:"center"})],["self-stretch",m({alignSelf:"stretch"})],["self-baseline",m({alignSelf:"baseline"})],["direction-inherit",m({direction:"inherit"})],["direction-ltr",m({direction:"ltr"})],["direction-rtl",m({direction:"rtl"})],["hidden",m({display:"none"})],["flex",m({display:"flex"})],["flex-row",m({flexDirection:"row"})],["flex-row-reverse",m({flexDirection:"row-reverse"})],["flex-col",m({flexDirection:"column"})],["flex-col-reverse",m({flexDirection:"column-reverse"})],["flex-wrap",m({flexWrap:"wrap"})],["flex-wrap-reverse",m({flexWrap:"wrap-reverse"})],["flex-nowrap",m({flexWrap:"nowrap"})],["flex-auto",m({flexGrow:1,flexShrink:1,flexBasis:"auto"})],["flex-initial",m({flexGrow:0,flexShrink:1,flexBasis:"auto"})],["flex-none",m({flexGrow:0,flexShrink:0,flexBasis:"auto"})],["overflow-hidden",m({overflow:"hidden"})],["overflow-visible",m({overflow:"visible"})],["overflow-scroll",m({overflow:"scroll"})],["absolute",m({position:"absolute"})],["relative",m({position:"relative"})],["italic",m({fontStyle:"italic"})],["not-italic",m({fontStyle:"normal"})],["oldstyle-nums",rr("oldstyle-nums")],["small-caps",rr("small-caps")],["lining-nums",rr("lining-nums")],["tabular-nums",rr("tabular-nums")],["proportional-nums",rr("proportional-nums")],["font-thin",m({fontWeight:"100"})],["font-100",m({fontWeight:"100"})],["font-extralight",m({fontWeight:"200"})],["font-200",m({fontWeight:"200"})],["font-light",m({fontWeight:"300"})],["font-300",m({fontWeight:"300"})],["font-normal",m({fontWeight:"normal"})],["font-400",m({fontWeight:"400"})],["font-medium",m({fontWeight:"500"})],["font-500",m({fontWeight:"500"})],["font-semibold",m({fontWeight:"600"})],["font-600",m({fontWeight:"600"})],["font-bold",m({fontWeight:"bold"})],["font-700",m({fontWeight:"700"})],["font-extrabold",m({fontWeight:"800"})],["font-800",m({fontWeight:"800"})],["font-black",m({fontWeight:"900"})],["font-900",m({fontWeight:"900"})],["include-font-padding",m({includeFontPadding:!0})],["remove-font-padding",m({includeFontPadding:!1})],["max-w-none",m({maxWidth:"99999%"})],["text-left",m({textAlign:"left"})],["text-center",m({textAlign:"center"})],["text-right",m({textAlign:"right"})],["text-justify",m({textAlign:"justify"})],["text-auto",m({textAlign:"auto"})],["underline",m({textDecorationLine:"underline"})],["line-through",m({textDecorationLine:"line-through"})],["no-underline",m({textDecorationLine:"none"})],["uppercase",m({textTransform:"uppercase"})],["lowercase",m({textTransform:"lowercase"})],["capitalize",m({textTransform:"capitalize"})],["normal-case",m({textTransform:"none"})],["w-auto",m({width:"auto"})],["h-auto",m({height:"auto"})],["shadow-sm",m({shadowOffset:{width:1,height:1},shadowColor:"#000",shadowRadius:1,shadowOpacity:.025,elevation:1})],["shadow",m({shadowOffset:{width:1,height:1},shadowColor:"#000",shadowRadius:1,shadowOpacity:.075,elevation:2})],["shadow-md",m({shadowOffset:{width:1,height:1},shadowColor:"#000",shadowRadius:3,shadowOpacity:.125,elevation:3})],["shadow-lg",m({shadowOffset:{width:1,height:1},shadowColor:"#000",shadowOpacity:.15,shadowRadius:8,elevation:8})],["shadow-xl",m({shadowOffset:{width:1,height:1},shadowColor:"#000",shadowOpacity:.19,shadowRadius:20,elevation:12})],["shadow-2xl",m({shadowOffset:{width:1,height:1},shadowColor:"#000",shadowOpacity:.25,shadowRadius:30,elevation:16})],["shadow-none",m({shadowOffset:{width:0,height:0},shadowColor:"#000",shadowRadius:0,shadowOpacity:0,elevation:0})]],to=k0;function rr(e){return{kind:"dependent",complete(t){(!t.fontVariant||!Array.isArray(t.fontVariant))&&(t.fontVariant=[]),t.fontVariant.push(e)}}}var nr=class{constructor(t){this.ir=new Map(to),this.styles=new Map,this.prefixes=new Map,this.ir=new Map([...to,...t!=null?t:[]])}getStyle(t){return this.styles.get(t)}setStyle(t,n){this.styles.set(t,n)}getIr(t){return this.ir.get(t)}setIr(t,n){this.ir.set(t,n)}getPrefixMatch(t){return this.prefixes.get(t)}setPrefixMatch(t,n){this.prefixes.set(t,n)}};c();c();function ro(e,t,n={}){let r=t==null?void 0:t[e];if(!r)return ke("fontSize",e,n);if(typeof r=="string")return We("fontSize",r);let i={},[s,o]=r,a=xu("fontSize",s);if(a&&(i=a),typeof o=="string")return m(Ur("lineHeight",wu(o,i),i));let{lineHeight:u,letterSpacing:l}=o;return u&&Ur("lineHeight",wu(u,i),i),l&&Ur("letterSpacing",l,i),m(i)}function wu(e,t){let n=ne(e);if(n){let[r,i]=n;if((i===z.none||i===z.em)&&typeof t.fontSize=="number")return t.fontSize*r}return e}c();function no(e,t){var n;let r=(n=t==null?void 0:t[e])!==null&&n!==void 0?n:e.startsWith("[")?e.slice(1,-1):e,i=ne(r);if(!i)return null;let[s,o]=i;if(o===z.none)return{kind:"dependent",complete(u){if(typeof u.fontSize!="number")return"relative line-height utilities require that font-size be set";u.lineHeight=u.fontSize*s}};let a=Ye(s,o);return a!==null?m({lineHeight:a}):null}c();function io(e,t,n,r,i){let s="";if(r[0]==="[")s=r.slice(1,-1);else{let l=i==null?void 0:i[r];if(l)s=l;else{let f=et(r);return f&&typeof f=="number"?_u(f,z.px,t,e):null}}if(s==="auto")return Su(t,e,"auto");let o=ne(s);if(!o)return null;let[a,u]=o;return n&&(a=-a),_u(a,u,t,e)}function _u(e,t,n,r){let i=Ye(e,t);return i===null?null:Su(n,r,i)}function Su(e,t,n){switch(e){case"All":return{kind:"complete",style:{[`${t}Top`]:n,[`${t}Right`]:n,[`${t}Bottom`]:n,[`${t}Left`]:n}};case"Bottom":case"Top":case"Left":case"Right":return{kind:"complete",style:{[`${t}${e}`]:n}};case"Vertical":return{kind:"complete",style:{[`${t}Top`]:n,[`${t}Bottom`]:n}};case"Horizontal":return{kind:"complete",style:{[`${t}Left`]:n,[`${t}Right`]:n}};default:return null}}c();function oo(e){if(!e)return{};let t=Object.entries(e).reduce((i,[s,o])=>{let a=[0,1/0,0],u=typeof o=="string"?{min:o}:o,l=u.min?Ji(u.min):0;l===null?ve(`invalid screen config value: ${s}->min: ${u.min}`):a[0]=l;let f=u.max?Ji(u.max):1/0;return f===null?ve(`invalid screen config value: ${s}->max: ${u.max}`):a[1]=f,i[s]=a,i},{}),n=Object.values(t);n.sort((i,s)=>{let[o,a]=i,[u,l]=s;return a===1/0||l===1/0?o-u:a-l});let r=0;return n.forEach(i=>i[2]=r++),t}c();function so(e,t){let n=t==null?void 0:t[e];if(!n)return null;if(typeof n=="string")return m({fontFamily:n});let r=n[0];return r?m({fontFamily:r}):null}c();function tt(e,t,n){if(!n)return null;let r;t.includes("/")&&([t="",r]=t.split("/",2));let i="";if(t.startsWith("[#")||t.startsWith("[rgb")?i=t.slice(1,-1):i=Ou(t,n),!i)return null;if(r){let s=Number(r);if(!Number.isNaN(s))return i=ku(i,s/100),m({[zr[e].color]:i})}return{kind:"dependent",complete(s){let o=zr[e].opacity,a=s[o];typeof a=="number"&&(i=ku(i,a)),s[zr[e].color]=i}}}function ir(e,t){let n=parseInt(t,10);if(Number.isNaN(n))return null;let r=n/100,i={[zr[e].opacity]:r};return{kind:"complete",style:i}}function ku(e,t){return e.startsWith("#")?e=T0(e):e.startsWith("rgb(")&&(e=e.replace(/^rgb\(/,"rgba(").replace(/\)$/,", 1)")),e.replace(/, ?\d*\.?(\d+)\)$/,`, ${t})`)}function Tu(e){for(let t in e)t.startsWith("__opacity_")&&delete e[t]}var zr={bg:{opacity:"__opacity_bg",color:"backgroundColor"},text:{opacity:"__opacity_text",color:"color"},border:{opacity:"__opacity_border",color:"borderColor"},borderTop:{opacity:"__opacity_border",color:"borderTopColor"},borderBottom:{opacity:"__opacity_border",color:"borderBottomColor"},borderLeft:{opacity:"__opacity_border",color:"borderLeftColor"},borderRight:{opacity:"__opacity_border",color:"borderRightColor"},shadow:{opacity:"__opacity_shadow",color:"shadowColor"},tint:{opacity:"__opacity_tint",color:"tintColor"}};function T0(e){let t=e;e=e.replace(O0,(o,a,u,l)=>a+a+u+u+l+l);let n=E0.exec(e);if(!n)return ve(`invalid config hex color value: ${t}`),"rgba(0, 0, 0, 1)";let r=parseInt(n[1],16),i=parseInt(n[2],16),s=parseInt(n[3],16);return`rgba(${r}, ${i}, ${s}, 1)`}function Ou(e,t){let n=t[e];if(Xi(n))return n;if(Qi(n)&&Xi(n.DEFAULT))return n.DEFAULT;let[r="",...i]=e.split("-");for(;r!==e;){let s=t[r];if(Qi(s))return Ou(i.join("-"),s);if(i.length===0)return"";r=`${r}-${i.shift()}`}return""}var O0=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,E0=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i;c();function Pu(e,t){let[n,r]=eo(e);if(n.match(/^(-?(\d)+)?$/))return P0(n,r,t==null?void 0:t.borderWidth);if(n=n.replace(/^-/,""),["dashed","solid","dotted"].includes(n))return m({borderStyle:n});let s="border";switch(r){case"Bottom":s="borderBottom";break;case"Top":s="borderTop";break;case"Left":s="borderLeft";break;case"Right":s="borderRight";break}let o=tt(s,n,t==null?void 0:t.borderColor);if(o)return o;let a=`border${r==="All"?"":r}Width`;n=n.replace(/^-/,"");let u=n.slice(1,-1),l=ke(a,u);return typeof(l==null?void 0:l.style[a])!="number"?null:l}function P0(e,t,n){if(!n)return null;e=e.replace(/^-/,"");let i=n[e===""?"DEFAULT":e];if(i===void 0)return null;let s=`border${t==="All"?"":t}Width`;return We(s,i)}function Au(e,t){if(!t)return null;let[n,r]=eo(e);n=n.replace(/^-/,""),n===""&&(n="DEFAULT");let i=`border${r==="All"?"":r}Radius`,s=t[n];if(s)return Eu(We(i,s));let o=ke(i,n);return typeof(o==null?void 0:o.style[i])!="number"?null:Eu(o)}function Eu(e){if((e==null?void 0:e.kind)!=="complete")return e;let t=e.style.borderTopRadius;t!==void 0&&(e.style.borderTopLeftRadius=t,e.style.borderTopRightRadius=t,delete e.style.borderTopRadius);let n=e.style.borderBottomRadius;n!==void 0&&(e.style.borderBottomLeftRadius=n,e.style.borderBottomRightRadius=n,delete e.style.borderBottomRadius);let r=e.style.borderLeftRadius;r!==void 0&&(e.style.borderBottomLeftRadius=r,e.style.borderTopLeftRadius=r,delete e.style.borderLeftRadius);let i=e.style.borderRightRadius;return i!==void 0&&(e.style.borderBottomRightRadius=i,e.style.borderTopRightRadius=i,delete e.style.borderRightRadius),e}c();function lt(e,t,n,r){let i=null;e==="inset"&&(t=t.replace(/^(x|y)-/,(a,u)=>(i=u==="x"?"x":"y","")));let s=r==null?void 0:r[t];if(s){let a=Ie(s,{isNegative:n});if(a!==null)return Iu(e,i,a)}let o=et(t,{isNegative:n});return o!==null?Iu(e,i,o):null}function Iu(e,t,n){if(e!=="inset")return m({[e]:n});switch(t){case null:return m({top:n,left:n,right:n,bottom:n});case"y":return m({top:n,bottom:n});case"x":return m({left:n,right:n})}}c();function or(e,t,n){var r;t=t.replace(/^-/,"");let i=t===""?"DEFAULT":t,s=Number((r=n==null?void 0:n[i])!==null&&r!==void 0?r:t);return Number.isNaN(s)?null:m({[`flex${e}`]:s})}function Ru(e,t){var n,r;if(e=(t==null?void 0:t[e])||e,["min-content","revert","unset"].includes(e))return null;if(e.match(/^\d+(\.\d+)?$/))return m({flexGrow:Number(e),flexBasis:"0%"});let i=e.match(/^(\d+)\s+(\d+)$/);if(i)return m({flexGrow:Number(i[1]),flexShrink:Number(i[2])});if(i=e.match(/^(\d+)\s+([^ ]+)$/),i){let s=Ie((n=i[2])!==null&&n!==void 0?n:"");return s?m({flexGrow:Number(i[1]),flexBasis:s}):null}if(i=e.match(/^(\d+)\s+(\d+)\s+(.+)$/),i){let s=Ie((r=i[3])!==null&&r!==void 0?r:"");return s?m({flexGrow:Number(i[1]),flexShrink:Number(i[2]),flexBasis:s}):null}return null}c();function ao(e,t,n={},r){let i=r==null?void 0:r[t];return i!==void 0?We(e,i,n):ke(e,t,n)}function sr(e,t,n={},r){let i=Ie(r==null?void 0:r[t],n);return i?m({[e]:i}):(t==="screen"&&(t=e.includes("Width")?"100vw":"100vh"),ke(e,t,n))}c();function Lu(e,t,n){let r=n==null?void 0:n[e];if(r){let i=ne(r,{isNegative:t});if(!i)return null;let[s,o]=i;if(o===z.em)return A0(s);if(o===z.percent)return ve("percentage-based letter-spacing configuration currently unsupported, switch to `em`s, or open an issue if you'd like to see support added."),null;let a=Ye(s,o,{isNegative:t});return a!==null?m({letterSpacing:a}):null}return ke("letterSpacing",e,{isNegative:t})}function A0(e){return{kind:"dependent",complete(t){let n=t.fontSize;if(typeof n!="number"||Number.isNaN(n))return"tracking-X relative letter spacing classes require font-size to be set";t.letterSpacing=Math.round((e*n+Number.EPSILON)*100)/100}}}c();function Cu(e,t){let n=t==null?void 0:t[e];if(n){let i=ne(String(n));if(i)return m({opacity:i[0]})}let r=ne(e);return r?m({opacity:r[0]/100}):null}c();function Du(e){let t=parseInt(e,10);return Number.isNaN(t)?null:{kind:"complete",style:{shadowOpacity:t/100}}}function Fu(e){if(e.includes("/")){let[n="",r=""]=e.split("/",2),i=uo(n),s=uo(r);return i===null||s===null?null:{kind:"complete",style:{shadowOffset:{width:i,height:s}}}}let t=uo(e);return t===null?null:{kind:"complete",style:{shadowOffset:{width:t,height:t}}}}function uo(e){let t=et(e);return typeof t=="number"?t:null}var ft=class{constructor(t,n={},r,i,s){var o,a,u,l,f,d;this.config=n,this.cache=r,this.position=0,this.isNull=!1,this.isNegative=!1,this.context={},this.context.device=i;let g=t.trim().split(":"),p=[];g.length===1?this.string=t:(this.string=(o=g.pop())!==null&&o!==void 0?o:"",p=g),this.char=this.string[0];let h=oo((a=this.config.theme)===null||a===void 0?void 0:a.screens);for(let v of p)if(h[v]){let w=(u=h[v])===null||u===void 0?void 0:u[2];w!==void 0&&(this.order=((l=this.order)!==null&&l!==void 0?l:0)+w);let b=(f=i.windowDimensions)===null||f===void 0?void 0:f.width;if(b){let[y,_]=(d=h[v])!==null&&d!==void 0?d:[0,0];(b<=y||b>_)&&(this.isNull=!0)}else this.isNull=!0}else vu(v)?this.isNull=v!==s:bu(v)?i.windowDimensions?(i.windowDimensions.width>i.windowDimensions.height?"landscape":"portrait")!==v?this.isNull=!0:this.incrementOrder():this.isNull=!0:v==="retina"?i.pixelDensity===2?this.incrementOrder():this.isNull=!0:v==="dark"?i.colorScheme!=="dark"?this.isNull=!0:this.incrementOrder():this.handlePossibleArbitraryBreakpointPrefix(v)||(this.isNull=!0)}parse(){if(this.isNull)return{kind:"null"};let t=this.cache.getIr(this.rest);if(t)return t;this.parseIsNegative();let n=this.parseUtility();return n?this.order!==void 0?{kind:"ordered",order:this.order,styleIr:n}:n:{kind:"null"}}parseUtility(){var t,n,r,i,s;let o=this.config.theme,a=null;switch(this.char){case"m":case"p":{let u=this.peekSlice(1,3).match(/^(t|b|r|l|x|y)?-/);if(u){let l=this.char==="m"?"margin":"padding";this.advance(((n=(t=u[0])===null||t===void 0?void 0:t.length)!==null&&n!==void 0?n:0)+1);let f=Zi(u[1]),d=io(l,f,this.isNegative,this.rest,(r=this.config.theme)===null||r===void 0?void 0:r[l]);if(d)return d}}}if(this.consumePeeked("h-")&&(a=ao("height",this.rest,this.context,o==null?void 0:o.height),a)||this.consumePeeked("w-")&&(a=ao("width",this.rest,this.context,o==null?void 0:o.width),a)||this.consumePeeked("min-w-")&&(a=sr("minWidth",this.rest,this.context,o==null?void 0:o.minWidth),a)||this.consumePeeked("min-h-")&&(a=sr("minHeight",this.rest,this.context,o==null?void 0:o.minHeight),a)||this.consumePeeked("max-w-")&&(a=sr("maxWidth",this.rest,this.context,o==null?void 0:o.maxWidth),a)||this.consumePeeked("max-h-")&&(a=sr("maxHeight",this.rest,this.context,o==null?void 0:o.maxHeight),a)||this.consumePeeked("leading-")&&(a=no(this.rest,o==null?void 0:o.lineHeight),a)||this.consumePeeked("text-")&&(a=ro(this.rest,o==null?void 0:o.fontSize,this.context),a||(a=tt("text",this.rest,o==null?void 0:o.textColor),a)||this.consumePeeked("opacity-")&&(a=ir("text",this.rest),a))||this.consumePeeked("font-")&&(a=so(this.rest,o==null?void 0:o.fontFamily),a)||this.consumePeeked("aspect-")&&(this.consumePeeked("ratio-")&&ve("`aspect-ratio-{ratio}` is deprecated, use `aspect-{ratio}` instead"),a=We("aspectRatio",this.rest,{fractions:!0}),a)||this.consumePeeked("tint-")&&(a=tt("tint",this.rest,o==null?void 0:o.colors),a)||this.consumePeeked("bg-")&&(a=tt("bg",this.rest,o==null?void 0:o.backgroundColor),a||this.consumePeeked("opacity-")&&(a=ir("bg",this.rest),a))||this.consumePeeked("border")&&(a=Pu(this.rest,o),a||this.consumePeeked("-opacity-")&&(a=ir("border",this.rest),a))||this.consumePeeked("rounded")&&(a=Au(this.rest,o==null?void 0:o.borderRadius),a)||this.consumePeeked("bottom-")&&(a=lt("bottom",this.rest,this.isNegative,o==null?void 0:o.inset),a)||this.consumePeeked("top-")&&(a=lt("top",this.rest,this.isNegative,o==null?void 0:o.inset),a)||this.consumePeeked("left-")&&(a=lt("left",this.rest,this.isNegative,o==null?void 0:o.inset),a)||this.consumePeeked("right-")&&(a=lt("right",this.rest,this.isNegative,o==null?void 0:o.inset),a)||this.consumePeeked("inset-")&&(a=lt("inset",this.rest,this.isNegative,o==null?void 0:o.inset),a)||this.consumePeeked("flex-")&&(this.consumePeeked("grow")?a=or("Grow",this.rest,o==null?void 0:o.flexGrow):this.consumePeeked("shrink")?a=or("Shrink",this.rest,o==null?void 0:o.flexShrink):a=Ru(this.rest,o==null?void 0:o.flex),a)||this.consumePeeked("grow")&&(a=or("Grow",this.rest,o==null?void 0:o.flexGrow),a)||this.consumePeeked("shrink")&&(a=or("Shrink",this.rest,o==null?void 0:o.flexShrink),a)||this.consumePeeked("shadow-color-opacity-")&&(a=ir("shadow",this.rest),a)||this.consumePeeked("shadow-opacity-")&&(a=Du(this.rest),a)||this.consumePeeked("shadow-offset-")&&(a=Fu(this.rest),a)||this.consumePeeked("shadow-radius-")&&(a=ke("shadowRadius",this.rest),a)||this.consumePeeked("shadow-")&&(a=tt("shadow",this.rest,o==null?void 0:o.colors),a))return a;if(this.consumePeeked("elevation-")){let u=parseInt(this.rest,10);if(!Number.isNaN(u))return m({elevation:u})}if(this.consumePeeked("opacity-")&&(a=Cu(this.rest,o==null?void 0:o.opacity),a)||this.consumePeeked("tracking-")&&(a=Lu(this.rest,this.isNegative,o==null?void 0:o.letterSpacing),a))return a;if(this.consumePeeked("z-")){let u=Number((s=(i=o==null?void 0:o.zIndex)===null||i===void 0?void 0:i[this.rest])!==null&&s!==void 0?s:this.rest);if(!Number.isNaN(u))return m({zIndex:u})}return ve(`\`${this.rest}\` unknown or invalid utility`),null}handlePossibleArbitraryBreakpointPrefix(t){var n;if(t[0]!=="m")return!1;let r=t.match(/^(min|max)-(w|h)-\[([^\]]+)\]$/);if(!r)return!1;if(!(!((n=this.context.device)===null||n===void 0)&&n.windowDimensions))return this.isNull=!0,!0;let i=this.context.device.windowDimensions,[,s="",o="",a=""]=r,u=o==="w"?i.width:i.height,l=ne(a,this.context);if(l===null)return this.isNull=!0,!0;let[f,d]=l;return d!=="px"&&(this.isNull=!0),(s==="min"?u>=f:u<=f)?this.incrementOrder():this.isNull=!0,!0}advance(t=1){this.position+=t,this.char=this.string[this.position]}get rest(){return this.peekSlice(0,this.string.length)}peekSlice(t,n){return this.string.slice(this.position+t,this.position+n)}consumePeeked(t){return this.peekSlice(0,t.length)===t?(this.advance(t.length),!0):!1}parseIsNegative(){this.char==="-"&&(this.advance(),this.isNegative=!0,this.context.isNegative=!0)}incrementOrder(){var t;this.order=((t=this.order)!==null&&t!==void 0?t:0)+1}};c();function Mu(e){let t=[],n=null;return e.forEach(r=>{if(typeof r=="string")t=[...t,...lo(r)];else if(Array.isArray(r))t=[...t,...r.flatMap(lo)];else if(typeof r=="object"&&r!==null)for(let[i,s]of Object.entries(r))typeof s=="boolean"?t=[...t,...s?lo(i):[]]:n?n[i]=s:n={[i]:s}}),[t.filter(Boolean).filter(I0),n]}function lo(e){return e.trim().split(/\s+/)}function I0(e,t,n){return n.indexOf(e)===t}c();function Nu(e){var t;return(t=e==null?void 0:e.reduce((n,r)=>({...n,...R0(r.handler)}),{}))!==null&&t!==void 0?t:{}}function R0(e){let t={};return e({addUtilities:n=>{t=n},...L0}),t}function Re(e){throw new Error(`tailwindcss plugin function argument object prop "${e}" not implemented`)}var L0={addComponents:Re,addBase:Re,addVariant:Re,e:Re,prefix:Re,theme:Re,variants:Re,config:Re,corePlugins:Re,matchUtilities:Re,postcss:null};function Wu(e,t){let n=(0,$u.default)(C0(e)),r={},i=Nu(n.plugins),s={},o=Object.entries(i).map(([h,v])=>typeof v=="string"?(s[h]=v,[h,{kind:"null"}]):[h,m(v)]).filter(([,h])=>h.kind!=="null");function a(){return[r.windowDimensions?`w${r.windowDimensions.width}`:!1,r.windowDimensions?`h${r.windowDimensions.height}`:!1,r.fontScale?`fs${r.fontScale}`:!1,r.colorScheme==="dark"?"dark":!1,r.pixelDensity===2?"retina":!1].filter(Boolean).join("--")||"default"}let u=a(),l={};function f(){let h=l[u];if(h)return h;let v=new nr(o);return l[u]=v,v}function d(...h){let v=f(),w={},b=[],y=[],[_,O]=Mu(h),k=_.join(" "),C=v.getStyle(k);if(C)return{...C,...O||{}};for(let D of _){let L=v.getIr(D);if(!L&&D in s){let G=d(s[D]);v.setIr(D,m(G)),w={...w,...G};continue}switch(L=new ft(D,n,v,r,t).parse(),L.kind){case"complete":w={...w,...L.style},v.setIr(D,L);break;case"dependent":b.push(L);break;case"ordered":y.push(L);break;case"null":v.setIr(D,L);break}}if(y.length>0){y.sort((D,L)=>D.order-L.order);for(let D of y)switch(D.styleIr.kind){case"complete":w={...w,...D.styleIr.style};break;case"dependent":b.push(D.styleIr);break}}if(b.length>0){for(let D of b){let L=D.complete(w);L&&ve(L)}Tu(w)}return k!==""&&v.setStyle(k,w),O&&(w={...w,...O}),w}function g(h){let v=d(h.split(/\s+/g).map(w=>w.replace(/^(bg|text|border)-/,"")).map(w=>`bg-${w}`).join(" "));return typeof v.backgroundColor=="string"?v.backgroundColor:void 0}let p=(h,...v)=>{let w="";return h.forEach((b,y)=>{var _;w+=b+((_=v[y])!==null&&_!==void 0?_:"")}),d(w)};return p.style=d,p.color=g,p.prefixMatch=(...h)=>{let v=h.sort().join(":"),w=f(),b=w.getPrefixMatch(v);if(b!==void 0)return b;let O=new ft(`${v}:flex`,n,w,r,t).parse().kind!=="null";return w.setPrefixMatch(v,O),O},p.setWindowDimensions=h=>{r.windowDimensions=h,u=a()},p.setFontScale=h=>{r.fontScale=h,u=a()},p.setPixelDensity=h=>{r.pixelDensity=h,u=a()},p.setColorScheme=h=>{r.colorScheme=h,u=a()},p}function C0(e){return{...e,content:["_no_warnings_please"]}}var F0={plugins:[{handler:({addUtilities:e})=>{e({"shadow-sm":{boxShadow:"0 1px 2px 0 rgb(0 0 0 / 0.05)"},shadow:{boxShadow:"0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)"},"shadow-md":{boxShadow:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)"},"shadow-lg":{boxShadow:"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)"},"shadow-xl":{boxShadow:"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)"},"shadow-2xl":{boxShadow:"0 25px 50px -12px rgb(0 0 0 / 0.25)"},"shadow-inner":{boxShadow:"inset 0 2px 4px 0 rgb(0 0 0 / 0.05)"},"shadow-none":{boxShadow:"0 0 #0000"}})}}]};function M0(){return Wu(F0,"web")}var Gr;function fo({width:e,height:t}){return Gr||(Gr=M0()),Gr.setWindowDimensions({width:+e,height:+t}),Gr}var co=new WeakMap;async function po(e,t){let n=Fe();if(!n||!n.Node)throw new Error("Satori is not initialized: expect `yoga` to be loaded, got "+n);t.fonts=t.fonts||[];let r;co.has(t.fonts)?r=co.get(t.fonts):co.set(t.fonts,r=new Tt(t.fonts));let i="width"in t?t.width:void 0,s="height"in t?t.height:void 0,o=n.Node.create();i&&o.setWidth(i),s&&o.setHeight(s),o.setFlexDirection(n.FLEX_DIRECTION_ROW),o.setFlexWrap(n.WRAP_WRAP),o.setAlignContent(n.ALIGN_AUTO),o.setAlignItems(n.ALIGN_FLEX_START),o.setJustifyContent(n.JUSTIFY_FLEX_START),o.setOverflow(n.OVERFLOW_HIDDEN);let a={...t.graphemeImages},u=new Set,l=kt(e,{id:"id",parentStyle:{},inheritedStyle:{fontSize:16,fontWeight:"normal",fontFamily:"serif",fontStyle:"normal",lineHeight:1.2,color:"black",opacity:1,whiteSpace:"normal",_viewportWidth:i,_viewportHeight:s},parent:o,font:r,embedFont:t.embedFont,debug:t.debug,graphemeImages:a,canLoadAdditionalAssets:!!t.loadAdditionalAsset,getTwStyles:(h,v)=>{let b={...fo({width:i,height:s})([h])};return typeof b.lineHeight=="number"&&(b.lineHeight=b.lineHeight/(+b.fontSize||v.fontSize||16)),b.shadowColor&&b.boxShadow&&(b.boxShadow=b.boxShadow.replace(/rgba?\([^)]+\)/,b.shadowColor)),b}}),f=(await l.next()).value;if(t.loadAdditionalAsset&&f.length){let h=N0(f),v=[],w={};await Promise.all(Object.entries(h).flatMap(([b,y])=>y.map(_=>{let O=`${b}_${_}`;return u.has(O)?null:(u.add(O),t.loadAdditionalAsset(b,_).then(k=>{typeof k=="string"?w[_]=k:k&&v.push(k)}))}))),r.addFonts(v),Object.assign(a,w)}await l.next(),o.calculateLayout(i,s,n.DIRECTION_LTR);let d=(await l.next([0,0])).value,g=o.getComputedWidth(),p=o.getComputedHeight();return o.freeRecursive(),Sn({width:g,height:p,content:d})}function N0(e){let t={},n={};for(let{word:r,locale:i}of e){let s=ns(r,i);n[s]=n[s]||"",n[s]+=r}return Object.keys(n).forEach(r=>{t[r]=t[r]||[],r==="emoji"?t[r].push(...qu(Me(n[r],"grapheme"))):(t[r][0]=t[r][0]||"",t[r][0]+=qu(Me(n[r],"grapheme",r==="unknown"?void 0:r)).join(""))}),t}function qu(e){return Array.from(new Set(e))}0&&(module.exports={init});
10
10
  //# sourceMappingURL=index.cjs.map