@forbespro/lead-agent
Version:
Lead Chat Agent React Component
4 lines (3 loc) • 2.04 kB
JavaScript
;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("./index124.js"),N=require("./index125.js");function g(e,o){const r=[{type:"text",value:"↩"}];return o>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(o)}]}),r}function m(e,o){return"Back to reference "+(e+1)+(o>1?"-"+o:"")}function B(e){const o=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=e.options.footnoteBackContent||g,p=e.options.footnoteBackLabel||m,b=e.options.footnoteLabel||"Footnotes",x=e.options.footnoteLabelTagName||"h2",k=e.options.footnoteLabelProperties||{className:["sr-only"]},f=[];let a=-1;for(;++a<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[a]);if(!c)continue;const s=e.all(c),u=String(c.identifier).toUpperCase(),d=N.normalizeUri(u.toLowerCase());let l=0;const i=[],h=e.footnoteCounts.get(u);for(;h!==void 0&&++l<=h;){i.length>0&&i.push({type:"text",value:" "});let t=typeof r=="string"?r:r(a,l);typeof t=="string"&&(t={type:"text",value:t}),i.push({type:"element",tagName:"a",properties:{href:"#"+o+"fnref-"+d+(l>1?"-"+l:""),dataFootnoteBackref:"",ariaLabel:typeof p=="string"?p:p(a,l),className:["data-footnote-backref"]},children:Array.isArray(t)?t:[t]})}const n=s[s.length-1];if(n&&n.type==="element"&&n.tagName==="p"){const t=n.children[n.children.length-1];t&&t.type==="text"?t.value+=" ":n.children.push({type:"text",value:" "}),n.children.push(...i)}else s.push(...i);const y={type:"element",tagName:"li",properties:{id:o+"fn-"+d},children:e.wrap(s,!0)};e.patch(c,y),f.push(y)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:x,properties:{...L.default(k),id:"footnote-label"},children:[{type:"text",value:b}]},{type:"text",value:`
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
`}]}}exports.defaultFootnoteBackContent=g;exports.defaultFootnoteBackLabel=m;exports.footer=B;