@e-llm-studio/citation 0.0.140 → 0.0.141

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.
Files changed (32) hide show
  1. package/dist/cjs/features/Bookemon/BookCopyrightsCard/BookCopyrightsCard.js +1 -1
  2. package/dist/cjs/features/Bookemon/BookDetailsCard/BookDetailsCard.js +1 -1
  3. package/dist/cjs/features/Bookemon/BookElementsCard/BookElementsCard.js +1 -1
  4. package/dist/cjs/features/Bookemon/BookOverviewCard/BookOverviewCard.js +1 -1
  5. package/dist/cjs/features/Bookemon/BookPeopleAwardsCard/BookPeopleAwardsCard.js +1 -1
  6. package/dist/cjs/features/Bookemon/Bookemon.js +1 -1
  7. package/dist/cjs/features/Bookemon/BookemonContent.js +1 -1
  8. package/dist/features/Bookemon/BookCopyrightsCard/BookCopyrightsCard.js +1 -1
  9. package/dist/features/Bookemon/BookDetailsCard/BookDetailsCard.js +1 -1
  10. package/dist/features/Bookemon/BookElementsCard/BookElementsCard.js +1 -1
  11. package/dist/features/Bookemon/BookOverviewCard/BookOverviewCard.js +1 -1
  12. package/dist/features/Bookemon/BookPeopleAwardsCard/BookPeopleAwardsCard.js +1 -1
  13. package/dist/features/Bookemon/Bookemon.js +1 -1
  14. package/dist/features/Bookemon/BookemonContent.js +1 -1
  15. package/dist/types/src/BookemonTest.d.ts.map +1 -1
  16. package/dist/types/src/features/Bookemon/BookCopyrightsCard/BookCopyrightsCard.d.ts +2 -1
  17. package/dist/types/src/features/Bookemon/BookCopyrightsCard/BookCopyrightsCard.d.ts.map +1 -1
  18. package/dist/types/src/features/Bookemon/BookDetailsCard/BookDetailsCard.d.ts +5 -2
  19. package/dist/types/src/features/Bookemon/BookDetailsCard/BookDetailsCard.d.ts.map +1 -1
  20. package/dist/types/src/features/Bookemon/BookElementsCard/BookElementsCard.d.ts +5 -1
  21. package/dist/types/src/features/Bookemon/BookElementsCard/BookElementsCard.d.ts.map +1 -1
  22. package/dist/types/src/features/Bookemon/BookOverviewCard/BookOverviewCard.d.ts +2 -1
  23. package/dist/types/src/features/Bookemon/BookOverviewCard/BookOverviewCard.d.ts.map +1 -1
  24. package/dist/types/src/features/Bookemon/BookPeopleAwardsCard/BookPeopleAwardsCard.d.ts +2 -1
  25. package/dist/types/src/features/Bookemon/BookPeopleAwardsCard/BookPeopleAwardsCard.d.ts.map +1 -1
  26. package/dist/types/src/features/Bookemon/Bookemon.d.ts +1 -1
  27. package/dist/types/src/features/Bookemon/Bookemon.d.ts.map +1 -1
  28. package/dist/types/src/features/Bookemon/BookemonContent.d.ts +1 -1
  29. package/dist/types/src/features/Bookemon/BookemonContent.d.ts.map +1 -1
  30. package/dist/types/src/features/Bookemon/types/citation.types.d.ts +2 -0
  31. package/dist/types/src/features/Bookemon/types/citation.types.d.ts.map +1 -1
  32. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var i=require("tslib"),e=require("react/jsx-runtime"),t=require("react"),n=require("../utils/highlight.js"),l=require("../../../utils/sanitizeHtml.js"),r={sectionTitle:{fontSize:"14px",fontWeight:600,color:"#667085",marginBottom:"12px"},textBlock:{fontSize:"14px",fontWeight:400,color:"#64748B",marginBottom:"24px"}};exports.default=function(s){var o,h,u,d,a,g,c,v,p=s.data,x=s.highlightTerms,y=s.onHighlightMatch,_=p.copyright,m=p.salesRights,j=t.useRef(null);return t.useEffect(function(){var e,t,n,l,r,s,o,h;if(x&&0!==x.length){var u=i.__spreadArray([String(null!==(t=null===(e=p.copyright)||void 0===e?void 0:e.year)&&void 0!==t?t:""),null!==(l=null===(n=p.copyright)||void 0===n?void 0:n.owner)&&void 0!==l?l:"",null!==(s=null===(r=p.salesRights)||void 0===r?void 0:r.description)&&void 0!==s?s:""],null!==(h=null===(o=p.salesRights)||void 0===o?void 0:o.territory)&&void 0!==h?h:[],!0).some(function(i){return!!i&&x.some(function(e){return i.toLowerCase().includes(e.toLowerCase())})});null==y||y(u)}},[x,p]),e.jsxs("div",i.__assign({ref:j},{children:[e.jsx("p",i.__assign({style:r.sectionTitle},{children:"Copyrights"})),e.jsxs("div",i.__assign({style:r.textBlock},{children:[e.jsxs("p",{children:["Copyright Year:"," ",x&&x.length>0?e.jsx("span",{dangerouslySetInnerHTML:{__html:l.sanitizeHtml(n.highlightTermsFunc(String(null!==(o=_.year)&&void 0!==o?o:"NA"),x))}}):null!==(h=_.year)&&void 0!==h?h:"NA"]}),e.jsxs("p",{children:["Copyright Owner:"," ",x&&x.length>0?e.jsx("span",{dangerouslySetInnerHTML:{__html:l.sanitizeHtml(n.highlightTermsFunc(null!==(u=_.owner)&&void 0!==u?u:"NA",x))}}):null!==(d=_.owner)&&void 0!==d?d:"NA"]})]})),e.jsx("p",i.__assign({style:r.sectionTitle},{children:"Sales Rights"})),e.jsxs("div",i.__assign({style:r.textBlock},{children:[e.jsx("p",{children:x&&x.length>0?e.jsx("span",{dangerouslySetInnerHTML:{__html:l.sanitizeHtml(n.highlightTermsFunc(null!==(a=m.description)&&void 0!==a?a:"",x))}}):null!==(g=m.description)&&void 0!==g?g:""}),e.jsxs("p",{children:["Sales Territory:"," ",x&&x.length>0?e.jsx("span",{dangerouslySetInnerHTML:{__html:l.sanitizeHtml(n.highlightTermsFunc(null!==(c=m.territory.join(", "))&&void 0!==c?c:"NA",x))}}):null!==(v=m.territory.join(", "))&&void 0!==v?v:"NA"]})]}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var i=require("tslib"),e=require("react/jsx-runtime"),t=require("react"),n=require("../utils/highlight.js"),l=require("../../../utils/sanitizeHtml.js"),r={sectionTitle:{fontSize:"14px",fontWeight:600,color:"#667085",marginBottom:"12px"},textBlock:{fontSize:"14px",fontWeight:400,color:"#64748B",marginBottom:"24px"}};exports.default=function(s){var o,h,u,g,d,a,c,v,p=s.data,x=s.highlightTerms,y=s.onHighlightMatch,m=s.highlightEnabled,j=p.copyright,_=p.salesRights,f=t.useRef(null);return t.useEffect(function(){var i,e,t,n,l,r,s;if(x&&0!==x.length&&m){var o=[String(null!==(e=null===(i=p.copyright)||void 0===i?void 0:i.year)&&void 0!==e?e:""),null!==(n=null===(t=p.copyright)||void 0===t?void 0:t.owner)&&void 0!==n?n:"",null!==(r=null===(l=p.salesRights)||void 0===l?void 0:l.description)&&void 0!==r?r:"",null===(s=p.salesRights)||void 0===s?void 0:s.territory.join(", ")].some(function(i){return!!i&&x.some(function(e){return i.toLowerCase().includes(e.toLowerCase())})});null==y||y(o)}},[x,p]),e.jsxs("div",i.__assign({ref:f},{children:[e.jsx("p",i.__assign({style:r.sectionTitle},{children:"Copyrights"})),e.jsxs("div",i.__assign({style:r.textBlock},{children:[e.jsxs("p",{children:["Copyright Year:"," ",x&&x.length>0&&m?e.jsx("span",{dangerouslySetInnerHTML:{__html:l.sanitizeHtml(n.highlightTermsFunc(String(null!==(o=j.year)&&void 0!==o?o:"NA"),x))}}):null!==(h=j.year)&&void 0!==h?h:"NA"]}),e.jsxs("p",{children:["Copyright Owner:"," ",x&&x.length>0&&m?e.jsx("span",{dangerouslySetInnerHTML:{__html:l.sanitizeHtml(n.highlightTermsFunc(null!==(u=j.owner)&&void 0!==u?u:"NA",x))}}):null!==(g=j.owner)&&void 0!==g?g:"NA"]})]})),e.jsx("p",i.__assign({style:r.sectionTitle},{children:"Sales Rights"})),e.jsxs("div",i.__assign({style:r.textBlock},{children:[e.jsx("p",{children:x&&x.length>0&&m?e.jsx("span",{dangerouslySetInnerHTML:{__html:l.sanitizeHtml(n.highlightTermsFunc(null!==(d=_.description)&&void 0!==d?d:"",x))}}):null!==(a=_.description)&&void 0!==a?a:""}),e.jsxs("p",{children:["Sales Territory:"," ",x&&x.length>0&&m?e.jsx("span",{dangerouslySetInnerHTML:{__html:l.sanitizeHtml(n.highlightTermsFunc(null!==(c=_.territory.join(", "))&&void 0!==c?c:"NA",x))}}):null!==(v=_.territory.join(", "))&&void 0!==v?v:"NA"]})]}))]}))};
2
2
  //# sourceMappingURL=BookCopyrightsCard.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),i=require("react"),n=require("../utils/highlight.js"),s=require("../../../utils/sanitizeHtml.js"),l={container:{width:"100%"},sectionTitle:{fontSize:"14px",fontWeight:600,color:"#667085",marginBottom:"12px"},detailsContainer:{marginBottom:"24px",fontSize:"14px",fontWeight:400,color:"#64748B",display:"flex",flexDirection:"column",gap:"4px",paddingLeft:"12px"},detailsContainerItem:{margin:"4px 0"},boldText:{fontWeight:"bold"},categoriesContainer:{marginBottom:"24px"},categoriesList:{display:"flex",flexWrap:"wrap",gap:"12px",marginBottom:"8px",paddingLeft:"12px"},category:{backgroundColor:"#ECEEF1",padding:"8px 12px",fontWeight:400,fontSize:"12px",borderRadius:"4px",color:"#64748B",maxWidth:"100%",wordBreak:"break-word"},button:{color:"#5928ED",fontSize:"14px",fontWeight:600,background:"none",border:"none",cursor:"pointer",padding:0,textDecoration:"none",paddingLeft:"12px"},reviewsList:{paddingLeft:"12px"},reviewCard:{border:"1px solid #CBD5E1",borderRadius:"6px",padding:"16px",marginBottom:"12px",backgroundColor:"#F8FAFC"},reviewText:{fontSize:"14px",fontStyle:"italic",fontWeight:400,color:"#475569",marginBottom:"8px"},reviewSource:{fontSize:"10px",color:"#475569",fontWeight:600}};exports.default=function(r){var o,a,g,c,d,u,h,p,x,m,_,b,f,v=r.data,y=r.highlightTerms,j=r.onHighlightMatch,T=i.useState(!1),C=T[0],w=T[1],N=i.useState(!1),k=N[0],S=N[1],H=i.useRef(null),I=i.useMemo(function(){return C?v.subjectCategories||[]:(v.subjectCategories||[]).slice(0,10)},[C,v.subjectCategories]);return i.useEffect(function(){var e,t;if(null==y?void 0:y.length){var i=y.map(function(e){return e.toLowerCase()}),n=function(e){return e&&i.some(function(t){return e.toLowerCase().includes(t)})},s=[v.isbn,v.isbn10,v.imprint,v.publisher,v.publishingDate,v.age].some(n),l=(null!==(e=v.subjectCategories)&&void 0!==e?e:[]).some(n),r=(null!==(t=v.reviews)&&void 0!==t?t:[]).some(function(e){return n(e.replace(/<[^>]+>/g,""))}),o=s||l||r;null==j||j(o),o&&(l&&!C&&w(!0),r&&!k&&S(!0))}},[y,v]),t.jsxs("div",e.__assign({ref:H,style:l.container,className:"book-details-container"},{children:[t.jsx("p",e.__assign({style:l.sectionTitle,className:"book-details-section-title"},{children:"Product Details"})),t.jsxs("div",e.__assign({style:l.detailsContainer,className:"book-details-details-container"},{children:[t.jsxs("p",e.__assign({style:l.detailsContainerItem},{children:[t.jsx("span",e.__assign({style:l.boldText},{children:"ISBN:"}))," ",y&&y.length>0?t.jsx("span",{dangerouslySetInnerHTML:{__html:s.sanitizeHtml(n.highlightTermsFunc(null!==(o=v.isbn)&&void 0!==o?o:"NA",y))}}):null!==(a=v.isbn)&&void 0!==a?a:"NA"]})),t.jsxs("p",e.__assign({style:l.detailsContainerItem},{children:[t.jsx("span",e.__assign({style:l.boldText},{children:"ISBN 10:"}))," ",y&&y.length>0?t.jsx("span",{dangerouslySetInnerHTML:{__html:s.sanitizeHtml(n.highlightTermsFunc(null!==(g=v.isbn10)&&void 0!==g?g:"NA",y))}}):null!==(c=v.isbn10)&&void 0!==c?c:"NA"]})),t.jsxs("p",e.__assign({style:l.detailsContainerItem},{children:[t.jsx("span",e.__assign({style:l.boldText},{children:"Imprint:"}))," ",y&&y.length>0?t.jsx("span",{dangerouslySetInnerHTML:{__html:s.sanitizeHtml(n.highlightTermsFunc(null!==(d=v.imprint)&&void 0!==d?d:"NA",y))}}):null!==(u=v.imprint)&&void 0!==u?u:"NA"]})),t.jsxs("p",e.__assign({style:l.detailsContainerItem},{children:[t.jsx("span",e.__assign({style:l.boldText},{children:"Publisher:"}))," ",y&&y.length>0?t.jsx("span",{dangerouslySetInnerHTML:{__html:s.sanitizeHtml(n.highlightTermsFunc(null!==(h=v.publisher)&&void 0!==h?h:"NA",y))}}):null!==(p=v.publisher)&&void 0!==p?p:"NA"]})),t.jsxs("p",e.__assign({style:l.detailsContainerItem},{children:[t.jsx("span",e.__assign({style:l.boldText},{children:"Publishing Date:"}))," ",y&&y.length>0?t.jsx("span",{dangerouslySetInnerHTML:{__html:s.sanitizeHtml(n.highlightTermsFunc(null!==(x=v.publishingDate)&&void 0!==x?x:"NA",y))}}):null!==(m=v.publishingDate)&&void 0!==m?m:"NA"]})),t.jsxs("p",e.__assign({style:l.detailsContainerItem},{children:[t.jsx("span",e.__assign({style:l.boldText},{children:"Age:"}))," ",y&&y.length>0?t.jsx("span",{dangerouslySetInnerHTML:{__html:s.sanitizeHtml(n.highlightTermsFunc(null!==(_=v.age)&&void 0!==_?_:"NA",y))}}):null!==(b=v.age)&&void 0!==b?b:"NA"]}))]})),t.jsxs("div",e.__assign({style:l.categoriesContainer},{children:[t.jsx("p",e.__assign({style:l.sectionTitle,className:"book-details-section-title"},{children:"Subject Categories"})),t.jsxs("div",e.__assign({style:l.categoriesList,className:"book-details-categories-list"},{children:[I.map(function(i,r){return t.jsx("span",e.__assign({style:l.category,className:"book-details-category"},{children:y&&y.length>0?t.jsx("span",{dangerouslySetInnerHTML:{__html:s.sanitizeHtml(n.highlightTermsFunc(i,y))}}):i}),r)}),v.subjectCategories&&v.subjectCategories.length>10&&t.jsx("button",e.__assign({style:l.button,onClick:function(){return w(!C)},onMouseOver:function(e){return e.currentTarget.style.textDecoration="underline"},onMouseOut:function(e){return e.currentTarget.style.textDecoration="none"}},{children:C?"View less":"View more"}))]}))]})),t.jsxs("div",e.__assign({style:l.reviewsContainer},{children:[t.jsx("p",e.__assign({style:l.sectionTitle,className:"book-details-section-title"},{children:"Book Marketing Collateral"})),t.jsxs("div",e.__assign({style:l.reviewsList,className:"book-details-reviews-list"},{children:[v.reviews&&v.reviews.length>0?(f=v.reviews.filter(function(e){return e.replace(/<[^>]+>/g,"").trim().replace(/&[#A-Za-z0-9]+;/g,"").trim().length>0}),(k?f:f.slice(0,3)).map(function(i,r){return t.jsx("div",e.__assign({style:l.reviewCard,className:"book-details-review-card"},{children:t.jsx("div",{style:l.reviewText,dangerouslySetInnerHTML:{__html:y&&y.length>0?s.sanitizeHtml(n.highlightTermsFunc(i,y)):i}})}),r)})):t.jsx("p",e.__assign({style:l.reviewText},{children:"No Book Marketing Collateral available for this book."})),v.reviews&&v.reviews.length>3&&t.jsx("button",e.__assign({style:l.button,onClick:function(){return S(function(e){return!e})},onMouseOver:function(e){return e.currentTarget.style.textDecoration="underline"},onMouseOut:function(e){return e.currentTarget.style.textDecoration="none"}},{children:k?"View less":"View more"}))]}))]}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),i=require("react"),n=require("../utils/highlight.js"),s=require("../../../utils/sanitizeHtml.js"),l={container:{width:"100%"},sectionTitle:{fontSize:"14px",fontWeight:600,color:"#667085",marginBottom:"12px"},detailsContainer:{marginBottom:"24px",fontSize:"14px",fontWeight:400,color:"#64748B",display:"flex",flexDirection:"column",gap:"4px",paddingLeft:"12px"},detailsContainerItem:{margin:"4px 0"},boldText:{fontWeight:"bold"},categoriesContainer:{marginBottom:"24px"},categoriesList:{display:"flex",flexWrap:"wrap",gap:"12px",marginBottom:"8px",paddingLeft:"12px"},category:{backgroundColor:"#ECEEF1",padding:"8px 12px",fontWeight:400,fontSize:"12px",borderRadius:"4px",color:"#64748B",maxWidth:"100%",wordBreak:"break-word"},button:{color:"#5928ED",fontSize:"14px",fontWeight:600,background:"none",border:"none",cursor:"pointer",padding:0,textDecoration:"none",paddingLeft:"12px"},reviewsList:{paddingLeft:"12px"},reviewCard:{border:"1px solid #CBD5E1",borderRadius:"6px",padding:"16px",marginBottom:"12px",backgroundColor:"#F8FAFC"},reviewText:{fontSize:"14px",fontStyle:"italic",fontWeight:400,color:"#475569",marginBottom:"8px"},reviewSource:{fontSize:"10px",color:"#475569",fontWeight:600}};exports.default=function(r){var o,a,c,g,u,d,h,p,x,m,_,b,v,f=r.data,y=r.highlightTerms,j=r.onHighlightMatch,T=r.highlightEnabled;r.citationType;var C,w=r.citationSubTitle,N=i.useState(!1),S=N[0],k=N[1],L=i.useState(!1),H=L[0],I=L[1],M=i.useRef(null),z=null!==(o=null==y?void 0:y.map(function(e){return e.split(",")}).flat())&&void 0!==o?o:[],A=i.useMemo(function(){return S?f.subjectCategories||[]:(f.subjectCategories||[]).slice(0,10)},[S,f.subjectCategories]);return i.useEffect(function(){var e,t;if((null==y?void 0:y.length)&&T){var i="genre_details"==w?z.map(function(e){return e.toLowerCase()}):y.map(function(e){return e.toLowerCase()}),n=function(e){return e&&i.some(function(t){return e.toLowerCase().includes(t)})},s=[f.isbn,f.isbn10,f.imprint,f.publisher,f.publishingDate,f.age].some(n),l=(null!==(e=f.subjectCategories)&&void 0!==e?e:[]).some(n);console.log("categoriesMatch",l);var r=(null!==(t=f.reviews)&&void 0!==t?t:[]).some(function(e){return n(e.replace(/<[^>]+>/g,""))}),o=s||l||r;null==j||j(o),o&&(l&&!S&&k(!0),r&&!H&&I(!0))}},[y,f]),t.jsxs("div",e.__assign({ref:M,style:l.container,className:"book-details-container"},{children:[t.jsx("p",e.__assign({style:l.sectionTitle,className:"book-details-section-title"},{children:"Product Details"})),t.jsxs("div",e.__assign({style:l.detailsContainer,className:"book-details-details-container"},{children:[t.jsxs("p",e.__assign({style:l.detailsContainerItem},{children:[t.jsx("span",e.__assign({style:l.boldText},{children:"ISBN:"}))," ",y&&y.length>0&&T?t.jsx("span",{dangerouslySetInnerHTML:{__html:s.sanitizeHtml(n.highlightTermsFunc(null!==(a=f.isbn)&&void 0!==a?a:"NA",y))}}):null!==(c=f.isbn)&&void 0!==c?c:"NA"]})),t.jsxs("p",e.__assign({style:l.detailsContainerItem},{children:[t.jsx("span",e.__assign({style:l.boldText},{children:"ISBN 10:"}))," ",y&&y.length>0&&T?t.jsx("span",{dangerouslySetInnerHTML:{__html:s.sanitizeHtml(n.highlightTermsFunc(null!==(g=f.isbn10)&&void 0!==g?g:"NA",y))}}):null!==(u=f.isbn10)&&void 0!==u?u:"NA"]})),t.jsxs("p",e.__assign({style:l.detailsContainerItem},{children:[t.jsx("span",e.__assign({style:l.boldText},{children:"Imprint:"}))," ",y&&y.length>0&&T?t.jsx("span",{dangerouslySetInnerHTML:{__html:s.sanitizeHtml(n.highlightTermsFunc(null!==(d=f.imprint)&&void 0!==d?d:"NA",y))}}):null!==(h=f.imprint)&&void 0!==h?h:"NA"]})),t.jsxs("p",e.__assign({style:l.detailsContainerItem},{children:[t.jsx("span",e.__assign({style:l.boldText},{children:"Publisher:"}))," ",y&&y.length>0&&T?t.jsx("span",{dangerouslySetInnerHTML:{__html:s.sanitizeHtml(n.highlightTermsFunc(null!==(p=f.publisher)&&void 0!==p?p:"NA",y))}}):null!==(x=f.publisher)&&void 0!==x?x:"NA"]})),t.jsxs("p",e.__assign({style:l.detailsContainerItem},{children:[t.jsx("span",e.__assign({style:l.boldText},{children:"Publishing Date:"}))," ",y&&y.length>0&&T?t.jsx("span",{dangerouslySetInnerHTML:{__html:s.sanitizeHtml(n.highlightTermsFunc(null!==(m=f.publishingDate)&&void 0!==m?m:"NA",y))}}):null!==(_=f.publishingDate)&&void 0!==_?_:"NA"]})),t.jsxs("p",e.__assign({style:l.detailsContainerItem},{children:[t.jsx("span",e.__assign({style:l.boldText},{children:"Age:"}))," ",y&&y.length>0&&T?t.jsx("span",{dangerouslySetInnerHTML:{__html:s.sanitizeHtml(n.highlightTermsFunc(null!==(b=f.age)&&void 0!==b?b:"NA",y))}}):null!==(v=f.age)&&void 0!==v?v:"NA"]}))]})),t.jsxs("div",e.__assign({style:l.categoriesContainer},{children:[t.jsx("p",e.__assign({style:l.sectionTitle,className:"book-details-section-title"},{children:"Subject Categories"})),t.jsxs("div",e.__assign({style:l.categoriesList,className:"book-details-categories-list"},{children:[A.map(function(i,r){return t.jsx("span",e.__assign({style:l.category,className:"book-details-category"},{children:y&&y.length>0&&T?t.jsx("span",{dangerouslySetInnerHTML:{__html:s.sanitizeHtml(n.highlightTermsFunc(i,z))}}):i}),r)}),f.subjectCategories&&f.subjectCategories.length>10&&t.jsx("button",e.__assign({style:l.button,onClick:function(){return k(!S)},onMouseOver:function(e){return e.currentTarget.style.textDecoration="underline"},onMouseOut:function(e){return e.currentTarget.style.textDecoration="none"}},{children:S?"View less":"View more"}))]}))]})),t.jsxs("div",e.__assign({style:l.reviewsContainer},{children:[t.jsx("p",e.__assign({style:l.sectionTitle,className:"book-details-section-title"},{children:"Book Marketing Collateral"})),t.jsxs("div",e.__assign({style:l.reviewsList,className:"book-details-reviews-list"},{children:[f.reviews&&f.reviews.length>0?(C=f.reviews.filter(function(e){return e.replace(/<[^>]+>/g,"").trim().replace(/&[#A-Za-z0-9]+;/g,"").trim().length>0}),(H?C:C.slice(0,3)).map(function(i,r){return t.jsx("div",e.__assign({style:l.reviewCard,className:"book-details-review-card"},{children:t.jsx("div",{style:l.reviewText,dangerouslySetInnerHTML:{__html:y&&y.length>0&&T?s.sanitizeHtml(n.highlightTermsFunc(i,y)):i}})}),r)})):t.jsx("p",e.__assign({style:l.reviewText},{children:"No Book Marketing Collateral available for this book."})),f.reviews&&f.reviews.length>3&&t.jsx("button",e.__assign({style:l.button,onClick:function(){return I(function(e){return!e})},onMouseOver:function(e){return e.currentTarget.style.textDecoration="underline"},onMouseOut:function(e){return e.currentTarget.style.textDecoration="none"}},{children:H?"View less":"View more"}))]}))]}))]}))};
2
2
  //# sourceMappingURL=BookDetailsCard.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("@mui/material/Pagination"),a=require("@mui/material/Skeleton"),s=require("react"),i=require("react-markdown"),o=require("rehype-raw"),r=require("remark-breaks"),l=require("../utils/highlight.js"),c=require("../../../utils/sanitizeHtml.js");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=u(n),g=u(a),x=u(i),h=u(o),p=u(r),f={sectionTitle:{fontSize:"14px",fontWeight:600,color:"#667085",marginBottom:"12px"},quotesPadding:{paddingLeft:"12px"},quoteCard:{border:"1px solid #CBD5E1",borderRadius:"8px",padding:"16px",backgroundColor:"#F8FAFC",boxShadow:"0 1px 2px rgba(0,0,0,0.05)",marginBottom:"16px",cursor:"pointer",transition:"transform 0.2s ease, box-shadow 0.2s ease"},quoteText:{fontStyle:"italic",color:"#475569",fontSize:"14px",fontWeight:400,marginBottom:"12px"},quoteMeta:{color:"#475569",fontSize:"12px",fontWeight:400},quoteAuthor:{fontSize:"10px",fontWeight:600,color:"#475569",marginTop:"8px",marginBottom:"18px"},button:{color:"#5928ED",fontSize:"14px",fontWeight:600,background:"none",border:"none",cursor:"pointer",padding:0,textDecoration:"none",paddingLeft:"12px"},geoLocationsContainer:{marginTop:"24px",marginBottom:"24px"},geoText:{fontSize:"14px",fontWeight:500,cursor:"pointer",color:"#532BED"},geoDivider:{margin:"0 8px",color:"#475abb",backgroundColor:"#475abb",width:"1px",height:"18px",display:"inline-block"},geoLocationFlex:{display:"inline-flex",alignItems:"center",gap:"8px",marginBottom:"8px"},charactersContainer:{marginTop:"16px"},charactersGrid:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:"16px",marginBottom:"16px",paddingLeft:"12px"},characterCard:{border:"1px solid #E5E7EB",borderRadius:"8px",backgroundColor:"#FFFFFF",boxShadow:"0 1px 2px rgba(0,0,0,0.05)",display:"flex",alignItems:"flex-start",gap:"12px",padding:"16px",cursor:"pointer",transition:"transform 0.2s ease, box-shadow 0.2s ease"},avatar:{width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"9999px",fontSize:"14px",fontWeight:600,flexShrink:0},charName:{fontStyle:"normal",fontWeight:600,color:"#101827",fontSize:"16px"},charDesc:{fontStyle:"normal",fontWeight:400,fontSize:"14px",color:"#6B7280"},retryButton:{backgroundColor:"#5928EC",color:"#fff",padding:"6px 10px",border:"none",borderRadius:"6px",cursor:"pointer",fontSize:"12px",fontWeight:"500"}};exports.default=function(n){var a,i,o;n.data;var r=n.updateQuotesToHighLight,u=n.handleFetchManuscriptElements,_=n.BookIsbn,m=n.title,y=n.highlightTerms,v=n.onHighlightMatch,b=n.defaultPages,j=s.useRef(!0);s.useEffect(function(){return function(){j.current=!1}},[]);var k=s.useState([]),T=k[0],S=k[1],C=s.useState(null!==(a=null==b?void 0:b.quotes)&&void 0!==a?a:1),q=C[0],w=C[1],L=s.useState(!1),N=L[0],B=L[1],E=s.useState(!0),D=E[0],F=E[1],M=s.useState(0),H=M[0],P=M[1],W=s.useState([]),z=W[0],I=W[1],R=s.useState(null!==(i=null==b?void 0:b.characters)&&void 0!==i?i:1),G=R[0],K=R[1],Y=s.useState(!1),A=Y[0],O=Y[1],Q=s.useState(!0),J=Q[0],U=Q[1],V=s.useState(0),X=V[0],Z=V[1],$=s.useState([]),ee=$[0],te=$[1],ne=s.useState(null!==(o=null==b?void 0:b.locations)&&void 0!==o?o:1),ae=ne[0],se=ne[1],ie=s.useState(!1),oe=ie[0],re=ie[1],le=s.useState(!0),ce=le[0],ue=le[1],de=s.useState(0),ge=de[0],xe=de[1],he=s.useState({list:"",index:-1,page:1}),pe=he[0],fe=he[1],_e=s.useRef(!1),me=s.useRef(null);s.useEffect(function(){if(null==y?void 0:y.length){var e=y.map(function(e){return e.toLowerCase()}),t=function(t){return t&&e.some(function(e){return t.toLowerCase().includes(e)})},n=!1;T.forEach(function(e,a){!n&&t(e.text)&&(fe({list:"notable",index:a,page:q}),null==v||v(!0),n=!0)}),ee.forEach(function(e,a){!n&&t(e.name)&&(fe({list:"geo_location",index:a,page:ae}),null==v||v(!0),n=!0)}),z.forEach(function(e,a){n||!t(e.name)&&!t(e.description)||(fe({list:"key_character",index:a,page:G}),null==v||v(!0),n=!0)})}},[y,T,ee,z,q,ae,G]),s.useEffect(function(){b&&(b.quotes&&w(b.quotes),b.locations&&se(b.locations),b.characters&&K(b.characters))},[b]),s.useEffect(function(){_e.current=!1},[y]);var ye=function(t){var n=t.endpoint,a=t.page,s=t.isbn,i=t.setData,o=t.setLoading,r=t.setHasMore,l=t.setTotalPage,c=t.title;return e.__awaiter(void 0,void 0,void 0,function(){var t,d,g,x;return e.__generator(this,function(e){switch(e.label){case 0:o(!0),e.label=1;case 1:return e.trys.push([1,,3,4]),[4,u({endpoint:n,page:a,pageSize:10,isbn:s,title:c})];case 2:return t=e.sent(),j.current?(i((null==t?void 0:t.data)||[]),l((null===(d=null==t?void 0:t.pagination)||void 0===d?void 0:d.totalPages)||0),r(!(null===(g=null==t?void 0:t.pagination)||void 0===g?void 0:g.hasNext)&&!(null===(x=null==t?void 0:t.pagination)||void 0===x?void 0:x.hasPrevious)),[3,4]):[2];case 3:return j.current&&o(!1),[7];case 4:return[2]}})})};return s.useEffect(function(){ye({endpoint:"notable-quotes",page:q,isbn:_,setData:S,setLoading:B,setHasMore:F,setTotalPage:P,title:m})},[q]),s.useEffect(function(){ye({endpoint:"notable-characters",page:G,isbn:_,setData:I,setLoading:O,setHasMore:U,setTotalPage:Z,title:m})},[G]),s.useEffect(function(){ye({endpoint:"geo-locations",page:ae,isbn:_,setData:te,setLoading:re,setHasMore:ue,setTotalPage:xe,title:m})},[ae]),t.jsxs("div",e.__assign({ref:me,className:"book-elements-container"},{children:[t.jsxs("div",e.__assign({style:{marginBottom:"24px"}},{children:[t.jsx("p",e.__assign({style:f.sectionTitle,className:"book-elements-section-title"},{children:"Notable Quotes"})),t.jsxs("div",e.__assign({style:f.quotesPadding},{children:[N?t.jsx("div",e.__assign({style:{display:"flex",flexDirection:"column",rowGap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map(function(n){return t.jsxs("div",e.__assign({className:"book-elements-quote-card",style:f.quoteCard},{children:[t.jsx(g.default,{variant:"text",width:"60%",height:28}),t.jsx(g.default,{variant:"text",width:"40%",height:20}),t.jsx(g.default,{variant:"text",width:"25%",height:20}),t.jsx(g.default,{variant:"text",width:"30%",height:20})]}),n)})})):0===T.length?t.jsxs("p",e.__assign({style:{color:"#6B7280",fontStyle:"italic"}},{children:["No notable quotes found. ",t.jsx("button",e.__assign({style:f.retryButton,onClick:function(){return ye({endpoint:"notable-quotes",page:q,isbn:_,setData:S,setLoading:B,setHasMore:F,setTotalPage:P,title:m})}},{children:"Retry"}))]})):t.jsx(t.Fragment,{children:T.map(function(n,a){var s="notable"===pe.list&&pe.page===q&&pe.index===a;return t.jsxs("div",e.__assign({className:"book-elements-quote-card",style:e.__assign(e.__assign({},f.quoteCard),{borderColor:s?"rgb(83, 43, 237)":"#CBD5E1"}),onMouseEnter:function(e){e.currentTarget.style.transform="translateY(-4px)",e.currentTarget.style.boxShadow="0 4px 12px rgba(0, 0, 0, 0.15)"},onMouseLeave:function(e){e.currentTarget.style.transform="translateY(0)",e.currentTarget.style.boxShadow="0 1px 4px rgba(0, 0, 0, 0.1)"},onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var t,s;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),fe({list:"notable",page:q,index:a}),(null===(s=null==n?void 0:n.chunkIds)||void 0===s?void 0:s.length)>0?[4,r(n.text,"Notable Quotes",n.chunkIds,0)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[3,4];case 3:return t=e.sent(),console.error("Failed to highlight quote:",t),[3,4];case 4:return[2]}})})},"data-selected":"notable"===pe.list&&pe.page===q&&pe.index===a?"true":void 0},{children:[y&&y.length>0?t.jsx("p",{style:f.quoteText,className:"book-elements-quote-text",dangerouslySetInnerHTML:{__html:c.sanitizeHtml(l.highlightTermsFunc(null==n?void 0:n.text,y))}}):t.jsx("p",e.__assign({style:f.quoteText,className:"book-elements-quote-text"},{children:null==n?void 0:n.text})),t.jsxs("p",e.__assign({style:f.quoteMeta,className:"book-elements-quote-meta"},{children:[l.processTextWithHighlight(n.chapter,y)," ",t.jsx("br",{})," ",l.processTextWithHighlight(n.page,y)]})),t.jsxs("p",e.__assign({style:f.quoteAuthor},{children:["— ",l.processTextWithHighlight(null==n?void 0:n.author,y)]}))]}),a)})}),t.jsx("div",e.__assign({className:"book-elements-pagination",style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!D&&t.jsx(d.default,{disabled:N,count:H,page:q,onChange:function(e,t){return w(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]})),t.jsxs("div",e.__assign({style:f.geoLocationsContainer},{children:[t.jsx("p",e.__assign({style:f.sectionTitle,className:"book-elements-section-title"},{children:"Key Geo Locations"})),t.jsxs("div",e.__assign({className:"book-elements-geo-wrapper",style:e.__assign(e.__assign({},f.quotesPadding),{marginBottom:"8px"})},{children:[oe?t.jsx("div",e.__assign({style:{display:"flex",flexWrap:"wrap",gap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map(function(e){return t.jsx(g.default,{variant:"rectangular",width:100,height:20,style:{borderRadius:"8px"}},e)})})):0===ee.length?t.jsxs("p",e.__assign({style:{color:"#6B7280",fontStyle:"italic",paddingLeft:"12px"}},{children:["No key geo locations found. ",t.jsx("button",e.__assign({style:f.retryButton,onClick:function(){return ye({endpoint:"geo-locations",page:ae,isbn:_,setData:te,setLoading:re,setHasMore:ue,setTotalPage:xe,title:m})}},{children:"Retry"}))]})):t.jsx(t.Fragment,{children:ee.map(function(n,a){var s="geo_location"===pe.list&&pe.page===ae&&pe.index===a;return t.jsxs("span",e.__assign({"data-selected":"geo_location"===pe.list&&pe.page===ae&&pe.index===a?"true":void 0,style:f.geoLocationFlex},{children:[t.jsx("span",e.__assign({className:"book-elements-geo-text",style:e.__assign(e.__assign({},f.geoText),{fontWeight:s?"700":"",textDecoration:s?"underline":""}),onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var t,s;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),fe({list:"geo_location",page:ae,index:a}),(null===(s=null==n?void 0:n.chunkIds)||void 0===s?void 0:s.length)>0?[4,r(n.name,"Key Geo Locations",n.chunkIds,0)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[3,4];case 3:return t=e.sent(),console.error("Failed to highlight location:",t),[3,4];case 4:return[2]}})})},onMouseOver:function(e){return e.currentTarget.style.textDecoration="underline"},onMouseOut:function(e){return e.currentTarget.style.textDecoration="none"}},{children:y&&y.length>0?t.jsx("span",{dangerouslySetInnerHTML:{__html:c.sanitizeHtml(l.highlightTermsFunc(null==n?void 0:n.name,y))}}):null==n?void 0:n.name})),a<ee.length-1&&t.jsx("span",{style:f.geoDivider})]}),a)})}),t.jsx("div",e.__assign({className:"book-elements-pagination",style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!ce&&t.jsx(d.default,{disabled:oe,count:ge,page:ae,onChange:function(e,t){return se(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]})),t.jsxs("div",e.__assign({style:f.charactersContainer},{children:[t.jsx("p",e.__assign({style:f.sectionTitle,className:"book-elements-section-title"},{children:"Key Characters"})),A?t.jsx("div",e.__assign({style:{display:"flex",flexWrap:"wrap",gap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map(function(n){return t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},f.characterCard),{flexBasis:"40%"})},{children:[t.jsx(g.default,{variant:"circular",style:e.__assign(e.__assign({},f.avatar),{flexShrink:0})}),t.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",flex:1}},{children:[t.jsx(g.default,{variant:"text",style:{flex:"1",flexShrink:0}}),t.jsx(g.default,{variant:"text",style:{flex:"1"}}),t.jsx(g.default,{variant:"text",style:{flex:"1"}}),t.jsx(g.default,{variant:"text",style:{flex:"1"}})]}))]}),n)})})):0===z.length?t.jsxs("p",e.__assign({style:{color:"#6B7280",fontStyle:"italic",paddingLeft:"12px"}},{children:["No key characters found. ",t.jsx("button",e.__assign({style:f.retryButton,onClick:function(){return ye({endpoint:"notable-characters",page:G,isbn:_,setData:I,setLoading:O,setHasMore:U,setTotalPage:Z,title:m})}},{children:"Retry"}))]})):t.jsx(t.Fragment,{children:t.jsx("div",e.__assign({className:"book-elements-characters-grid",style:f.charactersGrid},{children:z.map(function(n,a){var s=e.__assign(e.__assign({},f.avatar),{backgroundColor:n.bg,color:n.color}),i="key_character"===pe.list&&pe.page===G&&pe.index===a;return t.jsxs("div",e.__assign({onMouseEnter:function(e){e.currentTarget.style.transform="translateY(-4px)",e.currentTarget.style.boxShadow="0 4px 12px rgba(0, 0, 0, 0.15)"},onMouseLeave:function(e){e.currentTarget.style.transform="translateY(0)",e.currentTarget.style.boxShadow="0 1px 4px rgba(0, 0, 0, 0.1)"},className:"book-elements-character-card",style:e.__assign(e.__assign({},f.characterCard),{borderColor:i?"rgb(83, 43, 237)":"#E5E7EB"}),onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var t,s;return e.__generator(this,function(e){switch(e.label){case 0:fe({list:"key_character",page:G,index:a}),e.label=1;case 1:return e.trys.push([1,4,,5]),(null===(s=null==n?void 0:n.chunkIds)||void 0===s?void 0:s.length)>0?[4,r(n.name,"Key Characters",n.chunkIds,0)]:[3,3];case 2:e.sent(),e.label=3;case 3:return[3,5];case 4:return t=e.sent(),console.error("Failed to highlight character:",t),[3,5];case 5:return[2]}})})},"data-selected":"key_character"===pe.list&&pe.page===G&&pe.index===a?"true":void 0},{children:[t.jsx("div",e.__assign({style:s},{children:n.initials})),t.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column"}},{children:[t.jsx("p",e.__assign({className:"book-elements-char-name",style:e.__assign(e.__assign({},f.charName),{margin:0})},{children:y&&y.length>0?t.jsx("span",{dangerouslySetInnerHTML:{__html:c.sanitizeHtml(l.highlightTermsFunc(n.name,y))}}):n.name})),t.jsx("p",e.__assign({className:"book-elements-char-desc",style:e.__assign(e.__assign({},f.charDesc),{margin:0,marginTop:"4px"})},{children:t.jsx(x.default,e.__assign({remarkPlugins:[p.default],rehypePlugins:[h.default],components:{p:function(n){n.node;var a=e.__rest(n,["node"]);return t.jsx("p",e.__assign({style:{marginTop:0}},a))}}},{children:l.processTextWithHighlight(null==n?void 0:n.description,y)}))}))]}))]}),a)})}))}),t.jsx("div",e.__assign({className:"book-elements-pagination",style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!J&&t.jsx(d.default,{count:X,disabled:A,page:G,onChange:function(e,t){return K(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("@mui/material/Pagination"),a=require("@mui/material/Skeleton"),s=require("react"),i=require("react-markdown"),o=require("rehype-raw"),r=require("remark-breaks"),l=require("../utils/highlight.js"),c=require("../../../utils/sanitizeHtml.js");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=u(n),g=u(a),x=u(i),h=u(o),p=u(r),f={sectionTitle:{fontSize:"14px",fontWeight:600,color:"#667085",marginBottom:"12px"},quotesPadding:{paddingLeft:"12px"},quoteCard:{border:"1px solid #CBD5E1",borderRadius:"8px",padding:"16px",backgroundColor:"#F8FAFC",boxShadow:"0 1px 2px rgba(0,0,0,0.05)",marginBottom:"16px",cursor:"pointer",transition:"transform 0.2s ease, box-shadow 0.2s ease"},quoteText:{fontStyle:"italic",color:"#475569",fontSize:"14px",fontWeight:400,marginBottom:"12px"},quoteMeta:{color:"#475569",fontSize:"12px",fontWeight:400},quoteAuthor:{fontSize:"10px",fontWeight:600,color:"#475569",marginTop:"8px",marginBottom:"18px"},button:{color:"#5928ED",fontSize:"14px",fontWeight:600,background:"none",border:"none",cursor:"pointer",padding:0,textDecoration:"none",paddingLeft:"12px"},geoLocationsContainer:{marginTop:"24px",marginBottom:"24px"},geoText:{fontSize:"14px",fontWeight:500,cursor:"pointer",color:"#532BED"},geoDivider:{margin:"0 8px",color:"#475abb",backgroundColor:"#475abb",width:"1px",height:"18px",display:"inline-block"},geoLocationFlex:{display:"inline-flex",alignItems:"center",gap:"8px",marginBottom:"8px"},charactersContainer:{marginTop:"16px"},charactersGrid:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:"16px",marginBottom:"16px",paddingLeft:"12px"},characterCard:{border:"1px solid #E5E7EB",borderRadius:"8px",backgroundColor:"#FFFFFF",boxShadow:"0 1px 2px rgba(0,0,0,0.05)",display:"flex",alignItems:"flex-start",gap:"12px",padding:"16px",cursor:"pointer",transition:"transform 0.2s ease, box-shadow 0.2s ease"},avatar:{width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"9999px",fontSize:"14px",fontWeight:600,flexShrink:0},charName:{fontStyle:"normal",fontWeight:600,color:"#101827",fontSize:"16px"},charDesc:{fontStyle:"normal",fontWeight:400,fontSize:"14px",color:"#6B7280"},retryButton:{backgroundColor:"#5928EC",color:"#fff",padding:"6px 10px",border:"none",borderRadius:"6px",cursor:"pointer",fontSize:"12px",fontWeight:"500"}};exports.default=function(n){var a,i,o;n.data;var r=n.updateQuotesToHighLight,u=n.handleFetchManuscriptElements,_=n.BookIsbn,m=n.title,y=n.highlightTerms,v=n.onHighlightMatch,b=n.defaultPages;n.citationType;var j=n.citationSubTitle,k=n.highlightEnabled,S=s.useRef(!0);s.useEffect(function(){return function(){S.current=!1}},[]);var T=s.useState([]),C=T[0],q=T[1],w=s.useState(null!==(a=null==b?void 0:b.quotes)&&void 0!==a?a:1),L=w[0],N=w[1],E=s.useState(!1),B=E[0],D=E[1],F=s.useState(!0),M=F[0],P=F[1],H=s.useState(0),z=H[0],I=H[1],W=s.useState([]),R=W[0],G=W[1],K=s.useState(null!==(i=null==b?void 0:b.characters)&&void 0!==i?i:1),Y=K[0],A=K[1],O=s.useState(!1),Q=O[0],J=O[1],U=s.useState(!0),V=U[0],X=U[1],Z=s.useState(0),$=Z[0],ee=Z[1],te=s.useState([]),ne=te[0],ae=te[1],se=s.useState(null!==(o=null==b?void 0:b.locations)&&void 0!==o?o:1),ie=se[0],oe=se[1],re=s.useState(!1),le=re[0],ce=re[1],ue=s.useState(!0),de=ue[0],ge=ue[1],xe=s.useState(0),he=xe[0],pe=xe[1],fe=s.useState({list:"",index:-1,page:1}),_e=fe[0],me=fe[1],ye=s.useRef(!1),ve=s.useRef(null);s.useEffect(function(){if((null==y?void 0:y.length)&&k){var e=y.map(function(e){return e.toLowerCase()}),t=function(t){return t&&e.some(function(e){return t.toLowerCase().includes(e)})},n=!1;"notable_quotes"==j&&C.forEach(function(e,a){!n&&t(e.text)&&(null==v||v(!0),n=!0)}),"location_details"==j&&ne.forEach(function(e,a){!n&&t(e.name)&&(null==v||v(!0),n=!0)}),"notable_characters"==j&&R.forEach(function(t,a){var s;!n&&((s=t.name)&&e[0]===s.toLowerCase())&&(null==v||v(!0),n=!0)})}},[y,C,ne,R,L,ie,Y]),s.useEffect(function(){b&&(b.quotes&&N(b.quotes),b.locations&&oe(b.locations),b.characters&&A(b.characters))},[b]),s.useEffect(function(){ye.current=!1},[y]);var be=function(t){var n=t.endpoint,a=t.page,s=t.isbn,i=t.setData,o=t.setLoading,r=t.setHasMore,l=t.setTotalPage,c=t.title;return e.__awaiter(void 0,void 0,void 0,function(){var t,d,g,x;return e.__generator(this,function(e){switch(e.label){case 0:o(!0),e.label=1;case 1:return e.trys.push([1,,3,4]),[4,u({endpoint:n,page:a,pageSize:10,isbn:s,title:c})];case 2:return t=e.sent(),S.current?(i((null==t?void 0:t.data)||[]),l((null===(d=null==t?void 0:t.pagination)||void 0===d?void 0:d.totalPages)||0),r(!(null===(g=null==t?void 0:t.pagination)||void 0===g?void 0:g.hasNext)&&!(null===(x=null==t?void 0:t.pagination)||void 0===x?void 0:x.hasPrevious)),[3,4]):[2];case 3:return S.current&&o(!1),[7];case 4:return[2]}})})};return s.useEffect(function(){be({endpoint:"notable-quotes",page:L,isbn:_,setData:q,setLoading:D,setHasMore:P,setTotalPage:I,title:m})},[L]),s.useEffect(function(){be({endpoint:"notable-characters",page:Y,isbn:_,setData:G,setLoading:J,setHasMore:X,setTotalPage:ee,title:m})},[Y]),s.useEffect(function(){be({endpoint:"geo-locations",page:ie,isbn:_,setData:ae,setLoading:ce,setHasMore:ge,setTotalPage:pe,title:m})},[ie]),t.jsxs("div",e.__assign({ref:ve,className:"book-elements-container"},{children:[t.jsxs("div",e.__assign({style:{marginBottom:"24px"}},{children:[t.jsx("p",e.__assign({style:f.sectionTitle,className:"book-elements-section-title"},{children:"Notable Quotes"})),t.jsxs("div",e.__assign({style:f.quotesPadding},{children:[B?t.jsx("div",e.__assign({style:{display:"flex",flexDirection:"column",rowGap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map(function(n){return t.jsxs("div",e.__assign({className:"book-elements-quote-card",style:f.quoteCard},{children:[t.jsx(g.default,{variant:"text",width:"60%",height:28}),t.jsx(g.default,{variant:"text",width:"40%",height:20}),t.jsx(g.default,{variant:"text",width:"25%",height:20}),t.jsx(g.default,{variant:"text",width:"30%",height:20})]}),n)})})):0===C.length?t.jsxs("p",e.__assign({style:{color:"#6B7280",fontStyle:"italic"}},{children:["No notable quotes found. ",t.jsx("button",e.__assign({style:f.retryButton,onClick:function(){return be({endpoint:"notable-quotes",page:L,isbn:_,setData:q,setLoading:D,setHasMore:P,setTotalPage:I,title:m})}},{children:"Retry"}))]})):t.jsx(t.Fragment,{children:C.map(function(n,a){var s="notable"===_e.list&&_e.page===L&&_e.index===a;return t.jsxs("div",e.__assign({className:"book-elements-quote-card",style:e.__assign(e.__assign({},f.quoteCard),{borderColor:s?"rgb(83, 43, 237)":"#CBD5E1"}),onMouseEnter:function(e){e.currentTarget.style.transform="translateY(-4px)",e.currentTarget.style.boxShadow="0 4px 12px rgba(0, 0, 0, 0.15)"},onMouseLeave:function(e){e.currentTarget.style.transform="translateY(0)",e.currentTarget.style.boxShadow="0 1px 4px rgba(0, 0, 0, 0.1)"},onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var t,s;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),me({list:"notable",page:L,index:a}),(null===(s=null==n?void 0:n.chunkIds)||void 0===s?void 0:s.length)>0?[4,r(n.text,"Notable Quotes",n.chunkIds,0)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[3,4];case 3:return t=e.sent(),console.error("Failed to highlight quote:",t),[3,4];case 4:return[2]}})})},"data-selected":"notable"===_e.list&&_e.page===L&&_e.index===a?"true":void 0},{children:[y&&y.length>0&&"notable_quotes"==j&&k?t.jsx("p",{style:f.quoteText,className:"book-elements-quote-text",dangerouslySetInnerHTML:{__html:c.sanitizeHtml(l.highlightTermsFunc(null==n?void 0:n.text,y))}}):t.jsx("p",e.__assign({style:f.quoteText,className:"book-elements-quote-text"},{children:null==n?void 0:n.text})),t.jsxs("p",e.__assign({style:f.quoteMeta,className:"book-elements-quote-meta"},{children:[n.chapter,t.jsx("br",{}),n.page]})),t.jsxs("p",e.__assign({style:f.quoteAuthor},{children:["— ",null==n?void 0:n.author]}))]}),a)})}),t.jsx("div",e.__assign({className:"book-elements-pagination",style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!M&&t.jsx(d.default,{disabled:B,count:z,page:L,onChange:function(e,t){return N(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]})),t.jsxs("div",e.__assign({style:f.geoLocationsContainer},{children:[t.jsx("p",e.__assign({style:f.sectionTitle,className:"book-elements-section-title"},{children:"Key Geo Locations"})),t.jsxs("div",e.__assign({className:"book-elements-geo-wrapper",style:e.__assign(e.__assign({},f.quotesPadding),{marginBottom:"8px"})},{children:[le?t.jsx("div",e.__assign({style:{display:"flex",flexWrap:"wrap",gap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map(function(e){return t.jsx(g.default,{variant:"rectangular",width:100,height:20,style:{borderRadius:"8px"}},e)})})):0===ne.length?t.jsxs("p",e.__assign({style:{color:"#6B7280",fontStyle:"italic",paddingLeft:"12px"}},{children:["No key geo locations found. ",t.jsx("button",e.__assign({style:f.retryButton,onClick:function(){return be({endpoint:"geo-locations",page:ie,isbn:_,setData:ae,setLoading:ce,setHasMore:ge,setTotalPage:pe,title:m})}},{children:"Retry"}))]})):t.jsx(t.Fragment,{children:ne.map(function(n,a){var s="geo_location"===_e.list&&_e.page===ie&&_e.index===a;return t.jsxs("span",e.__assign({"data-selected":"geo_location"===_e.list&&_e.page===ie&&_e.index===a?"true":void 0,style:f.geoLocationFlex},{children:[t.jsx("span",e.__assign({className:"book-elements-geo-text",style:e.__assign(e.__assign({},f.geoText),{fontWeight:s?"700":"",textDecoration:s?"underline":""}),onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var t,s;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),me({list:"geo_location",page:ie,index:a}),(null===(s=null==n?void 0:n.chunkIds)||void 0===s?void 0:s.length)>0?[4,r(n.name,"Key Geo Locations",n.chunkIds,0)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[3,4];case 3:return t=e.sent(),console.error("Failed to highlight location:",t),[3,4];case 4:return[2]}})})},onMouseOver:function(e){return e.currentTarget.style.textDecoration="underline"},onMouseOut:function(e){return e.currentTarget.style.textDecoration="none"}},{children:y&&y.length>0&&"location_details"==j&&k?t.jsx("span",{dangerouslySetInnerHTML:{__html:c.sanitizeHtml(l.highlightTermsFunc(null==n?void 0:n.name,y))}}):null==n?void 0:n.name})),a<ne.length-1&&t.jsx("span",{style:f.geoDivider})]}),a)})}),t.jsx("div",e.__assign({className:"book-elements-pagination",style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!de&&t.jsx(d.default,{disabled:le,count:he,page:ie,onChange:function(e,t){return oe(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]})),t.jsxs("div",e.__assign({style:f.charactersContainer},{children:[t.jsx("p",e.__assign({style:f.sectionTitle,className:"book-elements-section-title"},{children:"Key Characters"})),Q?t.jsx("div",e.__assign({style:{display:"flex",flexWrap:"wrap",gap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map(function(n){return t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},f.characterCard),{flexBasis:"40%"})},{children:[t.jsx(g.default,{variant:"circular",style:e.__assign(e.__assign({},f.avatar),{flexShrink:0})}),t.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",flex:1}},{children:[t.jsx(g.default,{variant:"text",style:{flex:"1",flexShrink:0}}),t.jsx(g.default,{variant:"text",style:{flex:"1"}}),t.jsx(g.default,{variant:"text",style:{flex:"1"}}),t.jsx(g.default,{variant:"text",style:{flex:"1"}})]}))]}),n)})})):0===R.length?t.jsxs("p",e.__assign({style:{color:"#6B7280",fontStyle:"italic",paddingLeft:"12px"}},{children:["No key characters found. ",t.jsx("button",e.__assign({style:f.retryButton,onClick:function(){return be({endpoint:"notable-characters",page:Y,isbn:_,setData:G,setLoading:J,setHasMore:X,setTotalPage:ee,title:m})}},{children:"Retry"}))]})):t.jsx(t.Fragment,{children:t.jsx("div",e.__assign({className:"book-elements-characters-grid",style:f.charactersGrid},{children:R.map(function(n,a){var s=e.__assign(e.__assign({},f.avatar),{backgroundColor:n.bg,color:n.color}),i="key_character"===_e.list&&_e.page===Y&&_e.index===a;return t.jsxs("div",e.__assign({onMouseEnter:function(e){e.currentTarget.style.transform="translateY(-4px)",e.currentTarget.style.boxShadow="0 4px 12px rgba(0, 0, 0, 0.15)"},onMouseLeave:function(e){e.currentTarget.style.transform="translateY(0)",e.currentTarget.style.boxShadow="0 1px 4px rgba(0, 0, 0, 0.1)"},className:"book-elements-character-card",style:e.__assign(e.__assign({},f.characterCard),{borderColor:i?"rgb(83, 43, 237)":"#E5E7EB"}),onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var t,s;return e.__generator(this,function(e){switch(e.label){case 0:me({list:"key_character",page:Y,index:a}),e.label=1;case 1:return e.trys.push([1,4,,5]),(null===(s=null==n?void 0:n.chunkIds)||void 0===s?void 0:s.length)>0?[4,r(n.name,"Key Characters",n.chunkIds,0)]:[3,3];case 2:e.sent(),e.label=3;case 3:return[3,5];case 4:return t=e.sent(),console.error("Failed to highlight character:",t),[3,5];case 5:return[2]}})})},"data-selected":"key_character"===_e.list&&_e.page===Y&&_e.index===a?"true":void 0},{children:[t.jsx("div",e.__assign({style:s},{children:n.initials})),t.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column"}},{children:[t.jsx("p",e.__assign({className:"book-elements-char-name",style:e.__assign(e.__assign({},f.charName),{margin:0})},{children:y&&y.length>0&&"notable_characters"==j&&n.name.toLowerCase()===y[0].toLowerCase()&&k?t.jsx("span",{dangerouslySetInnerHTML:{__html:c.sanitizeHtml(l.highlightTermsFunc(n.name,y))}}):n.name})),t.jsx("p",e.__assign({className:"book-elements-char-desc",style:e.__assign(e.__assign({},f.charDesc),{margin:0,marginTop:"4px"})},{children:t.jsx(x.default,e.__assign({remarkPlugins:[p.default],rehypePlugins:[h.default],components:{p:function(n){n.node;var a=e.__rest(n,["node"]);return t.jsx("p",e.__assign({style:{marginTop:0}},a))}}},{children:null==n?void 0:n.description}))}))]}))]}),a)})}))}),t.jsx("div",e.__assign({className:"book-elements-pagination",style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!V&&t.jsx(d.default,{count:$,disabled:Q,page:Y,onChange:function(e,t){return A(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]}))};
2
2
  //# sourceMappingURL=BookElementsCard.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("react"),i=require("react-markdown"),l=require("remark-breaks"),o=require("rehype-raw"),s=require("../utils/highlight.js"),r=require("../../../utils/sanitizeHtml.js");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=a(i),c=a(l),d=a(o),g={card:{border:"2px solid #E5E7EB",backgroundColor:"#FFFFFF",borderRadius:"12px",padding:"24px"},title:{fontSize:"16px",fontWeight:"bold",marginBottom:"24px"},grid:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(110px, 1fr))",gap:"24px",marginBottom:"24px"},gridItem:{backgroundColor:"#F8FAFC",border:"1px solid #DFE5EC",borderRadius:"8px",padding:"12px 8px",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"12px"},gridItemHeight:{height:"50px"},label:{fontSize:"14px",fontWeight:400,color:"#64748B",margin:0},value:{fontWeight:"bold",fontSize:"14px",color:"#434C55",margin:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"120px"},section:{marginBottom:"12px",padding:"8px 12px",borderRadius:"8px",border:"1px solid #DEE4EB"},sectionLabel:{fontSize:"14px",fontWeight:600,color:"#667085",marginBottom:"8px",whiteSpace:"pre-line"},summaryText:{marginTop:"0px"},sectionText:{fontSize:"16px",fontWeight:400,lineHeight:"1.625",color:"#64748B",marginBottom:"8px"},button:{color:"#5928ED",fontSize:"14px",fontWeight:600,background:"none",border:"none",cursor:"pointer",padding:0,textDecoration:"none"},lineClamp:{display:"-webkit-box",WebkitLineClamp:3,WebkitBoxOrient:"vertical",overflow:"hidden"},container:{fontFamily:"Inter, sans-serif",color:"#434C54",marginBottom:"8px"},partContainer:{marginBottom:"8px"},partTitle:{fontSize:"16px",fontWeight:"600",marginBottom:"10px"},chapterList:{listStyle:"none",paddingLeft:"20px",margin:0},chapterItem:{marginBottom:"6px"},chapterLink:{textDecoration:"none",color:"#63748A",fontSize:"16px",lineHeight:"1.5"},chapterLinkHover:{textDecoration:"underline"},singleChapter:{marginBottom:"4px",fontSize:"16px"},chapterNumber:{color:"#63748A"}};exports.default=function(i){var l,o,a,h,m,p,_,x,v,f,y,b,j,k,T,S=i.data,C=i.highlightTerms,N=i.onHighlightMatch,H=n.useState(!1),L=H[0],B=H[1],w=n.useState(!1),F=w[0],I=w[1],z=n.useState(!1),M=z[0],D=z[1],O=n.useState(!1),A=O[0],E=O[1],W=n.useRef(null),q=n.useRef(null),P=(null==S?void 0:S.tableOfContent)&&S.tableOfContent.every(function(e){return!e.title||""===e.title.trim()}),R=null===(h=null===(a=null===(o=null===(l=null==S?void 0:S.bookDescription)||void 0===l?void 0:l.replace(/display:\s*-webkit-box;?/g,""))||void 0===o?void 0:o.replace(/-webkit-line-clamp:\s*\d+;?/g,""))||void 0===a?void 0:a.replace(/-webkit-box-orient:\s*vertical;?/g,""))||void 0===h?void 0:h.replace(/overflow:\s*hidden;?/g,""),V=function(e){return null!=e?String(e):""};return n.useLayoutEffect(function(){if(W.current){var e=W.current.scrollHeight>W.current.clientHeight;E(e)}},[null==S?void 0:S.bookDescription,F]),n.useEffect(function(){var e;if(null==C?void 0:C.length){var t=C.map(function(e){return e.toLowerCase()}),n=function(e){return e&&t.some(function(t){return e.toLowerCase().includes(t)})},i=n(S.title),l=n(S.author),o=n(S.bookDescription),s=n(S.summary),r=n(V(null==S?void 0:S.totalSectionCount)),a=n(V(null==S?void 0:S.totalPages)),u=n(S.readingTime),c=null===(e=null==S?void 0:S.tableOfContent)||void 0===e?void 0:e.some(function(e){var t;return n(null==e?void 0:e.title)||(null===(t=null==e?void 0:e.children)||void 0===t?void 0:t.some(function(e){return n(null==e?void 0:e.title)}))}),d=i||l||o||s||r||a||u||c;null==N||N(d),d&&(o&&I(!0),s&&B(!0),c&&D(!0))}},[C,S]),t.jsxs("div",e.__assign({ref:q,style:g.card,className:"book-card-container"},{children:[t.jsxs("div",e.__assign({style:g.grid,className:"book-card-grid"},{children:[t.jsxs("div",e.__assign({style:g.gridItem},{children:[t.jsx("p",e.__assign({style:g.label},{children:"Book Title"})),C&&C.length>0?t.jsx("p",{style:g.value,className:"book-card-value",title:null==S?void 0:S.title,dangerouslySetInnerHTML:{__html:r.sanitizeHtml(s.highlightTermsFunc(null!==(m=null==S?void 0:S.title)&&void 0!==m?m:"NA",C))}}):t.jsx("p",e.__assign({style:g.value,className:"book-card-value",title:null==S?void 0:S.title},{children:null!==(p=null==S?void 0:S.title)&&void 0!==p?p:"NA"}))]})),t.jsxs("div",e.__assign({style:g.gridItem},{children:[t.jsx("p",e.__assign({style:g.label},{children:"Book Author"})),C&&C.length>0?t.jsx("p",{style:g.value,className:"book-card-value",title:null==S?void 0:S.author,dangerouslySetInnerHTML:{__html:r.sanitizeHtml(s.highlightTermsFunc(null!==(_=null==S?void 0:S.author)&&void 0!==_?_:"NA",C))}}):t.jsx("p",e.__assign({style:g.value,className:"book-card-value",title:null==S?void 0:S.author},{children:null!==(x=null==S?void 0:S.author)&&void 0!==x?x:"NA"}))]})),t.jsxs("div",e.__assign({style:g.gridItem},{children:[t.jsx("p",e.__assign({style:g.label},{children:"Total Sections"})),C&&C.length>0?t.jsx("p",{style:g.value,className:"book-card-value",dangerouslySetInnerHTML:{__html:r.sanitizeHtml(s.highlightTermsFunc(null!==(v=String(null==S?void 0:S.totalSectionCount))&&void 0!==v?v:"NA",C))}}):t.jsx("p",e.__assign({style:g.value,className:"book-card-value"},{children:null!==(f=null==S?void 0:S.totalSectionCount)&&void 0!==f?f:"NA"}))]})),t.jsxs("div",e.__assign({style:g.gridItem},{children:[t.jsx("p",e.__assign({style:g.label},{children:"Total Pages"})),C&&C.length>0?t.jsx("p",{style:g.value,className:"book-card-value",dangerouslySetInnerHTML:{__html:r.sanitizeHtml(s.highlightTermsFunc(String(null!==(y=null==S?void 0:S.totalPages)&&void 0!==y?y:"NA"),C))}}):t.jsx("p",e.__assign({style:g.value,className:"book-card-value"},{children:null!==(b=null==S?void 0:S.totalPages)&&void 0!==b?b:"NA"}))]})),t.jsxs("div",e.__assign({style:g.gridItem},{children:[t.jsx("p",e.__assign({style:g.label},{children:"Reading Time"})),C&&C.length>0?t.jsx("p",{style:g.value,className:"book-card-value",dangerouslySetInnerHTML:{__html:r.sanitizeHtml(s.highlightTermsFunc(String(null!==(j=null==S?void 0:S.readingTime)&&void 0!==j?j:"NA"),C))}}):t.jsx("p",e.__assign({style:g.value,className:"book-card-value"},{children:null!==(k=null==S?void 0:S.readingTime)&&void 0!==k?k:"NA"}))]}))]})),(null==S?void 0:S.bookDescription)&&(null==S?void 0:S.bookDescription.length)>0&&t.jsxs("div",e.__assign({style:g.section,className:"book-card-section"},{children:[t.jsx("p",e.__assign({style:g.sectionLabel},{children:"Book Description"})),t.jsx("div",e.__assign({ref:W,className:"book-card-section-text",style:e.__assign(e.__assign(e.__assign({},g.sectionText),g.summaryText),F?{}:g.lineClamp)},{children:t.jsx("div",{dangerouslySetInnerHTML:{__html:C&&C.length>0?r.sanitizeHtml(s.highlightTermsFunc(R||"",C)):R}})})),(A||F)&&t.jsx("button",e.__assign({style:e.__assign(e.__assign({},g.button),{marginBottom:"10px"}),onClick:function(){return I(function(e){return!e})},onMouseOver:function(e){return e.currentTarget.style.textDecoration="underline"},onMouseOut:function(e){return e.currentTarget.style.textDecoration="none"}},{children:F?"View Less":"View More"}))]})),t.jsxs("div",e.__assign({style:g.section,className:"book-card-section"},{children:[t.jsx("p",e.__assign({style:g.sectionLabel},{children:"AI Book Summary"})),t.jsx("p",e.__assign({className:"book-card-section-text",style:e.__assign(e.__assign({},g.sectionText),L?{}:g.lineClamp)},{children:t.jsx(u.default,e.__assign({remarkPlugins:[c.default],rehypePlugins:[d.default],components:{p:function(n){n.node;var i=e.__rest(n,["node"]);return t.jsx("p",e.__assign({style:{marginTop:"0"}},i))}}},{children:s.processTextWithHighlight(null==S?void 0:S.summary,C)}))})),(null==S?void 0:S.summary)&&(null==S?void 0:S.summary.length)>0&&t.jsx("button",e.__assign({style:e.__assign(e.__assign({},g.button),{marginBottom:"10px"}),onClick:function(){return B(function(e){return!e})},onMouseOver:function(e){return e.currentTarget.style.textDecoration="underline"},onMouseOut:function(e){return e.currentTarget.style.textDecoration="none"}},{children:L?"View Less":"View More"}))]})),t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},g.section),{marginTop:"10px"})},{children:[t.jsx("p",e.__assign({style:e.__assign(e.__assign({},g.sectionLabel),{marginBottom:"18px"})},{children:"Table Of Content"})),t.jsx("div",e.__assign({style:e.__assign(e.__assign({},g.container),M?{}:g.lineClamp)},{children:(null==S?void 0:S.tableOfContent)&&!P?null===(T=null==S?void 0:S.tableOfContent)||void 0===T?void 0:T.map(function(n,i){return t.jsx("div",e.__assign({style:g.partContainer},{children:n.children?t.jsxs(t.Fragment,{children:[t.jsx("p",{style:g.partTitle,className:"book-card-part-title",dangerouslySetInnerHTML:{__html:C&&C.length>0?r.sanitizeHtml(s.highlightTermsFunc(n.title,C)):n.title}}),t.jsx("ul",e.__assign({style:g.chapterList},{children:n.children.map(function(n,i){return t.jsx("li",e.__assign({style:g.chapterItem},{children:t.jsx("span",{style:g.chapterLink,className:"book-card-chapter-link",dangerouslySetInnerHTML:{__html:C&&C.length>0?r.sanitizeHtml(s.highlightTermsFunc(n.title,C)):n.title}})}),i)})}))]}):t.jsx("div",e.__assign({style:g.singleChapter},{children:t.jsx("span",{style:g.chapterLink,className:"book-card-chapter-link",dangerouslySetInnerHTML:{__html:C&&C.length>0?r.sanitizeHtml(s.highlightTermsFunc(n.title,C)):n.title}})}))}),i)}):t.jsx("p",e.__assign({style:{fontStyle:"italic",fontSize:"16px",color:"#6B7280",margin:"8px 0"}},{children:"Table of Contents not found for this book."}))})),(null==S?void 0:S.tableOfContent)&&!P&&(null==S?void 0:S.tableOfContent.length)>0&&t.jsx("button",e.__assign({style:e.__assign(e.__assign({},g.button),{marginBottom:"10px"}),onClick:function(){return D(function(e){return!e})},onMouseOver:function(e){return e.currentTarget.style.textDecoration="underline"},onMouseOut:function(e){return e.currentTarget.style.textDecoration="none"}},{children:M?"View Less":"View More"}))]}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("react"),i=require("react-markdown"),l=require("remark-breaks"),o=require("rehype-raw"),s=require("../utils/highlight.js"),r=require("../../../utils/sanitizeHtml.js");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=a(i),d=a(l),c=a(o),g={card:{border:"2px solid #E5E7EB",backgroundColor:"#FFFFFF",borderRadius:"12px",padding:"24px"},title:{fontSize:"16px",fontWeight:"bold",marginBottom:"24px"},grid:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(110px, 1fr))",gap:"24px",marginBottom:"24px"},gridItem:{backgroundColor:"#F8FAFC",border:"1px solid #DFE5EC",borderRadius:"8px",padding:"12px 8px",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"12px"},gridItemHeight:{height:"50px"},label:{fontSize:"14px",fontWeight:400,color:"#64748B",margin:0},value:{fontWeight:"bold",fontSize:"14px",color:"#434C55",margin:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"120px"},section:{marginBottom:"12px",padding:"8px 12px",borderRadius:"8px",border:"1px solid #DEE4EB"},sectionLabel:{fontSize:"14px",fontWeight:600,color:"#667085",marginBottom:"8px",whiteSpace:"pre-line"},summaryText:{marginTop:"0px"},sectionText:{fontSize:"16px",fontWeight:400,lineHeight:"1.625",color:"#64748B",marginBottom:"8px"},button:{color:"#5928ED",fontSize:"14px",fontWeight:600,background:"none",border:"none",cursor:"pointer",padding:0,textDecoration:"none"},lineClamp:{display:"-webkit-box",WebkitLineClamp:3,WebkitBoxOrient:"vertical",overflow:"hidden"},container:{fontFamily:"Inter, sans-serif",color:"#434C54",marginBottom:"8px"},partContainer:{marginBottom:"8px"},partTitle:{fontSize:"16px",fontWeight:"600",marginBottom:"10px"},chapterList:{listStyle:"none",paddingLeft:"20px",margin:0},chapterItem:{marginBottom:"6px"},chapterLink:{textDecoration:"none",color:"#63748A",fontSize:"16px",lineHeight:"1.5"},chapterLinkHover:{textDecoration:"underline"},singleChapter:{marginBottom:"4px",fontSize:"16px"},chapterNumber:{color:"#63748A"}};exports.default=function(i){var l,o,a,h,m,p,_,x,v,f,y,b,j,k,T,S=i.data,C=i.highlightTerms,N=i.onHighlightMatch,H=i.highlightEnabled,L=n.useState(!1),B=L[0],w=L[1],F=n.useState(!1),I=F[0],z=F[1],M=n.useState(!1),D=M[0],O=M[1],A=n.useState(!1),E=A[0],W=A[1],q=n.useRef(null),P=n.useRef(null),R=(null==S?void 0:S.tableOfContent)&&S.tableOfContent.every(function(e){return!e.title||""===e.title.trim()}),V=null===(h=null===(a=null===(o=null===(l=null==S?void 0:S.bookDescription)||void 0===l?void 0:l.replace(/display:\s*-webkit-box;?/g,""))||void 0===o?void 0:o.replace(/-webkit-line-clamp:\s*\d+;?/g,""))||void 0===a?void 0:a.replace(/-webkit-box-orient:\s*vertical;?/g,""))||void 0===h?void 0:h.replace(/overflow:\s*hidden;?/g,""),G=function(e){return null!=e?String(e):""};return n.useLayoutEffect(function(){if(q.current){var e=q.current.scrollHeight>q.current.clientHeight;W(e)}},[null==S?void 0:S.bookDescription,I]),n.useEffect(function(){var e;if((null==C?void 0:C.length)&&H){var t=C.map(function(e){return e.toLowerCase()}),n=function(e){return e&&t.some(function(t){return e.toLowerCase().includes(t)})},i=n(S.title),l=n(S.author),o=n(S.bookDescription),s=n(S.summary),r=n(G(null==S?void 0:S.totalSectionCount)),a=n(G(null==S?void 0:S.totalPages)),u=n(S.readingTime),d=null===(e=null==S?void 0:S.tableOfContent)||void 0===e?void 0:e.some(function(e){var t;return n(null==e?void 0:e.title)||(null===(t=null==e?void 0:e.children)||void 0===t?void 0:t.some(function(e){return n(null==e?void 0:e.title)}))}),c=i||l||o||s||r||a||u||d;null==N||N(c),c&&(o&&z(!0),s&&w(!0),d&&O(!0))}},[C,S]),t.jsxs("div",e.__assign({ref:P,style:g.card,className:"book-card-container"},{children:[t.jsxs("div",e.__assign({style:g.grid,className:"book-card-grid"},{children:[t.jsxs("div",e.__assign({style:g.gridItem},{children:[t.jsx("p",e.__assign({style:g.label},{children:"Book Title"})),C&&C.length>0&&H?t.jsx("p",{style:g.value,className:"book-card-value",title:null==S?void 0:S.title,dangerouslySetInnerHTML:{__html:r.sanitizeHtml(s.highlightTermsFunc(null!==(m=null==S?void 0:S.title)&&void 0!==m?m:"NA",C))}}):t.jsx("p",e.__assign({style:g.value,className:"book-card-value",title:null==S?void 0:S.title},{children:null!==(p=null==S?void 0:S.title)&&void 0!==p?p:"NA"}))]})),t.jsxs("div",e.__assign({style:g.gridItem},{children:[t.jsx("p",e.__assign({style:g.label},{children:"Book Author"})),C&&C.length>0&&H?t.jsx("p",{style:g.value,className:"book-card-value",title:null==S?void 0:S.author,dangerouslySetInnerHTML:{__html:r.sanitizeHtml(s.highlightTermsFunc(null!==(_=null==S?void 0:S.author)&&void 0!==_?_:"NA",C))}}):t.jsx("p",e.__assign({style:g.value,className:"book-card-value",title:null==S?void 0:S.author},{children:null!==(x=null==S?void 0:S.author)&&void 0!==x?x:"NA"}))]})),t.jsxs("div",e.__assign({style:g.gridItem},{children:[t.jsx("p",e.__assign({style:g.label},{children:"Total Sections"})),C&&C.length>0&&H?t.jsx("p",{style:g.value,className:"book-card-value",dangerouslySetInnerHTML:{__html:r.sanitizeHtml(s.highlightTermsFunc(null!==(v=String(null==S?void 0:S.totalSectionCount))&&void 0!==v?v:"NA",C))}}):t.jsx("p",e.__assign({style:g.value,className:"book-card-value"},{children:null!==(f=null==S?void 0:S.totalSectionCount)&&void 0!==f?f:"NA"}))]})),t.jsxs("div",e.__assign({style:g.gridItem},{children:[t.jsx("p",e.__assign({style:g.label},{children:"Total Pages"})),C&&C.length>0&&H?t.jsx("p",{style:g.value,className:"book-card-value",dangerouslySetInnerHTML:{__html:r.sanitizeHtml(s.highlightTermsFunc(String(null!==(y=null==S?void 0:S.totalPages)&&void 0!==y?y:"NA"),C))}}):t.jsx("p",e.__assign({style:g.value,className:"book-card-value"},{children:null!==(b=null==S?void 0:S.totalPages)&&void 0!==b?b:"NA"}))]})),t.jsxs("div",e.__assign({style:g.gridItem},{children:[t.jsx("p",e.__assign({style:g.label},{children:"Reading Time"})),C&&C.length>0&&H?t.jsx("p",{style:g.value,className:"book-card-value",dangerouslySetInnerHTML:{__html:r.sanitizeHtml(s.highlightTermsFunc(String(null!==(j=null==S?void 0:S.readingTime)&&void 0!==j?j:"NA"),C))}}):t.jsx("p",e.__assign({style:g.value,className:"book-card-value"},{children:null!==(k=null==S?void 0:S.readingTime)&&void 0!==k?k:"NA"}))]}))]})),(null==S?void 0:S.bookDescription)&&(null==S?void 0:S.bookDescription.length)>0&&t.jsxs("div",e.__assign({style:g.section,className:"book-card-section"},{children:[t.jsx("p",e.__assign({style:g.sectionLabel},{children:"Book Description"})),t.jsx("div",e.__assign({ref:q,className:"book-card-section-text",style:e.__assign(e.__assign(e.__assign({},g.sectionText),g.summaryText),I?{}:g.lineClamp)},{children:t.jsx("div",{dangerouslySetInnerHTML:{__html:C&&C.length>0&&H?r.sanitizeHtml(s.highlightTermsFunc(V||"",C)):V}})})),(E||I)&&t.jsx("button",e.__assign({style:e.__assign(e.__assign({},g.button),{marginBottom:"10px"}),onClick:function(){return z(function(e){return!e})},onMouseOver:function(e){return e.currentTarget.style.textDecoration="underline"},onMouseOut:function(e){return e.currentTarget.style.textDecoration="none"}},{children:I?"View Less":"View More"}))]})),t.jsxs("div",e.__assign({style:g.section,className:"book-card-section"},{children:[t.jsx("p",e.__assign({style:g.sectionLabel},{children:"AI Book Summary"})),t.jsx("p",e.__assign({className:"book-card-section-text",style:e.__assign(e.__assign({},g.sectionText),B?{}:g.lineClamp)},{children:t.jsx(u.default,e.__assign({remarkPlugins:[d.default],rehypePlugins:[c.default],components:{p:function(n){n.node;var i=e.__rest(n,["node"]);return t.jsx("p",e.__assign({style:{marginTop:"0"}},i))}}},{children:s.processTextWithHighlight(null==S?void 0:S.summary,C)}))})),(null==S?void 0:S.summary)&&(null==S?void 0:S.summary.length)>0&&t.jsx("button",e.__assign({style:e.__assign(e.__assign({},g.button),{marginBottom:"10px"}),onClick:function(){return w(function(e){return!e})},onMouseOver:function(e){return e.currentTarget.style.textDecoration="underline"},onMouseOut:function(e){return e.currentTarget.style.textDecoration="none"}},{children:B?"View Less":"View More"}))]})),t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},g.section),{marginTop:"10px"})},{children:[t.jsx("p",e.__assign({style:e.__assign(e.__assign({},g.sectionLabel),{marginBottom:"18px"})},{children:"Table Of Content"})),t.jsx("div",e.__assign({style:e.__assign(e.__assign({},g.container),D?{}:g.lineClamp)},{children:(null==S?void 0:S.tableOfContent)&&!R?null===(T=null==S?void 0:S.tableOfContent)||void 0===T?void 0:T.map(function(n,i){return t.jsx("div",e.__assign({style:g.partContainer},{children:n.children?t.jsxs(t.Fragment,{children:[t.jsx("p",{style:g.partTitle,className:"book-card-part-title",dangerouslySetInnerHTML:{__html:C&&C.length>0&&H?r.sanitizeHtml(s.highlightTermsFunc(n.title,C)):n.title}}),t.jsx("ul",e.__assign({style:g.chapterList},{children:n.children.map(function(n,i){return t.jsx("li",e.__assign({style:g.chapterItem},{children:t.jsx("span",{style:g.chapterLink,className:"book-card-chapter-link",dangerouslySetInnerHTML:{__html:C&&C.length>0&&H?r.sanitizeHtml(s.highlightTermsFunc(n.title,C)):n.title}})}),i)})}))]}):t.jsx("div",e.__assign({style:g.singleChapter},{children:t.jsx("span",{style:g.chapterLink,className:"book-card-chapter-link",dangerouslySetInnerHTML:{__html:C&&C.length>0&&H?r.sanitizeHtml(s.highlightTermsFunc(n.title,C)):n.title}})}))}),i)}):t.jsx("p",e.__assign({style:{fontStyle:"italic",fontSize:"16px",color:"#6B7280",margin:"8px 0"}},{children:"Table of Contents not found for this book."}))})),(null==S?void 0:S.tableOfContent)&&!R&&(null==S?void 0:S.tableOfContent.length)>0&&t.jsx("button",e.__assign({style:e.__assign(e.__assign({},g.button),{marginBottom:"10px"}),onClick:function(){return O(function(e){return!e})},onMouseOver:function(e){return e.currentTarget.style.textDecoration="underline"},onMouseOut:function(e){return e.currentTarget.style.textDecoration="none"}},{children:D?"View Less":"View More"}))]}))]}))};
2
2
  //# sourceMappingURL=BookOverviewCard.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("react"),l=require("../utils/highlight.js"),t=require("../../../utils/sanitizeHtml.js"),r={sectionTitle:{fontSize:"14px",fontWeight:600,color:"#667085",marginBottom:"12px"},card:{backgroundColor:"#ECEEF1",padding:"8px 12px",fontWeight:500,fontSize:"14px",borderRadius:"4px",color:"#64748B",maxWidth:"100%",wordBreak:"break-word",marginBottom:"24px",width:"fit-content"},tag:{padding:"4px 12px",fontSize:"14px",fontWeight:500,color:"#3B82F6",backgroundColor:"#F3F8FF",borderRadius:"6px"},avatar:{display:"flex",alignItems:"center",justifyContent:"center",height:"35px",width:"35px",borderRadius:"50%",backgroundColor:"#E5E7EB",color:"#4B5563",fontWeight:600,flexShrink:0,fontSize:"12px"},contributorName:{fontWeight:600,color:"#111827",marginTop:"8px",fontSize:"14px"},contributorRole:{fontSize:"12px",color:"#6B7280"},grid:{display:"grid",gridTemplateColumns:"repeat(4, minmax(0, 1fr))",gap:"24px",marginBottom:"24px",padding:"0 12px"},awardMeta:{fontSize:"14px",color:"#4B5563"},awardDesc:{fontSize:"14px",color:"#4B5563"},awardContainer:{display:"flex",gap:"8px"},awardInfo:{backgroundColor:"#ECEEF1",padding:"8px 12px",fontWeight:600,fontSize:"12px",borderRadius:"4px",color:"#434C54",maxWidth:"100%",wordBreak:"break-word",width:"fit-content"},listContainerWrapper:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:"30px",marginBottom:"24px"},awardContainerWrapper:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:"16px"}};exports.default=function(a){var o,s,d,p=a.data,u=a.highlightTerms,c=a.onHighlightMatch,g=p.publisher,h=p.contributors,m=p.awards,x=void 0===m?[]:m,v=i.useRef(null),_=function(e){var n=e.trim().split(/\s+/).map(function(e){var n;return null===(n=e[0])||void 0===n?void 0:n.toUpperCase()}).join("");return n.length>3?"".concat(n.slice(0,3)):n};return i.useEffect(function(){var n,i,l,t,r,a,o,s,d,g,h,m;if(u&&0!==u.length){var x=e.__spreadArray(e.__spreadArray(e.__spreadArray(e.__spreadArray([null!==(i=null===(n=p.publisher)||void 0===n?void 0:n.name)&&void 0!==i?i:""],null!==(t=null===(l=p.publisher)||void 0===l?void 0:l.tags)&&void 0!==t?t:[],!0),null!==(o=null===(a=null===(r=p.contributors)||void 0===r?void 0:r.primary)||void 0===a?void 0:a.flatMap(function(n){var i;return e.__spreadArray([n.name,n.role],null!==(i=n.tags)&&void 0!==i?i:[],!0)}))&&void 0!==o?o:[],!0),null!==(g=null===(d=null===(s=p.contributors)||void 0===s?void 0:s.additional)||void 0===d?void 0:d.flatMap(function(n){var i;return e.__spreadArray([n.name,n.role],null!==(i=n.tags)&&void 0!==i?i:[],!0)}))&&void 0!==g?g:[],!0),null!==(m=null===(h=p.awards)||void 0===h?void 0:h.flatMap(function(e){return[e.title,e.org,String(e.year),e.country]}))&&void 0!==m?m:[],!0).some(function(e){return!!e&&u.some(function(n){return e.toLowerCase().includes(n.toLowerCase())})});null==c||c(x)}},[u,p]),n.jsxs("div",e.__assign({ref:v,className:"book-people-container"},{children:[n.jsx("p",e.__assign({style:r.sectionTitle,className:"book-people-section-title"},{children:"Publishers"})),n.jsxs("div",e.__assign({style:r.card,className:"book-people-card"},{children:[n.jsx("span",e.__assign({style:{color:"rgb(67, 76, 85)"}},{children:u&&u.length>0?n.jsx("span",{dangerouslySetInnerHTML:{__html:t.sanitizeHtml(l.highlightTermsFunc(g.name,u))}}):g.name})),(null==g?void 0:g.tags)&&(null==g?void 0:g.tags.length)>0&&n.jsx("div",e.__assign({style:{display:"flex",gap:"8px",marginTop:"18px"}},{children:null===(o=null==g?void 0:g.tags)||void 0===o?void 0:o.map(function(i,a){return n.jsx("span",e.__assign({style:r.tag},{children:u&&u.length>0?n.jsx("span",{dangerouslySetInnerHTML:{__html:t.sanitizeHtml(l.highlightTermsFunc(i,u))}}):i}),a)})}))]})),n.jsx("p",e.__assign({style:r.sectionTitle,className:"book-people-section-title"},{children:"Contributors"})),n.jsx("div",e.__assign({style:r.listContainerWrapper,className:"book-people-list-wrapper"},{children:null===(s=null==h?void 0:h.primary)||void 0===s?void 0:s.map(function(i,a){var o;return n.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}},{children:[n.jsx("div",e.__assign({style:r.avatar,className:"book-people-avatar"},{children:_(null==i?void 0:i.name)})),n.jsx("span",e.__assign({style:r.contributorName,className:"book-people-name"},{children:u&&u.length>0?n.jsx("span",{dangerouslySetInnerHTML:{__html:t.sanitizeHtml(l.highlightTermsFunc(null==i?void 0:i.name,u))}}):null==i?void 0:i.name})),n.jsx("span",e.__assign({style:r.contributorRole,className:"book-people-role"},{children:u&&u.length>0?n.jsx("span",{dangerouslySetInnerHTML:{__html:t.sanitizeHtml(l.highlightTermsFunc(null==i?void 0:i.role,u))}}):null==i?void 0:i.role})),n.jsx("div",e.__assign({style:{display:"flex",gap:"8px",marginTop:"8px"}},{children:null===(o=null==i?void 0:i.tags)||void 0===o?void 0:o.map(function(i,a){return n.jsx("span",e.__assign({style:r.tag},{children:u&&u.length>0?n.jsx("span",{dangerouslySetInnerHTML:{__html:t.sanitizeHtml(l.highlightTermsFunc(i,u))}}):i}),a)})}))]}),a)})})),h.additional&&h.additional.length>0&&n.jsxs(n.Fragment,{children:[n.jsx("p",e.__assign({style:r.sectionTitle,className:"book-people-section-title"},{children:"Additional Contributors"})),n.jsx("div",e.__assign({style:r.listContainerWrapper,className:"book-people-list-wrapper"},{children:null===(d=null==h?void 0:h.additional)||void 0===d?void 0:d.map(function(i,a){return n.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}},{children:[n.jsx("div",e.__assign({style:r.avatar,className:"book-people-avatar"},{children:_(null==i?void 0:i.name)})),n.jsx("span",e.__assign({style:r.contributorName,className:"book-people-name"},{children:u&&u.length>0?n.jsx("span",{dangerouslySetInnerHTML:{__html:t.sanitizeHtml(l.highlightTermsFunc(null==i?void 0:i.name,u))}}):null==i?void 0:i.name})),n.jsx("span",e.__assign({style:r.contributorRole,className:"book-people-role"},{children:u&&u.length>0?n.jsx("span",{dangerouslySetInnerHTML:{__html:t.sanitizeHtml(l.highlightTermsFunc(null==i?void 0:i.role,u))}}):null==i?void 0:i.role}))]}),a)})}))]}),x.length>0&&n.jsxs(n.Fragment,{children:[n.jsx("p",e.__assign({style:r.sectionTitle,className:"book-people-section-title"},{children:"Awards"})),n.jsx("div",e.__assign({style:r.awardContainerWrapper,className:"book-people-award-wrapper"},{children:null==x?void 0:x.map(function(i,a){return n.jsx("div",e.__assign({style:r.awardInfo},{children:n.jsx("span",{children:u&&u.length>0?n.jsx("span",{dangerouslySetInnerHTML:{__html:t.sanitizeHtml(l.highlightTermsFunc(null==i?void 0:i.title,u))}}):null==i?void 0:i.title})}),a)})}))]})]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("react"),l=require("../utils/highlight.js"),t=require("../../../utils/sanitizeHtml.js"),r={sectionTitle:{fontSize:"14px",fontWeight:600,color:"#667085",marginBottom:"12px"},card:{backgroundColor:"#ECEEF1",padding:"8px 12px",fontWeight:500,fontSize:"14px",borderRadius:"4px",color:"#64748B",maxWidth:"100%",wordBreak:"break-word",marginBottom:"24px",width:"fit-content"},tag:{padding:"4px 12px",fontSize:"14px",fontWeight:500,color:"#3B82F6",backgroundColor:"#F3F8FF",borderRadius:"6px"},avatar:{display:"flex",alignItems:"center",justifyContent:"center",height:"35px",width:"35px",borderRadius:"50%",backgroundColor:"#E5E7EB",color:"#4B5563",fontWeight:600,flexShrink:0,fontSize:"12px"},contributorName:{fontWeight:600,color:"#111827",marginTop:"8px",fontSize:"14px"},contributorRole:{fontSize:"12px",color:"#6B7280"},grid:{display:"grid",gridTemplateColumns:"repeat(4, minmax(0, 1fr))",gap:"24px",marginBottom:"24px",padding:"0 12px"},awardMeta:{fontSize:"14px",color:"#4B5563"},awardDesc:{fontSize:"14px",color:"#4B5563"},awardContainer:{display:"flex",gap:"8px"},awardInfo:{backgroundColor:"#ECEEF1",padding:"8px 12px",fontWeight:600,fontSize:"12px",borderRadius:"4px",color:"#434C54",maxWidth:"100%",wordBreak:"break-word",width:"fit-content"},listContainerWrapper:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:"30px",marginBottom:"24px"},awardContainerWrapper:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:"16px"}};exports.default=function(a){var o,s,d,p=a.data,u=a.highlightTerms,c=a.onHighlightMatch,g=a.highlightEnabled,h=p.publisher,m=p.contributors,x=p.awards,v=void 0===x?[]:x,_=i.useRef(null),f=function(e){var n=e.trim().split(/\s+/).map(function(e){var n;return null===(n=e[0])||void 0===n?void 0:n.toUpperCase()}).join("");return n.length>3?"".concat(n.slice(0,3)):n};return i.useEffect(function(){var n,i,l,t,r,a,o,s,d,h,m,x;if(u&&0!==u.length&&g){var v=e.__spreadArray(e.__spreadArray(e.__spreadArray(e.__spreadArray([null!==(i=null===(n=p.publisher)||void 0===n?void 0:n.name)&&void 0!==i?i:""],null!==(t=null===(l=p.publisher)||void 0===l?void 0:l.tags)&&void 0!==t?t:[],!0),null!==(o=null===(a=null===(r=p.contributors)||void 0===r?void 0:r.primary)||void 0===a?void 0:a.flatMap(function(n){var i;return e.__spreadArray([n.name,n.role],null!==(i=n.tags)&&void 0!==i?i:[],!0)}))&&void 0!==o?o:[],!0),null!==(h=null===(d=null===(s=p.contributors)||void 0===s?void 0:s.additional)||void 0===d?void 0:d.flatMap(function(n){var i;return e.__spreadArray([n.name,n.role],null!==(i=n.tags)&&void 0!==i?i:[],!0)}))&&void 0!==h?h:[],!0),null!==(x=null===(m=p.awards)||void 0===m?void 0:m.flatMap(function(e){return[e.title,e.org,String(e.year),e.country]}))&&void 0!==x?x:[],!0).some(function(e){return!!e&&u.some(function(n){return e.toLowerCase().includes(n.toLowerCase())})});null==c||c(v)}},[u,p]),n.jsxs("div",e.__assign({ref:_,className:"book-people-container"},{children:[n.jsx("p",e.__assign({style:r.sectionTitle,className:"book-people-section-title"},{children:"Publishers"})),n.jsxs("div",e.__assign({style:r.card,className:"book-people-card"},{children:[n.jsx("span",e.__assign({style:{color:"rgb(67, 76, 85)"}},{children:u&&u.length>0&&g?n.jsx("span",{dangerouslySetInnerHTML:{__html:t.sanitizeHtml(l.highlightTermsFunc(h.name,u))}}):h.name})),(null==h?void 0:h.tags)&&(null==h?void 0:h.tags.length)>0&&n.jsx("div",e.__assign({style:{display:"flex",gap:"8px",marginTop:"18px"}},{children:null===(o=null==h?void 0:h.tags)||void 0===o?void 0:o.map(function(i,a){return n.jsx("span",e.__assign({style:r.tag},{children:u&&u.length>0&&g?n.jsx("span",{dangerouslySetInnerHTML:{__html:t.sanitizeHtml(l.highlightTermsFunc(i,u))}}):i}),a)})}))]})),n.jsx("p",e.__assign({style:r.sectionTitle,className:"book-people-section-title"},{children:"Contributors"})),n.jsx("div",e.__assign({style:r.listContainerWrapper,className:"book-people-list-wrapper"},{children:null===(s=null==m?void 0:m.primary)||void 0===s?void 0:s.map(function(i,a){var o;return n.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}},{children:[n.jsx("div",e.__assign({style:r.avatar,className:"book-people-avatar"},{children:f(null==i?void 0:i.name)})),n.jsx("span",e.__assign({style:r.contributorName,className:"book-people-name"},{children:u&&u.length>0&&g?n.jsx("span",{dangerouslySetInnerHTML:{__html:t.sanitizeHtml(l.highlightTermsFunc(null==i?void 0:i.name,u))}}):null==i?void 0:i.name})),n.jsx("span",e.__assign({style:r.contributorRole,className:"book-people-role"},{children:u&&u.length>0&&g?n.jsx("span",{dangerouslySetInnerHTML:{__html:t.sanitizeHtml(l.highlightTermsFunc(null==i?void 0:i.role,u))}}):null==i?void 0:i.role})),n.jsx("div",e.__assign({style:{display:"flex",gap:"8px",marginTop:"8px"}},{children:null===(o=null==i?void 0:i.tags)||void 0===o?void 0:o.map(function(i,a){return n.jsx("span",e.__assign({style:r.tag},{children:u&&u.length>0&&g?n.jsx("span",{dangerouslySetInnerHTML:{__html:t.sanitizeHtml(l.highlightTermsFunc(i,u))}}):i}),a)})}))]}),a)})})),m.additional&&m.additional.length>0&&n.jsxs(n.Fragment,{children:[n.jsx("p",e.__assign({style:r.sectionTitle,className:"book-people-section-title"},{children:"Additional Contributors"})),n.jsx("div",e.__assign({style:r.listContainerWrapper,className:"book-people-list-wrapper"},{children:null===(d=null==m?void 0:m.additional)||void 0===d?void 0:d.map(function(i,a){return n.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}},{children:[n.jsx("div",e.__assign({style:r.avatar,className:"book-people-avatar"},{children:f(null==i?void 0:i.name)})),n.jsx("span",e.__assign({style:r.contributorName,className:"book-people-name"},{children:u&&u.length>0&&g?n.jsx("span",{dangerouslySetInnerHTML:{__html:t.sanitizeHtml(l.highlightTermsFunc(null==i?void 0:i.name,u))}}):null==i?void 0:i.name})),n.jsx("span",e.__assign({style:r.contributorRole,className:"book-people-role"},{children:u&&u.length>0&&g?n.jsx("span",{dangerouslySetInnerHTML:{__html:t.sanitizeHtml(l.highlightTermsFunc(null==i?void 0:i.role,u))}}):null==i?void 0:i.role}))]}),a)})}))]}),v.length>0&&n.jsxs(n.Fragment,{children:[n.jsx("p",e.__assign({style:r.sectionTitle,className:"book-people-section-title"},{children:"Awards"})),n.jsx("div",e.__assign({style:r.awardContainerWrapper,className:"book-people-award-wrapper"},{children:null==v?void 0:v.map(function(i,a){return n.jsx("div",e.__assign({style:r.awardInfo},{children:n.jsx("span",{children:u&&u.length>0&&g?n.jsx("span",{dangerouslySetInnerHTML:{__html:t.sanitizeHtml(l.highlightTermsFunc(null==i?void 0:i.title,u))}}):null==i?void 0:i.title})}),a)})}))]})]}))};
2
2
  //# sourceMappingURL=BookPeopleAwardsCard.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),o=require("react/jsx-runtime"),i=require("@mui/material/Dialog"),t=require("@mui/material/DialogContent"),n=require("./BookemonContent.js");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=s(i),r=s(t),a={maxWidth:"none",fontFamily:"Inter, sans-serif"},g={wrapper:{alignItems:"center",justifyContent:"center",textAlign:"center"},inner:{width:"100%"},iconWrapper:{width:"80px",height:"80px",background:"linear-gradient(to right, #3B82F6, #9333EA)",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 24px auto"},icon:{width:"40px",height:"40px",color:"#FFFFFF"},heading:{fontSize:"36px",fontWeight:"bold",color:"#9333EA",marginBottom:"16px"},text:{fontSize:"18px",color:"#4B5563",lineHeight:1.6,textAlign:"center"},errorState:{color:"#CE3928",padding:"18px 0px",display:"flex",justifyContent:"center",width:"100%"}},d=o.jsx("svg",e.__assign({style:g.icon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},{children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})}));exports.comingSoonStyles=g,exports.default=function(i){var t=i.open,s=i.onClose,g=i.isDialog,h=void 0===g||g,u=i.isBookPreview,c=void 0===u||u,m=i.isNonHighlightedBlur,p=i.isBookemon,x=i.getHighlightContent,f=i.handleFetchManuscriptElements,B=i.data,C=i.showComingSoon,v=void 0!==C&&C,y=i.comingSoonData,k=void 0===y?{header:"Bookemon Coming Soon!!",subheader:"We're working on something amazing. Stay tuned for updates!",icon:d}:y,S=i.customStyle,j=void 0===S?{}:S,w=i.isBlurToggleVisible,_=void 0!==w&&w,F=i.highlightTerms,b=i.defaultElementPages,D=null!=t&&t,E=null!=s?s:function(){};return h?o.jsx(l.default,e.__assign({open:D,fullWidth:!0,PaperProps:{style:e.__assign(e.__assign({},a),null==j?void 0:j.dialogDimension)}},{children:o.jsx(r.default,e.__assign({style:{padding:0}},{children:o.jsx(n.BookemonContent,{data:B,customStyle:j,comingSoonData:k,showComingSoon:v,isNonHighlightedBlur:m,isBlurToggleVisible:_,isBookemon:p,highlightTerms:F,getHighlightContent:x,handleFetchManuscriptElements:f,isBookPreview:c,isDialog:h,onClose:E,defaultElementPages:b})}))})):o.jsx("div",e.__assign({style:{width:"100%",height:"100%"}},{children:o.jsx(n.BookemonContent,{data:B,customStyle:j,comingSoonData:k,showComingSoon:v,isNonHighlightedBlur:m,isBlurToggleVisible:_,isBookemon:p,highlightTerms:F,getHighlightContent:x,handleFetchManuscriptElements:f,isBookPreview:c,isDialog:h,onClose:E,defaultElementPages:b})}))},exports.defaultIcon=d;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),t=require("@mui/material/Dialog"),o=require("@mui/material/DialogContent"),n=require("./BookemonContent.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=l(t),r=l(o),a={maxWidth:"none",fontFamily:"Inter, sans-serif"},g={wrapper:{alignItems:"center",justifyContent:"center",textAlign:"center"},inner:{width:"100%"},iconWrapper:{width:"80px",height:"80px",background:"linear-gradient(to right, #3B82F6, #9333EA)",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 24px auto"},icon:{width:"40px",height:"40px",color:"#FFFFFF"},heading:{fontSize:"36px",fontWeight:"bold",color:"#9333EA",marginBottom:"16px"},text:{fontSize:"18px",color:"#4B5563",lineHeight:1.6,textAlign:"center"},errorState:{color:"#CE3928",padding:"18px 0px",display:"flex",justifyContent:"center",width:"100%"}},d=i.jsx("svg",e.__assign({style:g.icon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},{children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})}));exports.comingSoonStyles=g,exports.default=function(t){var o=t.open,l=t.onClose,g=t.isDialog,h=void 0===g||g,u=t.isBookPreview,c=void 0===u||u,m=t.isNonHighlightedBlur,p=t.isBookemon,x=t.getHighlightContent,f=t.handleFetchManuscriptElements,B=t.data,y=t.showComingSoon,C=void 0!==y&&y,v=t.comingSoonData,S=void 0===v?{header:"Bookemon Coming Soon!!",subheader:"We're working on something amazing. Stay tuned for updates!",icon:d}:v,k=t.customStyle,j=void 0===k?{}:k,w=t.isBlurToggleVisible,_=void 0!==w&&w,b=t.highlightTerms,F=t.defaultElementPages,T=t.citationType,D=t.citationSubTitle,E=null!=o&&o,P=null!=l?l:function(){};return h?i.jsx(s.default,e.__assign({open:E,fullWidth:!0,PaperProps:{style:e.__assign(e.__assign({},a),null==j?void 0:j.dialogDimension)}},{children:i.jsx(r.default,e.__assign({style:{padding:0}},{children:i.jsx(n.BookemonContent,{data:B,customStyle:j,comingSoonData:S,showComingSoon:C,isNonHighlightedBlur:m,isBlurToggleVisible:_,isBookemon:p,highlightTerms:b,getHighlightContent:x,handleFetchManuscriptElements:f,isBookPreview:c,isDialog:h,onClose:P,defaultElementPages:F})}))})):i.jsx("div",e.__assign({style:{width:"100%",height:"100%"}},{children:i.jsx(n.BookemonContent,{data:B,customStyle:j,comingSoonData:S,showComingSoon:C,isNonHighlightedBlur:m,isBlurToggleVisible:_,isBookemon:p,highlightTerms:b,getHighlightContent:x,handleFetchManuscriptElements:f,isBookPreview:c,isDialog:h,onClose:P,defaultElementPages:F,citationType:T,citationSubTitle:D})}))},exports.defaultIcon=d;
2
2
  //# sourceMappingURL=Bookemon.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),i=require("react"),n=require("react-resizable-panels"),o=require("@mui/material/Accordion"),r=require("@mui/material/AccordionSummary"),a=require("@mui/material/Typography"),l=require("@mui/material/AccordionDetails"),s=require("@mui/material/IconButton"),d=require("./BookDetailsCard/BookDetailsCard.js"),u=require("./BookOverviewCard/BookOverviewCard.js"),c=require("./BookElementsCard/BookElementsCard.js"),g=require("./BookCopyrightsCard/BookCopyrightsCard.js"),h=require("./BookPeopleAwardsCard/BookPeopleAwardsCard.js"),x=require("./BookPreview/BookPreview.js"),f=require("@mui/icons-material/ExpandMore"),p=require("@mui/icons-material/Close");function v(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var _=v(o),m=v(r),y=v(a),b=v(l),j=v(s),k=v(f),C=v(p),w={dialogPaper:{maxWidth:"none",fontFamily:"Inter, sans-serif"},dialogHeight:{overflow:"hidden",height:"90vh",position:"relative"},dialogContent:{padding:0,backgroundColor:"#FFFFFF"},container:{display:"flex",height:"100%",width:"100%",alignItems:"flex-start"},leftPanel:{height:"100%",padding:"24px",overflowY:"auto",backgroundColor:"#F3F4F6",borderRadius:"12px",boxSizing:"border-box"},rightPanel:{width:"40%",backgroundColor:"#FFFFFF",height:"100%",display:"flex",flexDirection:"column",justifyContent:"flex-start",overflow:"auto",flex:1,boxSizing:"border-box",overflowY:"auto"},accordion:{borderRadius:"12px",boxShadow:"none",marginBottom:"24px"},accordionSummary:{paddingLeft:"16px",paddingRight:"16px"},accordionDetails:{paddingLeft:"16px",paddingRight:"16px",paddingBottom:"16px"},heading:{fontWeight:"bold",color:"#000000",fontSize:"16px"},blurOverlay:{position:"absolute",top:0,left:0,width:"100%",height:"100%",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)",backgroundColor:"rgba(255, 255, 255, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:10,borderRadius:"12px"},closeButton:{position:"absolute",top:"8px",right:"8px",color:"#111827"},resizeHandle:{width:"10px",backgroundColor:"#e5e7eb",cursor:"col-resize",display:"flex",alignItems:"center",justifyContent:"center"},iconContainer:{display:"flex",flexDirection:"column",gap:"4px"},dot:{width:"4px",height:"4px",backgroundColor:"#6b7280",borderRadius:"50%"},resizeHandleBar:{width:"2px",height:"24px",backgroundColor:"#666",borderRadius:"2px"}},S={wrapper:{alignItems:"center",justifyContent:"center",textAlign:"center"},inner:{width:"100%"},iconWrapper:{width:"80px",height:"80px",background:"linear-gradient(to right, #3B82F6, #9333EA)",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 24px auto"},icon:{width:"40px",height:"40px",color:"#FFFFFF"},heading:{fontSize:"36px",fontWeight:"bold",color:"#9333EA",marginBottom:"16px"},text:{fontSize:"18px",color:"#4B5563",lineHeight:1.6,textAlign:"center"},errorState:{color:"#CE3928",padding:"18px 0px",display:"flex",justifyContent:"center",width:"100%"}},B=function(i){var n=i.header,o=i.subheader,r=i.icon;return t.jsx("div",e.__assign({style:S.wrapper},{children:t.jsxs("div",e.__assign({style:S.inner},{children:[t.jsx("div",e.__assign({style:{marginBottom:"32px"}},{children:t.jsx("div",e.__assign({style:S.iconWrapper},{children:r}))})),t.jsxs("div",{children:[t.jsx("h1",e.__assign({style:S.heading},{children:n})),t.jsx("p",e.__assign({style:S.text},{children:o}))]})]}))}))};exports.BookemonContent=function(o){var r=o.showComingSoon,a=o.onClose,l=o.highlightTerms,s=o.data,f=o.customStyle,p=o.comingSoonData,v=o.isNonHighlightedBlur,S=o.isBlurToggleVisible,D=o.isBookemon,F=o.getHighlightContent,P=o.handleFetchManuscriptElements,q=o.isBookPreview,H=o.isDialog,I=o.defaultElementPages,z=i.useState({textToHighLight:"",content:""}),E=z[0],M=z[1],R=i.useState(1),T=R[0],A=R[1],O=i.useState(!1),L=O[0],V=O[1],W=i.useState("Book Preview"),N=W[0],Q=W[1],Y=i.useState(70),G=Y[0],J=Y[1],K=i.useRef(null),U=i.useState(!1),X=U[0],Z=U[1],$=i.useRef(null),ee=i.useRef(null),te=i.useRef(null),ie=i.useRef(null),ne=i.useRef(null),oe=function(t,i,n,o){return void 0===o&&(o=0),e.__awaiter(void 0,void 0,void 0,function(){var r,a,l,s,d,u,c,g,h,x,f,p,v,_,m,y;return e.__generator(this,function(e){switch(e.label){case 0:M({textToHighLight:"",content:""}),Z(!1),V(!0),Q(i),e.label=1;case 1:return e.trys.push([1,5,6,7]),n&&0!==n.length?[4,null==F?void 0:F([n[o]])]:(V(!1),J(70),null===(m=K.current)||void 0===m||m.resize(70),[2]);case 2:if(r=e.sent(),a=(null==r?void 0:r.data)||r||[],!Array.isArray(a)||0===a.length)return Z(!0),V(!1),[2];for(s=(l=function(e){return e?e.replace(/<[^>]*>/g," ").replace(/&nbsp;/g," ").replace(/[\u200B-\u200D\uFEFF]/g,"").replace(/[\u2018\u2019]/g,"'").replace(/[\u201C\u201D]/g,'"').replace(/[\u2013\u2014]/g,"-").replace(/[.,!?;:'"(){}\[\]—–…\/\\@#&*_|\^~%=+<>`]/g,"").replace(/\s+/g," ").trim().toLowerCase():""})(t),d=null,u=0,c=a;u<c.length;u++)if(p=c[u],l(p.normalizedContent||p.htmlContent).includes(s)){d=p;break}if(!d)for(g=s.split(" ").filter(Boolean);g.length>0;){for(h=g.join(" "),x=0,f=a;x<f.length;x++)if(p=f[x],l(p.normalizedContent||p.htmlContent).includes(h)){d=p;break}if(d)break;g.pop()}return v=a.map(function(e){return e.htmlContent}).join("\n"),M({textToHighLight:d?d.htmlContent:"",content:v}),J(50),null===(y=K.current)||void 0===y||y.resize(50),!d&&o+1<n.length?[4,oe(t,i,n,o+1)]:[3,4];case 3:return[2,e.sent()];case 4:return[2];case 5:return _=e.sent(),console.error("Highlight error:",_),Z(!0),[3,7];case 6:return V(!1),[7];case 7:return[2]}})})},re=i.useState(!1),ae=re[0],le=re[1],se=i.useState(!1),de=se[0],ue=se[1],ce=i.useState(!1),ge=ce[0],he=ce[1],xe=i.useState(!1),fe=xe[0],pe=xe[1],ve=i.useState(!1),_e=ve[0],me=ve[1],ye=i.useState(!1),be=ye[0],je=ye[1],ke=i.useState(!1),Ce=ke[0],we=ke[1],Se=i.useState(!1),Be=Se[0],De=Se[1],Fe=i.useState(!1),Pe=Fe[0],qe=Fe[1],He=i.useState(!1),Ie=He[0],ze=He[1];i.useEffect(function(){ae&&je(!0),de&&we(!0),ge&&De(!0),fe&&qe(!0),_e&&ze(!0)},[ae,de,ge,fe,_e]);var Ee=s.bookAwards,Me=s.bookCopyRight,Re=s.bookDetails,Te=s.bookElements,Ae=s.bookOverView,Oe=s.bookCoverImage,Le=null==Re?void 0:Re.isbn,Ve=null!=a?a:function(){};return t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},w.dialogContent),H?w.dialogHeight:{})},{children:[!r&&t.jsx("div",e.__assign({style:w.container},{children:t.jsxs(n.PanelGroup,e.__assign({direction:"horizontal"},{children:[t.jsx(n.Panel,e.__assign({order:1,ref:K,defaultSize:G||70},{children:t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},null==w?void 0:w.leftPanel),null==f?void 0:f.leftPanel)},{children:[t.jsx("div",e.__assign({ref:$,style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:t.jsxs(_.default,e.__assign({expanded:be,onChange:function(e,t){return je(t)},slotProps:{transition:{onEntered:function(){var e=$.current,t=null==e?void 0:e.querySelector('[data-highlight="true"]');t&&e&&!e.dataset.scrolled&&(t.scrollIntoView({behavior:"smooth",block:"center"}),e.dataset.scrolled="true")}}},elevation:0,style:w.accordion},{children:[t.jsx(m.default,e.__assign({expandIcon:t.jsx(k.default,{}),style:w.accordionSummary},{children:t.jsx(y.default,e.__assign({style:w.heading},{children:"Book Overview"}))})),t.jsx(b.default,e.__assign({style:w.accordionDetails},{children:Ae&&Object.keys(Ae).length>0?t.jsx(u.default,{data:Ae,highlightTerms:l,onHighlightMatch:le}):t.jsx("div",e.__assign({style:w.errorState},{children:"No overview data available."}))}))]}))})),t.jsx("div",e.__assign({ref:ee,style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:t.jsxs(_.default,e.__assign({elevation:0,style:w.accordion,expanded:Ce,onChange:function(e,t){return we(t)},slotProps:{transition:{onEntered:function(){var e=ee.current;if(e){var t=e.querySelector('[data-highlight="true"]');if(t){t.scrollIntoView({behavior:"smooth",block:"center"});var i=new MutationObserver(function(){var t=e.querySelector('[data-highlight="true"]');t&&t.scrollIntoView({behavior:"auto",block:"center"}),i.disconnect()});i.observe(e,{childList:!0,subtree:!0})}}}}}},{children:[t.jsx(m.default,e.__assign({expandIcon:t.jsx(k.default,{}),style:w.accordionSummary},{children:t.jsx(y.default,e.__assign({style:w.heading},{children:"Book Manuscript Elements"}))})),t.jsx(b.default,e.__assign({style:w.accordionDetails},{children:t.jsx(c.default,{data:Te,title:(null==Ae?void 0:Ae.title)||"",handleFetchManuscriptElements:P,BookIsbn:Le,updateQuotesToHighLight:oe,highlightTerms:l,onHighlightMatch:ue,defaultPages:I})}))]}))})),t.jsx("div",e.__assign({ref:te,style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:t.jsxs(_.default,e.__assign({expanded:Be,onChange:function(e,t){return De(t)},elevation:0,style:w.accordion,slotProps:{transition:{onEntered:function(){var e=te.current,t=null==e?void 0:e.querySelector('[data-highlight="true"]');t&&e&&!e.dataset.scrolled&&(t.scrollIntoView({behavior:"smooth",block:"center"}),e.dataset.scrolled="true")}}}},{children:[t.jsx(m.default,e.__assign({expandIcon:t.jsx(k.default,{}),style:w.accordionSummary},{children:t.jsx(y.default,e.__assign({style:w.heading},{children:"Book Metadata Details"}))})),t.jsx(b.default,e.__assign({style:w.accordionDetails},{children:Re&&Object.keys(Re).length>0?t.jsx(d.default,{data:Re,highlightTerms:l,onHighlightMatch:he}):t.jsx("div",e.__assign({style:w.errorState},{children:"No Book Metadata data available."}))}))]}))})),t.jsx("div",e.__assign({ref:ie,style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:t.jsxs(_.default,e.__assign({elevation:0,style:w.accordion,expanded:Pe,onChange:function(e,t){return qe(t)},slotProps:{transition:{onEntered:function(){var e=ie.current,t=null==e?void 0:e.querySelector('[data-highlight="true"]');t&&e&&!e.dataset.scrolled&&(t.scrollIntoView({behavior:"smooth",block:"center"}),e.dataset.scrolled="true")}}}},{children:[t.jsx(m.default,e.__assign({expandIcon:t.jsx(k.default,{}),style:w.accordionSummary},{children:t.jsx(y.default,e.__assign({style:w.heading},{children:"Copyrights & Marketing"}))})),t.jsx(b.default,e.__assign({style:w.accordionDetails},{children:Me&&Object.keys(Me).length>0?t.jsx(g.default,{data:Me,highlightTerms:l,onHighlightMatch:pe}):t.jsx("div",e.__assign({style:w.errorState},{children:"No Copyrights & Marketing data available."}))}))]}))})),t.jsx("div",e.__assign({ref:ne},{children:t.jsxs(_.default,e.__assign({elevation:0,style:w.accordion,expanded:Ie,onChange:function(e,t){return ze(t)},slotProps:{transition:{onEntered:function(){var e=ne.current,t=null==e?void 0:e.querySelector('[data-highlight="true"]');t&&e&&!e.dataset.scrolled&&(t.scrollIntoView({behavior:"smooth",block:"center"}),e.dataset.scrolled="true")}}}},{children:[t.jsx(m.default,e.__assign({expandIcon:t.jsx(k.default,{}),style:w.accordionSummary},{children:t.jsx(y.default,e.__assign({style:w.heading},{children:"People & Awards"}))})),t.jsx(b.default,e.__assign({style:w.accordionDetails},{children:Ee&&Object.keys(Ee).length>0?t.jsx(h.default,{data:Ee,highlightTerms:l,onHighlightMatch:me}):t.jsx("div",e.__assign({style:w.errorState},{children:"No People & Awards data available."}))}))]}))}))]}))})),q&&t.jsx(n.PanelResizeHandle,{style:{width:"3px",background:"#D1D5DC",cursor:"col-resize"}}),q&&t.jsx(n.Panel,e.__assign({order:2,minSize:30,maxSize:50,style:{overflow:"visible",position:"relative",transition:"all 300ms ease-in-out",WebkitTransition:"all 300ms ease-in-out"}},{children:t.jsx(x.default,{bookOverView:Ae,bookCoverImage:Oe,onClose:Ve,clickableElementCategory:N,quotesToHighLightData:E,updateQuotesToHighLight:oe,citationLoad:L,previewPage:T,setPreviewPage:A,customStyle:f,comingSoonData:p,isNonHighlightedBlur:v,isBlurToggleVisible:S,isBookemon:D,noHtmlContent:X})}))]}))})),r&&t.jsxs("div",e.__assign({style:w.blurOverlay},{children:[t.jsx(j.default,e.__assign({style:w.closeButton,onClick:a,size:"large"},{children:t.jsx(C.default,{})})),t.jsx(B,{header:null==p?void 0:p.header,subheader:null==p?void 0:p.subheader,icon:null==p?void 0:p.icon})]}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),i=require("react"),n=require("react-resizable-panels"),o=require("@mui/material/Accordion"),r=require("@mui/material/AccordionSummary"),a=require("@mui/material/Typography"),l=require("@mui/material/AccordionDetails"),s=require("@mui/material/IconButton"),d=require("./BookDetailsCard/BookDetailsCard.js"),u=require("./BookOverviewCard/BookOverviewCard.js"),c=require("./BookElementsCard/BookElementsCard.js"),h=require("./BookCopyrightsCard/BookCopyrightsCard.js"),g=require("./BookPeopleAwardsCard/BookPeopleAwardsCard.js"),x=require("./BookPreview/BookPreview.js"),p=require("@mui/icons-material/ExpandMore"),f=require("@mui/icons-material/Close");function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var v=_(o),b=_(r),m=_(a),y=_(l),j=_(s),k=_(p),C=_(f),w={dialogPaper:{maxWidth:"none",fontFamily:"Inter, sans-serif"},dialogHeight:{overflow:"hidden",height:"90vh",position:"relative"},dialogContent:{padding:0,backgroundColor:"#FFFFFF"},container:{display:"flex",height:"100%",width:"100%",alignItems:"flex-start"},leftPanel:{height:"100%",padding:"24px",overflowY:"auto",backgroundColor:"#F3F4F6",borderRadius:"12px",boxSizing:"border-box"},rightPanel:{width:"40%",backgroundColor:"#FFFFFF",height:"100%",display:"flex",flexDirection:"column",justifyContent:"flex-start",overflow:"auto",flex:1,boxSizing:"border-box",overflowY:"auto"},accordion:{borderRadius:"12px",boxShadow:"none",marginBottom:"24px"},accordionSummary:{paddingLeft:"16px",paddingRight:"16px"},accordionDetails:{paddingLeft:"16px",paddingRight:"16px",paddingBottom:"16px"},heading:{fontWeight:"bold",color:"#000000",fontSize:"16px"},blurOverlay:{position:"absolute",top:0,left:0,width:"100%",height:"100%",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)",backgroundColor:"rgba(255, 255, 255, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:10,borderRadius:"12px"},closeButton:{position:"absolute",top:"8px",right:"8px",color:"#111827"},resizeHandle:{width:"10px",backgroundColor:"#e5e7eb",cursor:"col-resize",display:"flex",alignItems:"center",justifyContent:"center"},iconContainer:{display:"flex",flexDirection:"column",gap:"4px"},dot:{width:"4px",height:"4px",backgroundColor:"#6b7280",borderRadius:"50%"},resizeHandleBar:{width:"2px",height:"24px",backgroundColor:"#666",borderRadius:"2px"}},S={wrapper:{alignItems:"center",justifyContent:"center",textAlign:"center"},inner:{width:"100%"},iconWrapper:{width:"80px",height:"80px",background:"linear-gradient(to right, #3B82F6, #9333EA)",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 24px auto"},icon:{width:"40px",height:"40px",color:"#FFFFFF"},heading:{fontSize:"36px",fontWeight:"bold",color:"#9333EA",marginBottom:"16px"},text:{fontSize:"18px",color:"#4B5563",lineHeight:1.6,textAlign:"center"},errorState:{color:"#CE3928",padding:"18px 0px",display:"flex",justifyContent:"center",width:"100%"}},B=function(i){var n=i.header,o=i.subheader,r=i.icon;return t.jsx("div",e.__assign({style:S.wrapper},{children:t.jsxs("div",e.__assign({style:S.inner},{children:[t.jsx("div",e.__assign({style:{marginBottom:"32px"}},{children:t.jsx("div",e.__assign({style:S.iconWrapper},{children:r}))})),t.jsxs("div",{children:[t.jsx("h1",e.__assign({style:S.heading},{children:n})),t.jsx("p",e.__assign({style:S.text},{children:o}))]})]}))}))};exports.BookemonContent=function(o){var r=o.showComingSoon,a=o.onClose,l=o.highlightTerms,s=o.data,p=o.customStyle,f=o.comingSoonData,_=o.isNonHighlightedBlur,S=o.isBlurToggleVisible,D=o.isBookemon,F=o.getHighlightContent,P=o.handleFetchManuscriptElements,q=o.isBookPreview,E=o.isDialog,H=o.defaultElementPages,I=o.citationType,T=o.citationSubTitle,z=i.useState({textToHighLight:"",content:""}),M=z[0],R=z[1],A=i.useState(1),O=A[0],L=A[1],V=i.useState(!1),W=V[0],N=V[1],Q=i.useState("Book Preview"),Y=Q[0],G=Q[1],J=i.useState(70),K=J[0],U=J[1],X=i.useRef(null),Z=i.useState(!1),$=Z[0],ee=Z[1],te=i.useRef(null),ie=i.useRef(null),ne=i.useRef(null),oe=i.useRef(null),re=i.useRef(null),ae=function(t,i,n,o){return void 0===o&&(o=0),e.__awaiter(void 0,void 0,void 0,function(){var r,a,l,s,d,u,c,h,g,x,p,f,_,v,b,m;return e.__generator(this,function(e){switch(e.label){case 0:R({textToHighLight:"",content:""}),ee(!1),N(!0),G(i),e.label=1;case 1:return e.trys.push([1,5,6,7]),n&&0!==n.length?[4,null==F?void 0:F([n[o]])]:(N(!1),U(70),null===(b=X.current)||void 0===b||b.resize(70),[2]);case 2:if(r=e.sent(),a=(null==r?void 0:r.data)||r||[],!Array.isArray(a)||0===a.length)return ee(!0),N(!1),[2];for(s=(l=function(e){return e?e.replace(/<[^>]*>/g," ").replace(/&nbsp;/g," ").replace(/[\u200B-\u200D\uFEFF]/g,"").replace(/[\u2018\u2019]/g,"'").replace(/[\u201C\u201D]/g,'"').replace(/[\u2013\u2014]/g,"-").replace(/[.,!?;:'"(){}\[\]—–…\/\\@#&*_|\^~%=+<>`]/g,"").replace(/\s+/g," ").trim().toLowerCase():""})(t),d=null,u=0,c=a;u<c.length;u++)if(f=c[u],l(f.normalizedContent||f.htmlContent).includes(s)){d=f;break}if(!d)for(h=s.split(" ").filter(Boolean);h.length>0;){for(g=h.join(" "),x=0,p=a;x<p.length;x++)if(f=p[x],l(f.normalizedContent||f.htmlContent).includes(g)){d=f;break}if(d)break;h.pop()}return _=a.map(function(e){return e.htmlContent}).join("\n"),R({textToHighLight:d?d.htmlContent:"",content:_}),U(50),null===(m=X.current)||void 0===m||m.resize(50),!d&&o+1<n.length?[4,ae(t,i,n,o+1)]:[3,4];case 3:return[2,e.sent()];case 4:return[2];case 5:return v=e.sent(),console.error("Highlight error:",v),ee(!0),[3,7];case 6:return N(!1),[7];case 7:return[2]}})})},le=i.useState(!1),se=le[0],de=le[1],ue=i.useState(!1),ce=ue[0],he=ue[1],ge=i.useState(!1),xe=ge[0],pe=ge[1],fe=i.useState(!1),_e=fe[0],ve=fe[1],be=i.useState(!1),me=be[0],ye=be[1],je=i.useState(!1),ke=je[0],Ce=je[1],we=i.useState(!1),Se=we[0],Be=we[1],De=i.useState(!1),Fe=De[0],Pe=De[1],qe=i.useState(!1),Ee=qe[0],He=qe[1],Ie=i.useState(!1),Te=Ie[0],ze=Ie[1];i.useEffect(function(){se&&Ce(!0),ce&&Be(!0),xe&&Pe(!0),_e&&He(!0),me&&ze(!0)},[se,ce,xe,_e,me]);var Me=s.bookAwards,Re=s.bookCopyRight,Ae=s.bookDetails,Oe=s.bookElements,Le=s.bookOverView,Ve=s.bookCoverImage,We=null==Ae?void 0:Ae.isbn,Ne=null!=a?a:function(){},Qe=void 0!==T&&!!T.length&&["notable_quotes","location_details","notable_characters"].includes(T);return t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},w.dialogContent),E?w.dialogHeight:{})},{children:[!r&&t.jsx("div",e.__assign({style:w.container},{children:t.jsxs(n.PanelGroup,e.__assign({direction:"horizontal"},{children:[t.jsx(n.Panel,e.__assign({order:1,ref:X,defaultSize:K||70},{children:t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},null==w?void 0:w.leftPanel),null==p?void 0:p.leftPanel)},{children:[t.jsx("div",e.__assign({ref:te,style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:t.jsxs(v.default,e.__assign({expanded:ke,onChange:function(e,t){return Ce(t)},slotProps:{transition:{onEntered:function(){var e=te.current,t=null==e?void 0:e.querySelector('[data-highlight="true"]');t&&e&&!e.dataset.scrolled&&(t.scrollIntoView({behavior:"smooth",block:"center"}),e.dataset.scrolled="true")}}},elevation:0,style:w.accordion},{children:[t.jsx(b.default,e.__assign({expandIcon:t.jsx(k.default,{}),style:w.accordionSummary},{children:t.jsx(m.default,e.__assign({style:w.heading},{children:"Book Overview"}))})),t.jsx(y.default,e.__assign({style:w.accordionDetails},{children:Le&&Object.keys(Le).length>0?t.jsx(u.default,{data:Le,highlightTerms:l,onHighlightMatch:de,highlightEnabled:!Qe}):t.jsx("div",e.__assign({style:w.errorState},{children:"No overview data available."}))}))]}))})),t.jsx("div",e.__assign({ref:ie,style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:t.jsxs(v.default,e.__assign({elevation:0,style:w.accordion,expanded:Se,onChange:function(e,t){return Be(t)},slotProps:{transition:{onEntered:function(){var e=ie.current;if(e){var t=e.querySelector('[data-highlight="true"]');if(t){t.scrollIntoView({behavior:"smooth",block:"center"});var i=new MutationObserver(function(){var t=e.querySelector('[data-highlight="true"]');t&&t.scrollIntoView({behavior:"auto",block:"center"}),i.disconnect()});i.observe(e,{childList:!0,subtree:!0})}}}}}},{children:[t.jsx(b.default,e.__assign({expandIcon:t.jsx(k.default,{}),style:w.accordionSummary},{children:t.jsx(m.default,e.__assign({style:w.heading},{children:"Book Manuscript Elements"}))})),t.jsx(y.default,e.__assign({style:w.accordionDetails},{children:t.jsx(c.default,{data:Oe,title:(null==Le?void 0:Le.title)||"",handleFetchManuscriptElements:P,BookIsbn:We,updateQuotesToHighLight:ae,highlightTerms:l,onHighlightMatch:he,defaultPages:H,citationType:I,citationSubTitle:T,highlightEnabled:Qe})}))]}))})),t.jsx("div",e.__assign({ref:ne,style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:t.jsxs(v.default,e.__assign({expanded:Fe,onChange:function(e,t){return Pe(t)},elevation:0,style:w.accordion,slotProps:{transition:{onEntered:function(){var e=ne.current,t=null==e?void 0:e.querySelector('[data-highlight="true"]');t&&e&&!e.dataset.scrolled&&(t.scrollIntoView({behavior:"smooth",block:"center"}),e.dataset.scrolled="true")}}}},{children:[t.jsx(b.default,e.__assign({expandIcon:t.jsx(k.default,{}),style:w.accordionSummary},{children:t.jsx(m.default,e.__assign({style:w.heading},{children:"Book Metadata Details"}))})),t.jsx(y.default,e.__assign({style:w.accordionDetails},{children:Ae&&Object.keys(Ae).length>0?t.jsx(d.default,{data:Ae,highlightTerms:l,onHighlightMatch:pe,highlightEnabled:!Qe,citationType:I,citationSubTitle:T}):t.jsx("div",e.__assign({style:w.errorState},{children:"No Book Metadata data available."}))}))]}))})),t.jsx("div",e.__assign({ref:oe,style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:t.jsxs(v.default,e.__assign({elevation:0,style:w.accordion,expanded:Ee,onChange:function(e,t){return He(t)},slotProps:{transition:{onEntered:function(){var e=oe.current,t=null==e?void 0:e.querySelector('[data-highlight="true"]');t&&e&&!e.dataset.scrolled&&(t.scrollIntoView({behavior:"smooth",block:"center"}),e.dataset.scrolled="true")}}}},{children:[t.jsx(b.default,e.__assign({expandIcon:t.jsx(k.default,{}),style:w.accordionSummary},{children:t.jsx(m.default,e.__assign({style:w.heading},{children:"Copyrights & Marketing"}))})),t.jsx(y.default,e.__assign({style:w.accordionDetails},{children:Re&&Object.keys(Re).length>0?t.jsx(h.default,{data:Re,highlightTerms:l,onHighlightMatch:ve,highlightEnabled:!Qe}):t.jsx("div",e.__assign({style:w.errorState},{children:"No Copyrights & Marketing data available."}))}))]}))})),t.jsx("div",e.__assign({ref:re},{children:t.jsxs(v.default,e.__assign({elevation:0,style:w.accordion,expanded:Te,onChange:function(e,t){return ze(t)},slotProps:{transition:{onEntered:function(){var e=re.current,t=null==e?void 0:e.querySelector('[data-highlight="true"]');t&&e&&!e.dataset.scrolled&&(t.scrollIntoView({behavior:"smooth",block:"center"}),e.dataset.scrolled="true")}}}},{children:[t.jsx(b.default,e.__assign({expandIcon:t.jsx(k.default,{}),style:w.accordionSummary},{children:t.jsx(m.default,e.__assign({style:w.heading},{children:"People & Awards"}))})),t.jsx(y.default,e.__assign({style:w.accordionDetails},{children:Me&&Object.keys(Me).length>0?t.jsx(g.default,{data:Me,highlightTerms:l,onHighlightMatch:ye,highlightEnabled:!Qe}):t.jsx("div",e.__assign({style:w.errorState},{children:"No People & Awards data available."}))}))]}))}))]}))})),q&&t.jsx(n.PanelResizeHandle,{style:{width:"3px",background:"#D1D5DC",cursor:"col-resize"}}),q&&t.jsx(n.Panel,e.__assign({order:2,minSize:30,maxSize:50,style:{overflow:"visible",position:"relative",transition:"all 300ms ease-in-out",WebkitTransition:"all 300ms ease-in-out"}},{children:t.jsx(x.default,{bookOverView:Le,bookCoverImage:Ve,onClose:Ne,clickableElementCategory:Y,quotesToHighLightData:M,updateQuotesToHighLight:ae,citationLoad:W,previewPage:O,setPreviewPage:L,customStyle:p,comingSoonData:f,isNonHighlightedBlur:_,isBlurToggleVisible:S,isBookemon:D,noHtmlContent:$})}))]}))})),r&&t.jsxs("div",e.__assign({style:w.blurOverlay},{children:[t.jsx(j.default,e.__assign({style:w.closeButton,onClick:a,size:"large"},{children:t.jsx(C.default,{})})),t.jsx(B,{header:null==f?void 0:f.header,subheader:null==f?void 0:f.subheader,icon:null==f?void 0:f.icon})]}))]}))};
2
2
  //# sourceMappingURL=BookemonContent.js.map
@@ -1,2 +1,2 @@
1
- import{__spreadArray as i,__assign as t}from"tslib";import{jsxs as l,jsx as n}from"react/jsx-runtime";import{useRef as o,useEffect as e}from"react";import{highlightTermsFunc as r}from"../utils/highlight.js";import{sanitizeHtml as s}from"../../../utils/sanitizeHtml.js";var d={sectionTitle:{fontSize:"14px",fontWeight:600,color:"#667085",marginBottom:"12px"},textBlock:{fontSize:"14px",fontWeight:400,color:"#64748B",marginBottom:"24px"}},h=function(h){var u,a,c,g,p,v,m,y,f=h.data,S=h.highlightTerms,x=h.onHighlightMatch,T=f.copyright,_=f.salesRights,w=o(null);return e(function(){var t,l,n,o,e,r,s,d;if(S&&0!==S.length){var h=i([String(null!==(l=null===(t=f.copyright)||void 0===t?void 0:t.year)&&void 0!==l?l:""),null!==(o=null===(n=f.copyright)||void 0===n?void 0:n.owner)&&void 0!==o?o:"",null!==(r=null===(e=f.salesRights)||void 0===e?void 0:e.description)&&void 0!==r?r:""],null!==(d=null===(s=f.salesRights)||void 0===s?void 0:s.territory)&&void 0!==d?d:[],!0).some(function(i){return!!i&&S.some(function(t){return i.toLowerCase().includes(t.toLowerCase())})});null==x||x(h)}},[S,f]),l("div",t({ref:w},{children:[n("p",t({style:d.sectionTitle},{children:"Copyrights"})),l("div",t({style:d.textBlock},{children:[l("p",{children:["Copyright Year:"," ",S&&S.length>0?n("span",{dangerouslySetInnerHTML:{__html:s(r(String(null!==(u=T.year)&&void 0!==u?u:"NA"),S))}}):null!==(a=T.year)&&void 0!==a?a:"NA"]}),l("p",{children:["Copyright Owner:"," ",S&&S.length>0?n("span",{dangerouslySetInnerHTML:{__html:s(r(null!==(c=T.owner)&&void 0!==c?c:"NA",S))}}):null!==(g=T.owner)&&void 0!==g?g:"NA"]})]})),n("p",t({style:d.sectionTitle},{children:"Sales Rights"})),l("div",t({style:d.textBlock},{children:[n("p",{children:S&&S.length>0?n("span",{dangerouslySetInnerHTML:{__html:s(r(null!==(p=_.description)&&void 0!==p?p:"",S))}}):null!==(v=_.description)&&void 0!==v?v:""}),l("p",{children:["Sales Territory:"," ",S&&S.length>0?n("span",{dangerouslySetInnerHTML:{__html:s(r(null!==(m=_.territory.join(", "))&&void 0!==m?m:"NA",S))}}):null!==(y=_.territory.join(", "))&&void 0!==y?y:"NA"]})]}))]}))};export{h as default};
1
+ import{__assign as i}from"tslib";import{jsxs as t,jsx as l}from"react/jsx-runtime";import{useRef as n,useEffect as e}from"react";import{highlightTermsFunc as o}from"../utils/highlight.js";import{sanitizeHtml as r}from"../../../utils/sanitizeHtml.js";var s={sectionTitle:{fontSize:"14px",fontWeight:600,color:"#667085",marginBottom:"12px"},textBlock:{fontSize:"14px",fontWeight:400,color:"#64748B",marginBottom:"24px"}},d=function(d){var h,a,g,u,c,p,v,m,y=d.data,f=d.highlightTerms,S=d.onHighlightMatch,x=d.highlightEnabled,T=y.copyright,_=y.salesRights,j=n(null);return e(function(){var i,t,l,n,e,o,r;if(f&&0!==f.length&&x){var s=[String(null!==(t=null===(i=y.copyright)||void 0===i?void 0:i.year)&&void 0!==t?t:""),null!==(n=null===(l=y.copyright)||void 0===l?void 0:l.owner)&&void 0!==n?n:"",null!==(o=null===(e=y.salesRights)||void 0===e?void 0:e.description)&&void 0!==o?o:"",null===(r=y.salesRights)||void 0===r?void 0:r.territory.join(", ")].some(function(i){return!!i&&f.some(function(t){return i.toLowerCase().includes(t.toLowerCase())})});null==S||S(s)}},[f,y]),t("div",i({ref:j},{children:[l("p",i({style:s.sectionTitle},{children:"Copyrights"})),t("div",i({style:s.textBlock},{children:[t("p",{children:["Copyright Year:"," ",f&&f.length>0&&x?l("span",{dangerouslySetInnerHTML:{__html:r(o(String(null!==(h=T.year)&&void 0!==h?h:"NA"),f))}}):null!==(a=T.year)&&void 0!==a?a:"NA"]}),t("p",{children:["Copyright Owner:"," ",f&&f.length>0&&x?l("span",{dangerouslySetInnerHTML:{__html:r(o(null!==(g=T.owner)&&void 0!==g?g:"NA",f))}}):null!==(u=T.owner)&&void 0!==u?u:"NA"]})]})),l("p",i({style:s.sectionTitle},{children:"Sales Rights"})),t("div",i({style:s.textBlock},{children:[l("p",{children:f&&f.length>0&&x?l("span",{dangerouslySetInnerHTML:{__html:r(o(null!==(c=_.description)&&void 0!==c?c:"",f))}}):null!==(p=_.description)&&void 0!==p?p:""}),t("p",{children:["Sales Territory:"," ",f&&f.length>0&&x?l("span",{dangerouslySetInnerHTML:{__html:r(o(null!==(v=_.territory.join(", "))&&void 0!==v?v:"NA",f))}}):null!==(m=_.territory.join(", "))&&void 0!==m?m:"NA"]})]}))]}))};export{d as default};
2
2
  //# sourceMappingURL=BookCopyrightsCard.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"tslib";import{jsxs as t,jsx as n}from"react/jsx-runtime";import{useState as i,useRef as r,useMemo as o,useEffect as l}from"react";import{highlightTermsFunc as s}from"../utils/highlight.js";import{sanitizeHtml as a}from"../../../utils/sanitizeHtml.js";var d={container:{width:"100%"},sectionTitle:{fontSize:"14px",fontWeight:600,color:"#667085",marginBottom:"12px"},detailsContainer:{marginBottom:"24px",fontSize:"14px",fontWeight:400,color:"#64748B",display:"flex",flexDirection:"column",gap:"4px",paddingLeft:"12px"},detailsContainerItem:{margin:"4px 0"},boldText:{fontWeight:"bold"},categoriesContainer:{marginBottom:"24px"},categoriesList:{display:"flex",flexWrap:"wrap",gap:"12px",marginBottom:"8px",paddingLeft:"12px"},category:{backgroundColor:"#ECEEF1",padding:"8px 12px",fontWeight:400,fontSize:"12px",borderRadius:"4px",color:"#64748B",maxWidth:"100%",wordBreak:"break-word"},button:{color:"#5928ED",fontSize:"14px",fontWeight:600,background:"none",border:"none",cursor:"pointer",padding:0,textDecoration:"none",paddingLeft:"12px"},reviewsList:{paddingLeft:"12px"},reviewCard:{border:"1px solid #CBD5E1",borderRadius:"6px",padding:"16px",marginBottom:"12px",backgroundColor:"#F8FAFC"},reviewText:{fontSize:"14px",fontStyle:"italic",fontWeight:400,color:"#475569",marginBottom:"8px"},reviewSource:{fontSize:"10px",color:"#475569",fontWeight:600}},c=function(c){var u,g,p,h,m,b,f,v,x,y,C,w,T,N=c.data,k=c.highlightTerms,S=c.onHighlightMatch,I=i(!1),L=I[0],_=I[1],A=i(!1),M=A[0],B=A[1],D=r(null),j=o(function(){return L?N.subjectCategories||[]:(N.subjectCategories||[]).slice(0,10)},[L,N.subjectCategories]);return l(function(){var e,t;if(null==k?void 0:k.length){var n=k.map(function(e){return e.toLowerCase()}),i=function(e){return e&&n.some(function(t){return e.toLowerCase().includes(t)})},r=[N.isbn,N.isbn10,N.imprint,N.publisher,N.publishingDate,N.age].some(i),o=(null!==(e=N.subjectCategories)&&void 0!==e?e:[]).some(i),l=(null!==(t=N.reviews)&&void 0!==t?t:[]).some(function(e){return i(e.replace(/<[^>]+>/g,""))}),s=r||o||l;null==S||S(s),s&&(o&&!L&&_(!0),l&&!M&&B(!0))}},[k,N]),t("div",e({ref:D,style:d.container,className:"book-details-container"},{children:[n("p",e({style:d.sectionTitle,className:"book-details-section-title"},{children:"Product Details"})),t("div",e({style:d.detailsContainer,className:"book-details-details-container"},{children:[t("p",e({style:d.detailsContainerItem},{children:[n("span",e({style:d.boldText},{children:"ISBN:"}))," ",k&&k.length>0?n("span",{dangerouslySetInnerHTML:{__html:a(s(null!==(u=N.isbn)&&void 0!==u?u:"NA",k))}}):null!==(g=N.isbn)&&void 0!==g?g:"NA"]})),t("p",e({style:d.detailsContainerItem},{children:[n("span",e({style:d.boldText},{children:"ISBN 10:"}))," ",k&&k.length>0?n("span",{dangerouslySetInnerHTML:{__html:a(s(null!==(p=N.isbn10)&&void 0!==p?p:"NA",k))}}):null!==(h=N.isbn10)&&void 0!==h?h:"NA"]})),t("p",e({style:d.detailsContainerItem},{children:[n("span",e({style:d.boldText},{children:"Imprint:"}))," ",k&&k.length>0?n("span",{dangerouslySetInnerHTML:{__html:a(s(null!==(m=N.imprint)&&void 0!==m?m:"NA",k))}}):null!==(b=N.imprint)&&void 0!==b?b:"NA"]})),t("p",e({style:d.detailsContainerItem},{children:[n("span",e({style:d.boldText},{children:"Publisher:"}))," ",k&&k.length>0?n("span",{dangerouslySetInnerHTML:{__html:a(s(null!==(f=N.publisher)&&void 0!==f?f:"NA",k))}}):null!==(v=N.publisher)&&void 0!==v?v:"NA"]})),t("p",e({style:d.detailsContainerItem},{children:[n("span",e({style:d.boldText},{children:"Publishing Date:"}))," ",k&&k.length>0?n("span",{dangerouslySetInnerHTML:{__html:a(s(null!==(x=N.publishingDate)&&void 0!==x?x:"NA",k))}}):null!==(y=N.publishingDate)&&void 0!==y?y:"NA"]})),t("p",e({style:d.detailsContainerItem},{children:[n("span",e({style:d.boldText},{children:"Age:"}))," ",k&&k.length>0?n("span",{dangerouslySetInnerHTML:{__html:a(s(null!==(C=N.age)&&void 0!==C?C:"NA",k))}}):null!==(w=N.age)&&void 0!==w?w:"NA"]}))]})),t("div",e({style:d.categoriesContainer},{children:[n("p",e({style:d.sectionTitle,className:"book-details-section-title"},{children:"Subject Categories"})),t("div",e({style:d.categoriesList,className:"book-details-categories-list"},{children:[j.map(function(t,i){return n("span",e({style:d.category,className:"book-details-category"},{children:k&&k.length>0?n("span",{dangerouslySetInnerHTML:{__html:a(s(t,k))}}):t}),i)}),N.subjectCategories&&N.subjectCategories.length>10&&n("button",e({style:d.button,onClick:function(){return _(!L)},onMouseOver:function(e){return e.currentTarget.style.textDecoration="underline"},onMouseOut:function(e){return e.currentTarget.style.textDecoration="none"}},{children:L?"View less":"View more"}))]}))]})),t("div",e({style:d.reviewsContainer},{children:[n("p",e({style:d.sectionTitle,className:"book-details-section-title"},{children:"Book Marketing Collateral"})),t("div",e({style:d.reviewsList,className:"book-details-reviews-list"},{children:[N.reviews&&N.reviews.length>0?(T=N.reviews.filter(function(e){return e.replace(/<[^>]+>/g,"").trim().replace(/&[#A-Za-z0-9]+;/g,"").trim().length>0}),(M?T:T.slice(0,3)).map(function(t,i){return n("div",e({style:d.reviewCard,className:"book-details-review-card"},{children:n("div",{style:d.reviewText,dangerouslySetInnerHTML:{__html:k&&k.length>0?a(s(t,k)):t}})}),i)})):n("p",e({style:d.reviewText},{children:"No Book Marketing Collateral available for this book."})),N.reviews&&N.reviews.length>3&&n("button",e({style:d.button,onClick:function(){return B(function(e){return!e})},onMouseOver:function(e){return e.currentTarget.style.textDecoration="underline"},onMouseOut:function(e){return e.currentTarget.style.textDecoration="none"}},{children:M?"View less":"View more"}))]}))]}))]}))};export{c as default};
1
+ import{__assign as e}from"tslib";import{jsxs as t,jsx as n}from"react/jsx-runtime";import{useState as i,useRef as o,useMemo as r,useEffect as l}from"react";import{highlightTermsFunc as s}from"../utils/highlight.js";import{sanitizeHtml as a}from"../../../utils/sanitizeHtml.js";var d={container:{width:"100%"},sectionTitle:{fontSize:"14px",fontWeight:600,color:"#667085",marginBottom:"12px"},detailsContainer:{marginBottom:"24px",fontSize:"14px",fontWeight:400,color:"#64748B",display:"flex",flexDirection:"column",gap:"4px",paddingLeft:"12px"},detailsContainerItem:{margin:"4px 0"},boldText:{fontWeight:"bold"},categoriesContainer:{marginBottom:"24px"},categoriesList:{display:"flex",flexWrap:"wrap",gap:"12px",marginBottom:"8px",paddingLeft:"12px"},category:{backgroundColor:"#ECEEF1",padding:"8px 12px",fontWeight:400,fontSize:"12px",borderRadius:"4px",color:"#64748B",maxWidth:"100%",wordBreak:"break-word"},button:{color:"#5928ED",fontSize:"14px",fontWeight:600,background:"none",border:"none",cursor:"pointer",padding:0,textDecoration:"none",paddingLeft:"12px"},reviewsList:{paddingLeft:"12px"},reviewCard:{border:"1px solid #CBD5E1",borderRadius:"6px",padding:"16px",marginBottom:"12px",backgroundColor:"#F8FAFC"},reviewText:{fontSize:"14px",fontStyle:"italic",fontWeight:400,color:"#475569",marginBottom:"8px"},reviewSource:{fontSize:"10px",color:"#475569",fontWeight:600}},c=function(c){var u,g,p,h,m,b,f,v,x,y,C,T,w,N=c.data,k=c.highlightTerms,S=c.onHighlightMatch,L=c.highlightEnabled;c.citationType;var I,_=c.citationSubTitle,M=i(!1),A=M[0],B=M[1],D=i(!1),j=D[0],H=D[1],W=o(null),z=null!==(u=null==k?void 0:k.map(function(e){return e.split(",")}).flat())&&void 0!==u?u:[],E=r(function(){return A?N.subjectCategories||[]:(N.subjectCategories||[]).slice(0,10)},[A,N.subjectCategories]);return l(function(){var e,t;if((null==k?void 0:k.length)&&L){var n="genre_details"==_?z.map(function(e){return e.toLowerCase()}):k.map(function(e){return e.toLowerCase()}),i=function(e){return e&&n.some(function(t){return e.toLowerCase().includes(t)})},o=[N.isbn,N.isbn10,N.imprint,N.publisher,N.publishingDate,N.age].some(i),r=(null!==(e=N.subjectCategories)&&void 0!==e?e:[]).some(i);console.log("categoriesMatch",r);var l=(null!==(t=N.reviews)&&void 0!==t?t:[]).some(function(e){return i(e.replace(/<[^>]+>/g,""))}),s=o||r||l;null==S||S(s),s&&(r&&!A&&B(!0),l&&!j&&H(!0))}},[k,N]),t("div",e({ref:W,style:d.container,className:"book-details-container"},{children:[n("p",e({style:d.sectionTitle,className:"book-details-section-title"},{children:"Product Details"})),t("div",e({style:d.detailsContainer,className:"book-details-details-container"},{children:[t("p",e({style:d.detailsContainerItem},{children:[n("span",e({style:d.boldText},{children:"ISBN:"}))," ",k&&k.length>0&&L?n("span",{dangerouslySetInnerHTML:{__html:a(s(null!==(g=N.isbn)&&void 0!==g?g:"NA",k))}}):null!==(p=N.isbn)&&void 0!==p?p:"NA"]})),t("p",e({style:d.detailsContainerItem},{children:[n("span",e({style:d.boldText},{children:"ISBN 10:"}))," ",k&&k.length>0&&L?n("span",{dangerouslySetInnerHTML:{__html:a(s(null!==(h=N.isbn10)&&void 0!==h?h:"NA",k))}}):null!==(m=N.isbn10)&&void 0!==m?m:"NA"]})),t("p",e({style:d.detailsContainerItem},{children:[n("span",e({style:d.boldText},{children:"Imprint:"}))," ",k&&k.length>0&&L?n("span",{dangerouslySetInnerHTML:{__html:a(s(null!==(b=N.imprint)&&void 0!==b?b:"NA",k))}}):null!==(f=N.imprint)&&void 0!==f?f:"NA"]})),t("p",e({style:d.detailsContainerItem},{children:[n("span",e({style:d.boldText},{children:"Publisher:"}))," ",k&&k.length>0&&L?n("span",{dangerouslySetInnerHTML:{__html:a(s(null!==(v=N.publisher)&&void 0!==v?v:"NA",k))}}):null!==(x=N.publisher)&&void 0!==x?x:"NA"]})),t("p",e({style:d.detailsContainerItem},{children:[n("span",e({style:d.boldText},{children:"Publishing Date:"}))," ",k&&k.length>0&&L?n("span",{dangerouslySetInnerHTML:{__html:a(s(null!==(y=N.publishingDate)&&void 0!==y?y:"NA",k))}}):null!==(C=N.publishingDate)&&void 0!==C?C:"NA"]})),t("p",e({style:d.detailsContainerItem},{children:[n("span",e({style:d.boldText},{children:"Age:"}))," ",k&&k.length>0&&L?n("span",{dangerouslySetInnerHTML:{__html:a(s(null!==(T=N.age)&&void 0!==T?T:"NA",k))}}):null!==(w=N.age)&&void 0!==w?w:"NA"]}))]})),t("div",e({style:d.categoriesContainer},{children:[n("p",e({style:d.sectionTitle,className:"book-details-section-title"},{children:"Subject Categories"})),t("div",e({style:d.categoriesList,className:"book-details-categories-list"},{children:[E.map(function(t,i){return n("span",e({style:d.category,className:"book-details-category"},{children:k&&k.length>0&&L?n("span",{dangerouslySetInnerHTML:{__html:a(s(t,z))}}):t}),i)}),N.subjectCategories&&N.subjectCategories.length>10&&n("button",e({style:d.button,onClick:function(){return B(!A)},onMouseOver:function(e){return e.currentTarget.style.textDecoration="underline"},onMouseOut:function(e){return e.currentTarget.style.textDecoration="none"}},{children:A?"View less":"View more"}))]}))]})),t("div",e({style:d.reviewsContainer},{children:[n("p",e({style:d.sectionTitle,className:"book-details-section-title"},{children:"Book Marketing Collateral"})),t("div",e({style:d.reviewsList,className:"book-details-reviews-list"},{children:[N.reviews&&N.reviews.length>0?(I=N.reviews.filter(function(e){return e.replace(/<[^>]+>/g,"").trim().replace(/&[#A-Za-z0-9]+;/g,"").trim().length>0}),(j?I:I.slice(0,3)).map(function(t,i){return n("div",e({style:d.reviewCard,className:"book-details-review-card"},{children:n("div",{style:d.reviewText,dangerouslySetInnerHTML:{__html:k&&k.length>0&&L?a(s(t,k)):t}})}),i)})):n("p",e({style:d.reviewText},{children:"No Book Marketing Collateral available for this book."})),N.reviews&&N.reviews.length>3&&n("button",e({style:d.button,onClick:function(){return H(function(e){return!e})},onMouseOver:function(e){return e.currentTarget.style.textDecoration="underline"},onMouseOut:function(e){return e.currentTarget.style.textDecoration="none"}},{children:j?"View less":"View more"}))]}))]}))]}))};export{c as default};
2
2
  //# sourceMappingURL=BookDetailsCard.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e,__awaiter as t,__generator as n,__rest as o}from"tslib";import{jsxs as r,jsx as a,Fragment as i}from"react/jsx-runtime";import l from"@mui/material/Pagination";import s from"@mui/material/Skeleton";import{useRef as c,useEffect as d,useState as u}from"react";import p from"react-markdown";import g from"rehype-raw";import h from"remark-breaks";import{highlightTermsFunc as x,processTextWithHighlight as f}from"../utils/highlight.js";import{sanitizeHtml as m}from"../../../utils/sanitizeHtml.js";var y={sectionTitle:{fontSize:"14px",fontWeight:600,color:"#667085",marginBottom:"12px"},quotesPadding:{paddingLeft:"12px"},quoteCard:{border:"1px solid #CBD5E1",borderRadius:"8px",padding:"16px",backgroundColor:"#F8FAFC",boxShadow:"0 1px 2px rgba(0,0,0,0.05)",marginBottom:"16px",cursor:"pointer",transition:"transform 0.2s ease, box-shadow 0.2s ease"},quoteText:{fontStyle:"italic",color:"#475569",fontSize:"14px",fontWeight:400,marginBottom:"12px"},quoteMeta:{color:"#475569",fontSize:"12px",fontWeight:400},quoteAuthor:{fontSize:"10px",fontWeight:600,color:"#475569",marginTop:"8px",marginBottom:"18px"},button:{color:"#5928ED",fontSize:"14px",fontWeight:600,background:"none",border:"none",cursor:"pointer",padding:0,textDecoration:"none",paddingLeft:"12px"},geoLocationsContainer:{marginTop:"24px",marginBottom:"24px"},geoText:{fontSize:"14px",fontWeight:500,cursor:"pointer",color:"#532BED"},geoDivider:{margin:"0 8px",color:"#475abb",backgroundColor:"#475abb",width:"1px",height:"18px",display:"inline-block"},geoLocationFlex:{display:"inline-flex",alignItems:"center",gap:"8px",marginBottom:"8px"},charactersContainer:{marginTop:"16px"},charactersGrid:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:"16px",marginBottom:"16px",paddingLeft:"12px"},characterCard:{border:"1px solid #E5E7EB",borderRadius:"8px",backgroundColor:"#FFFFFF",boxShadow:"0 1px 2px rgba(0,0,0,0.05)",display:"flex",alignItems:"flex-start",gap:"12px",padding:"16px",cursor:"pointer",transition:"transform 0.2s ease, box-shadow 0.2s ease"},avatar:{width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"9999px",fontSize:"14px",fontWeight:600,flexShrink:0},charName:{fontStyle:"normal",fontWeight:600,color:"#101827",fontSize:"16px"},charDesc:{fontStyle:"normal",fontWeight:400,fontSize:"14px",color:"#6B7280"},retryButton:{backgroundColor:"#5928EC",color:"#fff",padding:"6px 10px",border:"none",borderRadius:"6px",cursor:"pointer",fontSize:"12px",fontWeight:"500"}},v=function(v){var b,k,T;v.data;var C=v.updateQuotesToHighLight,w=v.handleFetchManuscriptElements,S=v.BookIsbn,L=v.title,N=v.highlightTerms,q=v.onHighlightMatch,B=v.defaultPages,D=c(!0);d(function(){return function(){D.current=!1}},[]);var M=u([]),E=M[0],P=M[1],F=u(null!==(b=null==B?void 0:B.quotes)&&void 0!==b?b:1),_=F[0],H=F[1],I=u(!1),W=I[0],z=I[1],R=u(!0),j=R[0],G=R[1],K=u(0),Y=K[0],A=K[1],Q=u([]),O=Q[0],J=Q[1],U=u(null!==(k=null==B?void 0:B.characters)&&void 0!==k?k:1),V=U[0],X=U[1],Z=u(!1),$=Z[0],ee=Z[1],te=u(!0),ne=te[0],oe=te[1],re=u(0),ae=re[0],ie=re[1],le=u([]),se=le[0],ce=le[1],de=u(null!==(T=null==B?void 0:B.locations)&&void 0!==T?T:1),ue=de[0],pe=de[1],ge=u(!1),he=ge[0],xe=ge[1],fe=u(!0),me=fe[0],ye=fe[1],ve=u(0),be=ve[0],ke=ve[1],Te=u({list:"",index:-1,page:1}),Ce=Te[0],we=Te[1],Se=c(!1),Le=c(null);d(function(){if(null==N?void 0:N.length){var e=N.map(function(e){return e.toLowerCase()}),t=function(t){return t&&e.some(function(e){return t.toLowerCase().includes(e)})},n=!1;E.forEach(function(e,o){!n&&t(e.text)&&(we({list:"notable",index:o,page:_}),null==q||q(!0),n=!0)}),se.forEach(function(e,o){!n&&t(e.name)&&(we({list:"geo_location",index:o,page:ue}),null==q||q(!0),n=!0)}),O.forEach(function(e,o){n||!t(e.name)&&!t(e.description)||(we({list:"key_character",index:o,page:V}),null==q||q(!0),n=!0)})}},[N,E,se,O,_,ue,V]),d(function(){B&&(B.quotes&&H(B.quotes),B.locations&&pe(B.locations),B.characters&&X(B.characters))},[B]),d(function(){Se.current=!1},[N]);var Ne=function(e){var o=e.endpoint,r=e.page,a=e.isbn,i=e.setData,l=e.setLoading,s=e.setHasMore,c=e.setTotalPage,d=e.title;return t(void 0,void 0,void 0,function(){var e,t,u,p;return n(this,function(n){switch(n.label){case 0:l(!0),n.label=1;case 1:return n.trys.push([1,,3,4]),[4,w({endpoint:o,page:r,pageSize:10,isbn:a,title:d})];case 2:return e=n.sent(),D.current?(i((null==e?void 0:e.data)||[]),c((null===(t=null==e?void 0:e.pagination)||void 0===t?void 0:t.totalPages)||0),s(!(null===(u=null==e?void 0:e.pagination)||void 0===u?void 0:u.hasNext)&&!(null===(p=null==e?void 0:e.pagination)||void 0===p?void 0:p.hasPrevious)),[3,4]):[2];case 3:return D.current&&l(!1),[7];case 4:return[2]}})})};return d(function(){Ne({endpoint:"notable-quotes",page:_,isbn:S,setData:P,setLoading:z,setHasMore:G,setTotalPage:A,title:L})},[_]),d(function(){Ne({endpoint:"notable-characters",page:V,isbn:S,setData:J,setLoading:ee,setHasMore:oe,setTotalPage:ie,title:L})},[V]),d(function(){Ne({endpoint:"geo-locations",page:ue,isbn:S,setData:ce,setLoading:xe,setHasMore:ye,setTotalPage:ke,title:L})},[ue]),r("div",e({ref:Le,className:"book-elements-container"},{children:[r("div",e({style:{marginBottom:"24px"}},{children:[a("p",e({style:y.sectionTitle,className:"book-elements-section-title"},{children:"Notable Quotes"})),r("div",e({style:y.quotesPadding},{children:[W?a("div",e({style:{display:"flex",flexDirection:"column",rowGap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map(function(t){return r("div",e({className:"book-elements-quote-card",style:y.quoteCard},{children:[a(s,{variant:"text",width:"60%",height:28}),a(s,{variant:"text",width:"40%",height:20}),a(s,{variant:"text",width:"25%",height:20}),a(s,{variant:"text",width:"30%",height:20})]}),t)})})):0===E.length?r("p",e({style:{color:"#6B7280",fontStyle:"italic"}},{children:["No notable quotes found. ",a("button",e({style:y.retryButton,onClick:function(){return Ne({endpoint:"notable-quotes",page:_,isbn:S,setData:P,setLoading:z,setHasMore:G,setTotalPage:A,title:L})}},{children:"Retry"}))]})):a(i,{children:E.map(function(o,i){var l="notable"===Ce.list&&Ce.page===_&&Ce.index===i;return r("div",e({className:"book-elements-quote-card",style:e(e({},y.quoteCard),{borderColor:l?"rgb(83, 43, 237)":"#CBD5E1"}),onMouseEnter:function(e){e.currentTarget.style.transform="translateY(-4px)",e.currentTarget.style.boxShadow="0 4px 12px rgba(0, 0, 0, 0.15)"},onMouseLeave:function(e){e.currentTarget.style.transform="translateY(0)",e.currentTarget.style.boxShadow="0 1px 4px rgba(0, 0, 0, 0.1)"},onClick:function(){return t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),we({list:"notable",page:_,index:i}),(null===(t=null==o?void 0:o.chunkIds)||void 0===t?void 0:t.length)>0?[4,C(o.text,"Notable Quotes",o.chunkIds,0)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[3,4];case 3:return e=n.sent(),console.error("Failed to highlight quote:",e),[3,4];case 4:return[2]}})})},"data-selected":"notable"===Ce.list&&Ce.page===_&&Ce.index===i?"true":void 0},{children:[N&&N.length>0?a("p",{style:y.quoteText,className:"book-elements-quote-text",dangerouslySetInnerHTML:{__html:m(x(null==o?void 0:o.text,N))}}):a("p",e({style:y.quoteText,className:"book-elements-quote-text"},{children:null==o?void 0:o.text})),r("p",e({style:y.quoteMeta,className:"book-elements-quote-meta"},{children:[f(o.chapter,N)," ",a("br",{})," ",f(o.page,N)]})),r("p",e({style:y.quoteAuthor},{children:["— ",f(null==o?void 0:o.author,N)]}))]}),i)})}),a("div",e({className:"book-elements-pagination",style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!j&&a(l,{disabled:W,count:Y,page:_,onChange:function(e,t){return H(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]})),r("div",e({style:y.geoLocationsContainer},{children:[a("p",e({style:y.sectionTitle,className:"book-elements-section-title"},{children:"Key Geo Locations"})),r("div",e({className:"book-elements-geo-wrapper",style:e(e({},y.quotesPadding),{marginBottom:"8px"})},{children:[he?a("div",e({style:{display:"flex",flexWrap:"wrap",gap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map(function(e){return a(s,{variant:"rectangular",width:100,height:20,style:{borderRadius:"8px"}},e)})})):0===se.length?r("p",e({style:{color:"#6B7280",fontStyle:"italic",paddingLeft:"12px"}},{children:["No key geo locations found. ",a("button",e({style:y.retryButton,onClick:function(){return Ne({endpoint:"geo-locations",page:ue,isbn:S,setData:ce,setLoading:xe,setHasMore:ye,setTotalPage:ke,title:L})}},{children:"Retry"}))]})):a(i,{children:se.map(function(o,i){var l="geo_location"===Ce.list&&Ce.page===ue&&Ce.index===i;return r("span",e({"data-selected":"geo_location"===Ce.list&&Ce.page===ue&&Ce.index===i?"true":void 0,style:y.geoLocationFlex},{children:[a("span",e({className:"book-elements-geo-text",style:e(e({},y.geoText),{fontWeight:l?"700":"",textDecoration:l?"underline":""}),onClick:function(){return t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),we({list:"geo_location",page:ue,index:i}),(null===(t=null==o?void 0:o.chunkIds)||void 0===t?void 0:t.length)>0?[4,C(o.name,"Key Geo Locations",o.chunkIds,0)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[3,4];case 3:return e=n.sent(),console.error("Failed to highlight location:",e),[3,4];case 4:return[2]}})})},onMouseOver:function(e){return e.currentTarget.style.textDecoration="underline"},onMouseOut:function(e){return e.currentTarget.style.textDecoration="none"}},{children:N&&N.length>0?a("span",{dangerouslySetInnerHTML:{__html:m(x(null==o?void 0:o.name,N))}}):null==o?void 0:o.name})),i<se.length-1&&a("span",{style:y.geoDivider})]}),i)})}),a("div",e({className:"book-elements-pagination",style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!me&&a(l,{disabled:he,count:be,page:ue,onChange:function(e,t){return pe(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]})),r("div",e({style:y.charactersContainer},{children:[a("p",e({style:y.sectionTitle,className:"book-elements-section-title"},{children:"Key Characters"})),$?a("div",e({style:{display:"flex",flexWrap:"wrap",gap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map(function(t){return r("div",e({style:e(e({},y.characterCard),{flexBasis:"40%"})},{children:[a(s,{variant:"circular",style:e(e({},y.avatar),{flexShrink:0})}),r("div",e({style:{display:"flex",flexDirection:"column",flex:1}},{children:[a(s,{variant:"text",style:{flex:"1",flexShrink:0}}),a(s,{variant:"text",style:{flex:"1"}}),a(s,{variant:"text",style:{flex:"1"}}),a(s,{variant:"text",style:{flex:"1"}})]}))]}),t)})})):0===O.length?r("p",e({style:{color:"#6B7280",fontStyle:"italic",paddingLeft:"12px"}},{children:["No key characters found. ",a("button",e({style:y.retryButton,onClick:function(){return Ne({endpoint:"notable-characters",page:V,isbn:S,setData:J,setLoading:ee,setHasMore:oe,setTotalPage:ie,title:L})}},{children:"Retry"}))]})):a(i,{children:a("div",e({className:"book-elements-characters-grid",style:y.charactersGrid},{children:O.map(function(i,l){var s=e(e({},y.avatar),{backgroundColor:i.bg,color:i.color}),c="key_character"===Ce.list&&Ce.page===V&&Ce.index===l;return r("div",e({onMouseEnter:function(e){e.currentTarget.style.transform="translateY(-4px)",e.currentTarget.style.boxShadow="0 4px 12px rgba(0, 0, 0, 0.15)"},onMouseLeave:function(e){e.currentTarget.style.transform="translateY(0)",e.currentTarget.style.boxShadow="0 1px 4px rgba(0, 0, 0, 0.1)"},className:"book-elements-character-card",style:e(e({},y.characterCard),{borderColor:c?"rgb(83, 43, 237)":"#E5E7EB"}),onClick:function(){return t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:we({list:"key_character",page:V,index:l}),n.label=1;case 1:return n.trys.push([1,4,,5]),(null===(t=null==i?void 0:i.chunkIds)||void 0===t?void 0:t.length)>0?[4,C(i.name,"Key Characters",i.chunkIds,0)]:[3,3];case 2:n.sent(),n.label=3;case 3:return[3,5];case 4:return e=n.sent(),console.error("Failed to highlight character:",e),[3,5];case 5:return[2]}})})},"data-selected":"key_character"===Ce.list&&Ce.page===V&&Ce.index===l?"true":void 0},{children:[a("div",e({style:s},{children:i.initials})),r("div",e({style:{display:"flex",flexDirection:"column"}},{children:[a("p",e({className:"book-elements-char-name",style:e(e({},y.charName),{margin:0})},{children:N&&N.length>0?a("span",{dangerouslySetInnerHTML:{__html:m(x(i.name,N))}}):i.name})),a("p",e({className:"book-elements-char-desc",style:e(e({},y.charDesc),{margin:0,marginTop:"4px"})},{children:a(p,e({remarkPlugins:[h],rehypePlugins:[g],components:{p:function(t){t.node;var n=o(t,["node"]);return a("p",e({style:{marginTop:0}},n))}}},{children:f(null==i?void 0:i.description,N)}))}))]}))]}),l)})}))}),a("div",e({className:"book-elements-pagination",style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!ne&&a(l,{count:ae,disabled:$,page:V,onChange:function(e,t){return X(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]}))};export{v as default};
1
+ import{__assign as e,__awaiter as t,__generator as n,__rest as o}from"tslib";import{jsxs as a,jsx as r,Fragment as i}from"react/jsx-runtime";import l from"@mui/material/Pagination";import s from"@mui/material/Skeleton";import{useRef as c,useEffect as d,useState as u}from"react";import p from"react-markdown";import h from"rehype-raw";import g from"remark-breaks";import{highlightTermsFunc as x}from"../utils/highlight.js";import{sanitizeHtml as f}from"../../../utils/sanitizeHtml.js";var m={sectionTitle:{fontSize:"14px",fontWeight:600,color:"#667085",marginBottom:"12px"},quotesPadding:{paddingLeft:"12px"},quoteCard:{border:"1px solid #CBD5E1",borderRadius:"8px",padding:"16px",backgroundColor:"#F8FAFC",boxShadow:"0 1px 2px rgba(0,0,0,0.05)",marginBottom:"16px",cursor:"pointer",transition:"transform 0.2s ease, box-shadow 0.2s ease"},quoteText:{fontStyle:"italic",color:"#475569",fontSize:"14px",fontWeight:400,marginBottom:"12px"},quoteMeta:{color:"#475569",fontSize:"12px",fontWeight:400},quoteAuthor:{fontSize:"10px",fontWeight:600,color:"#475569",marginTop:"8px",marginBottom:"18px"},button:{color:"#5928ED",fontSize:"14px",fontWeight:600,background:"none",border:"none",cursor:"pointer",padding:0,textDecoration:"none",paddingLeft:"12px"},geoLocationsContainer:{marginTop:"24px",marginBottom:"24px"},geoText:{fontSize:"14px",fontWeight:500,cursor:"pointer",color:"#532BED"},geoDivider:{margin:"0 8px",color:"#475abb",backgroundColor:"#475abb",width:"1px",height:"18px",display:"inline-block"},geoLocationFlex:{display:"inline-flex",alignItems:"center",gap:"8px",marginBottom:"8px"},charactersContainer:{marginTop:"16px"},charactersGrid:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:"16px",marginBottom:"16px",paddingLeft:"12px"},characterCard:{border:"1px solid #E5E7EB",borderRadius:"8px",backgroundColor:"#FFFFFF",boxShadow:"0 1px 2px rgba(0,0,0,0.05)",display:"flex",alignItems:"flex-start",gap:"12px",padding:"16px",cursor:"pointer",transition:"transform 0.2s ease, box-shadow 0.2s ease"},avatar:{width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"9999px",fontSize:"14px",fontWeight:600,flexShrink:0},charName:{fontStyle:"normal",fontWeight:600,color:"#101827",fontSize:"16px"},charDesc:{fontStyle:"normal",fontWeight:400,fontSize:"14px",color:"#6B7280"},retryButton:{backgroundColor:"#5928EC",color:"#fff",padding:"6px 10px",border:"none",borderRadius:"6px",cursor:"pointer",fontSize:"12px",fontWeight:"500"}},y=function(y){var v,b,k;y.data;var C=y.updateQuotesToHighLight,T=y.handleFetchManuscriptElements,w=y.BookIsbn,S=y.title,L=y.highlightTerms,q=y.onHighlightMatch,N=y.defaultPages;y.citationType;var B=y.citationSubTitle,D=y.highlightEnabled,M=c(!0);d(function(){return function(){M.current=!1}},[]);var E=u([]),_=E[0],P=E[1],F=u(null!==(v=null==N?void 0:N.quotes)&&void 0!==v?v:1),H=F[0],I=F[1],W=u(!1),z=W[0],R=W[1],j=u(!0),G=j[0],K=j[1],Y=u(0),A=Y[0],Q=Y[1],O=u([]),J=O[0],U=O[1],V=u(null!==(b=null==N?void 0:N.characters)&&void 0!==b?b:1),X=V[0],Z=V[1],$=u(!1),ee=$[0],te=$[1],ne=u(!0),oe=ne[0],ae=ne[1],re=u(0),ie=re[0],le=re[1],se=u([]),ce=se[0],de=se[1],ue=u(null!==(k=null==N?void 0:N.locations)&&void 0!==k?k:1),pe=ue[0],he=ue[1],ge=u(!1),xe=ge[0],fe=ge[1],me=u(!0),ye=me[0],ve=me[1],be=u(0),ke=be[0],Ce=be[1],Te=u({list:"",index:-1,page:1}),we=Te[0],Se=Te[1],Le=c(!1),qe=c(null);d(function(){if((null==L?void 0:L.length)&&D){var e=L.map(function(e){return e.toLowerCase()}),t=function(t){return t&&e.some(function(e){return t.toLowerCase().includes(e)})},n=!1;"notable_quotes"==B&&_.forEach(function(e,o){!n&&t(e.text)&&(null==q||q(!0),n=!0)}),"location_details"==B&&ce.forEach(function(e,o){!n&&t(e.name)&&(null==q||q(!0),n=!0)}),"notable_characters"==B&&J.forEach(function(t,o){var a;!n&&((a=t.name)&&e[0]===a.toLowerCase())&&(null==q||q(!0),n=!0)})}},[L,_,ce,J,H,pe,X]),d(function(){N&&(N.quotes&&I(N.quotes),N.locations&&he(N.locations),N.characters&&Z(N.characters))},[N]),d(function(){Le.current=!1},[L]);var Ne=function(e){var o=e.endpoint,a=e.page,r=e.isbn,i=e.setData,l=e.setLoading,s=e.setHasMore,c=e.setTotalPage,d=e.title;return t(void 0,void 0,void 0,function(){var e,t,u,p;return n(this,function(n){switch(n.label){case 0:l(!0),n.label=1;case 1:return n.trys.push([1,,3,4]),[4,T({endpoint:o,page:a,pageSize:10,isbn:r,title:d})];case 2:return e=n.sent(),M.current?(i((null==e?void 0:e.data)||[]),c((null===(t=null==e?void 0:e.pagination)||void 0===t?void 0:t.totalPages)||0),s(!(null===(u=null==e?void 0:e.pagination)||void 0===u?void 0:u.hasNext)&&!(null===(p=null==e?void 0:e.pagination)||void 0===p?void 0:p.hasPrevious)),[3,4]):[2];case 3:return M.current&&l(!1),[7];case 4:return[2]}})})};return d(function(){Ne({endpoint:"notable-quotes",page:H,isbn:w,setData:P,setLoading:R,setHasMore:K,setTotalPage:Q,title:S})},[H]),d(function(){Ne({endpoint:"notable-characters",page:X,isbn:w,setData:U,setLoading:te,setHasMore:ae,setTotalPage:le,title:S})},[X]),d(function(){Ne({endpoint:"geo-locations",page:pe,isbn:w,setData:de,setLoading:fe,setHasMore:ve,setTotalPage:Ce,title:S})},[pe]),a("div",e({ref:qe,className:"book-elements-container"},{children:[a("div",e({style:{marginBottom:"24px"}},{children:[r("p",e({style:m.sectionTitle,className:"book-elements-section-title"},{children:"Notable Quotes"})),a("div",e({style:m.quotesPadding},{children:[z?r("div",e({style:{display:"flex",flexDirection:"column",rowGap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map(function(t){return a("div",e({className:"book-elements-quote-card",style:m.quoteCard},{children:[r(s,{variant:"text",width:"60%",height:28}),r(s,{variant:"text",width:"40%",height:20}),r(s,{variant:"text",width:"25%",height:20}),r(s,{variant:"text",width:"30%",height:20})]}),t)})})):0===_.length?a("p",e({style:{color:"#6B7280",fontStyle:"italic"}},{children:["No notable quotes found. ",r("button",e({style:m.retryButton,onClick:function(){return Ne({endpoint:"notable-quotes",page:H,isbn:w,setData:P,setLoading:R,setHasMore:K,setTotalPage:Q,title:S})}},{children:"Retry"}))]})):r(i,{children:_.map(function(o,i){var l="notable"===we.list&&we.page===H&&we.index===i;return a("div",e({className:"book-elements-quote-card",style:e(e({},m.quoteCard),{borderColor:l?"rgb(83, 43, 237)":"#CBD5E1"}),onMouseEnter:function(e){e.currentTarget.style.transform="translateY(-4px)",e.currentTarget.style.boxShadow="0 4px 12px rgba(0, 0, 0, 0.15)"},onMouseLeave:function(e){e.currentTarget.style.transform="translateY(0)",e.currentTarget.style.boxShadow="0 1px 4px rgba(0, 0, 0, 0.1)"},onClick:function(){return t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),Se({list:"notable",page:H,index:i}),(null===(t=null==o?void 0:o.chunkIds)||void 0===t?void 0:t.length)>0?[4,C(o.text,"Notable Quotes",o.chunkIds,0)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[3,4];case 3:return e=n.sent(),console.error("Failed to highlight quote:",e),[3,4];case 4:return[2]}})})},"data-selected":"notable"===we.list&&we.page===H&&we.index===i?"true":void 0},{children:[L&&L.length>0&&"notable_quotes"==B&&D?r("p",{style:m.quoteText,className:"book-elements-quote-text",dangerouslySetInnerHTML:{__html:f(x(null==o?void 0:o.text,L))}}):r("p",e({style:m.quoteText,className:"book-elements-quote-text"},{children:null==o?void 0:o.text})),a("p",e({style:m.quoteMeta,className:"book-elements-quote-meta"},{children:[o.chapter,r("br",{}),o.page]})),a("p",e({style:m.quoteAuthor},{children:["— ",null==o?void 0:o.author]}))]}),i)})}),r("div",e({className:"book-elements-pagination",style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!G&&r(l,{disabled:z,count:A,page:H,onChange:function(e,t){return I(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]})),a("div",e({style:m.geoLocationsContainer},{children:[r("p",e({style:m.sectionTitle,className:"book-elements-section-title"},{children:"Key Geo Locations"})),a("div",e({className:"book-elements-geo-wrapper",style:e(e({},m.quotesPadding),{marginBottom:"8px"})},{children:[xe?r("div",e({style:{display:"flex",flexWrap:"wrap",gap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map(function(e){return r(s,{variant:"rectangular",width:100,height:20,style:{borderRadius:"8px"}},e)})})):0===ce.length?a("p",e({style:{color:"#6B7280",fontStyle:"italic",paddingLeft:"12px"}},{children:["No key geo locations found. ",r("button",e({style:m.retryButton,onClick:function(){return Ne({endpoint:"geo-locations",page:pe,isbn:w,setData:de,setLoading:fe,setHasMore:ve,setTotalPage:Ce,title:S})}},{children:"Retry"}))]})):r(i,{children:ce.map(function(o,i){var l="geo_location"===we.list&&we.page===pe&&we.index===i;return a("span",e({"data-selected":"geo_location"===we.list&&we.page===pe&&we.index===i?"true":void 0,style:m.geoLocationFlex},{children:[r("span",e({className:"book-elements-geo-text",style:e(e({},m.geoText),{fontWeight:l?"700":"",textDecoration:l?"underline":""}),onClick:function(){return t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),Se({list:"geo_location",page:pe,index:i}),(null===(t=null==o?void 0:o.chunkIds)||void 0===t?void 0:t.length)>0?[4,C(o.name,"Key Geo Locations",o.chunkIds,0)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[3,4];case 3:return e=n.sent(),console.error("Failed to highlight location:",e),[3,4];case 4:return[2]}})})},onMouseOver:function(e){return e.currentTarget.style.textDecoration="underline"},onMouseOut:function(e){return e.currentTarget.style.textDecoration="none"}},{children:L&&L.length>0&&"location_details"==B&&D?r("span",{dangerouslySetInnerHTML:{__html:f(x(null==o?void 0:o.name,L))}}):null==o?void 0:o.name})),i<ce.length-1&&r("span",{style:m.geoDivider})]}),i)})}),r("div",e({className:"book-elements-pagination",style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!ye&&r(l,{disabled:xe,count:ke,page:pe,onChange:function(e,t){return he(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]})),a("div",e({style:m.charactersContainer},{children:[r("p",e({style:m.sectionTitle,className:"book-elements-section-title"},{children:"Key Characters"})),ee?r("div",e({style:{display:"flex",flexWrap:"wrap",gap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map(function(t){return a("div",e({style:e(e({},m.characterCard),{flexBasis:"40%"})},{children:[r(s,{variant:"circular",style:e(e({},m.avatar),{flexShrink:0})}),a("div",e({style:{display:"flex",flexDirection:"column",flex:1}},{children:[r(s,{variant:"text",style:{flex:"1",flexShrink:0}}),r(s,{variant:"text",style:{flex:"1"}}),r(s,{variant:"text",style:{flex:"1"}}),r(s,{variant:"text",style:{flex:"1"}})]}))]}),t)})})):0===J.length?a("p",e({style:{color:"#6B7280",fontStyle:"italic",paddingLeft:"12px"}},{children:["No key characters found. ",r("button",e({style:m.retryButton,onClick:function(){return Ne({endpoint:"notable-characters",page:X,isbn:w,setData:U,setLoading:te,setHasMore:ae,setTotalPage:le,title:S})}},{children:"Retry"}))]})):r(i,{children:r("div",e({className:"book-elements-characters-grid",style:m.charactersGrid},{children:J.map(function(i,l){var s=e(e({},m.avatar),{backgroundColor:i.bg,color:i.color}),c="key_character"===we.list&&we.page===X&&we.index===l;return a("div",e({onMouseEnter:function(e){e.currentTarget.style.transform="translateY(-4px)",e.currentTarget.style.boxShadow="0 4px 12px rgba(0, 0, 0, 0.15)"},onMouseLeave:function(e){e.currentTarget.style.transform="translateY(0)",e.currentTarget.style.boxShadow="0 1px 4px rgba(0, 0, 0, 0.1)"},className:"book-elements-character-card",style:e(e({},m.characterCard),{borderColor:c?"rgb(83, 43, 237)":"#E5E7EB"}),onClick:function(){return t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:Se({list:"key_character",page:X,index:l}),n.label=1;case 1:return n.trys.push([1,4,,5]),(null===(t=null==i?void 0:i.chunkIds)||void 0===t?void 0:t.length)>0?[4,C(i.name,"Key Characters",i.chunkIds,0)]:[3,3];case 2:n.sent(),n.label=3;case 3:return[3,5];case 4:return e=n.sent(),console.error("Failed to highlight character:",e),[3,5];case 5:return[2]}})})},"data-selected":"key_character"===we.list&&we.page===X&&we.index===l?"true":void 0},{children:[r("div",e({style:s},{children:i.initials})),a("div",e({style:{display:"flex",flexDirection:"column"}},{children:[r("p",e({className:"book-elements-char-name",style:e(e({},m.charName),{margin:0})},{children:L&&L.length>0&&"notable_characters"==B&&i.name.toLowerCase()===L[0].toLowerCase()&&D?r("span",{dangerouslySetInnerHTML:{__html:f(x(i.name,L))}}):i.name})),r("p",e({className:"book-elements-char-desc",style:e(e({},m.charDesc),{margin:0,marginTop:"4px"})},{children:r(p,e({remarkPlugins:[g],rehypePlugins:[h],components:{p:function(t){t.node;var n=o(t,["node"]);return r("p",e({style:{marginTop:0}},n))}}},{children:null==i?void 0:i.description}))}))]}))]}),l)})}))}),r("div",e({className:"book-elements-pagination",style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!oe&&r(l,{count:ie,disabled:ee,page:X,onChange:function(e,t){return Z(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]}))};export{y as default};
2
2
  //# sourceMappingURL=BookElementsCard.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e,__rest as t}from"tslib";import{jsxs as n,jsx as l,Fragment as o}from"react/jsx-runtime";import{useState as i,useRef as r,useLayoutEffect as a,useEffect as d}from"react";import c from"react-markdown";import u from"remark-breaks";import s from"rehype-raw";import{highlightTermsFunc as p,processTextWithHighlight as m}from"../utils/highlight.js";import{sanitizeHtml as h}from"../../../utils/sanitizeHtml.js";var g={card:{border:"2px solid #E5E7EB",backgroundColor:"#FFFFFF",borderRadius:"12px",padding:"24px"},title:{fontSize:"16px",fontWeight:"bold",marginBottom:"24px"},grid:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(110px, 1fr))",gap:"24px",marginBottom:"24px"},gridItem:{backgroundColor:"#F8FAFC",border:"1px solid #DFE5EC",borderRadius:"8px",padding:"12px 8px",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"12px"},gridItemHeight:{height:"50px"},label:{fontSize:"14px",fontWeight:400,color:"#64748B",margin:0},value:{fontWeight:"bold",fontSize:"14px",color:"#434C55",margin:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"120px"},section:{marginBottom:"12px",padding:"8px 12px",borderRadius:"8px",border:"1px solid #DEE4EB"},sectionLabel:{fontSize:"14px",fontWeight:600,color:"#667085",marginBottom:"8px",whiteSpace:"pre-line"},summaryText:{marginTop:"0px"},sectionText:{fontSize:"16px",fontWeight:400,lineHeight:"1.625",color:"#64748B",marginBottom:"8px"},button:{color:"#5928ED",fontSize:"14px",fontWeight:600,background:"none",border:"none",cursor:"pointer",padding:0,textDecoration:"none"},lineClamp:{display:"-webkit-box",WebkitLineClamp:3,WebkitBoxOrient:"vertical",overflow:"hidden"},container:{fontFamily:"Inter, sans-serif",color:"#434C54",marginBottom:"8px"},partContainer:{marginBottom:"8px"},partTitle:{fontSize:"16px",fontWeight:"600",marginBottom:"10px"},chapterList:{listStyle:"none",paddingLeft:"20px",margin:0},chapterItem:{marginBottom:"6px"},chapterLink:{textDecoration:"none",color:"#63748A",fontSize:"16px",lineHeight:"1.5"},chapterLinkHover:{textDecoration:"underline"},singleChapter:{marginBottom:"4px",fontSize:"16px"},chapterNumber:{color:"#63748A"}},v=function(v){var f,y,b,x,k,T,C,S,N,L,B,w,I,D,M,_=v.data,H=v.highlightTerms,O=v.onHighlightMatch,A=i(!1),z=A[0],F=A[1],W=i(!1),E=W[0],P=W[1],V=i(!1),j=V[0],R=V[1],q=i(!1),G=q[0],J=q[1],K=r(null),Q=r(null),U=(null==_?void 0:_.tableOfContent)&&_.tableOfContent.every(function(e){return!e.title||""===e.title.trim()}),X=null===(x=null===(b=null===(y=null===(f=null==_?void 0:_.bookDescription)||void 0===f?void 0:f.replace(/display:\s*-webkit-box;?/g,""))||void 0===y?void 0:y.replace(/-webkit-line-clamp:\s*\d+;?/g,""))||void 0===b?void 0:b.replace(/-webkit-box-orient:\s*vertical;?/g,""))||void 0===x?void 0:x.replace(/overflow:\s*hidden;?/g,""),Y=function(e){return null!=e?String(e):""};return a(function(){if(K.current){var e=K.current.scrollHeight>K.current.clientHeight;J(e)}},[null==_?void 0:_.bookDescription,E]),d(function(){var e;if(null==H?void 0:H.length){var t=H.map(function(e){return e.toLowerCase()}),n=function(e){return e&&t.some(function(t){return e.toLowerCase().includes(t)})},l=n(_.title),o=n(_.author),i=n(_.bookDescription),r=n(_.summary),a=n(Y(null==_?void 0:_.totalSectionCount)),d=n(Y(null==_?void 0:_.totalPages)),c=n(_.readingTime),u=null===(e=null==_?void 0:_.tableOfContent)||void 0===e?void 0:e.some(function(e){var t;return n(null==e?void 0:e.title)||(null===(t=null==e?void 0:e.children)||void 0===t?void 0:t.some(function(e){return n(null==e?void 0:e.title)}))}),s=l||o||i||r||a||d||c||u;null==O||O(s),s&&(i&&P(!0),r&&F(!0),u&&R(!0))}},[H,_]),n("div",e({ref:Q,style:g.card,className:"book-card-container"},{children:[n("div",e({style:g.grid,className:"book-card-grid"},{children:[n("div",e({style:g.gridItem},{children:[l("p",e({style:g.label},{children:"Book Title"})),H&&H.length>0?l("p",{style:g.value,className:"book-card-value",title:null==_?void 0:_.title,dangerouslySetInnerHTML:{__html:h(p(null!==(k=null==_?void 0:_.title)&&void 0!==k?k:"NA",H))}}):l("p",e({style:g.value,className:"book-card-value",title:null==_?void 0:_.title},{children:null!==(T=null==_?void 0:_.title)&&void 0!==T?T:"NA"}))]})),n("div",e({style:g.gridItem},{children:[l("p",e({style:g.label},{children:"Book Author"})),H&&H.length>0?l("p",{style:g.value,className:"book-card-value",title:null==_?void 0:_.author,dangerouslySetInnerHTML:{__html:h(p(null!==(C=null==_?void 0:_.author)&&void 0!==C?C:"NA",H))}}):l("p",e({style:g.value,className:"book-card-value",title:null==_?void 0:_.author},{children:null!==(S=null==_?void 0:_.author)&&void 0!==S?S:"NA"}))]})),n("div",e({style:g.gridItem},{children:[l("p",e({style:g.label},{children:"Total Sections"})),H&&H.length>0?l("p",{style:g.value,className:"book-card-value",dangerouslySetInnerHTML:{__html:h(p(null!==(N=String(null==_?void 0:_.totalSectionCount))&&void 0!==N?N:"NA",H))}}):l("p",e({style:g.value,className:"book-card-value"},{children:null!==(L=null==_?void 0:_.totalSectionCount)&&void 0!==L?L:"NA"}))]})),n("div",e({style:g.gridItem},{children:[l("p",e({style:g.label},{children:"Total Pages"})),H&&H.length>0?l("p",{style:g.value,className:"book-card-value",dangerouslySetInnerHTML:{__html:h(p(String(null!==(B=null==_?void 0:_.totalPages)&&void 0!==B?B:"NA"),H))}}):l("p",e({style:g.value,className:"book-card-value"},{children:null!==(w=null==_?void 0:_.totalPages)&&void 0!==w?w:"NA"}))]})),n("div",e({style:g.gridItem},{children:[l("p",e({style:g.label},{children:"Reading Time"})),H&&H.length>0?l("p",{style:g.value,className:"book-card-value",dangerouslySetInnerHTML:{__html:h(p(String(null!==(I=null==_?void 0:_.readingTime)&&void 0!==I?I:"NA"),H))}}):l("p",e({style:g.value,className:"book-card-value"},{children:null!==(D=null==_?void 0:_.readingTime)&&void 0!==D?D:"NA"}))]}))]})),(null==_?void 0:_.bookDescription)&&(null==_?void 0:_.bookDescription.length)>0&&n("div",e({style:g.section,className:"book-card-section"},{children:[l("p",e({style:g.sectionLabel},{children:"Book Description"})),l("div",e({ref:K,className:"book-card-section-text",style:e(e(e({},g.sectionText),g.summaryText),E?{}:g.lineClamp)},{children:l("div",{dangerouslySetInnerHTML:{__html:H&&H.length>0?h(p(X||"",H)):X}})})),(G||E)&&l("button",e({style:e(e({},g.button),{marginBottom:"10px"}),onClick:function(){return P(function(e){return!e})},onMouseOver:function(e){return e.currentTarget.style.textDecoration="underline"},onMouseOut:function(e){return e.currentTarget.style.textDecoration="none"}},{children:E?"View Less":"View More"}))]})),n("div",e({style:g.section,className:"book-card-section"},{children:[l("p",e({style:g.sectionLabel},{children:"AI Book Summary"})),l("p",e({className:"book-card-section-text",style:e(e({},g.sectionText),z?{}:g.lineClamp)},{children:l(c,e({remarkPlugins:[u],rehypePlugins:[s],components:{p:function(n){n.node;var o=t(n,["node"]);return l("p",e({style:{marginTop:"0"}},o))}}},{children:m(null==_?void 0:_.summary,H)}))})),(null==_?void 0:_.summary)&&(null==_?void 0:_.summary.length)>0&&l("button",e({style:e(e({},g.button),{marginBottom:"10px"}),onClick:function(){return F(function(e){return!e})},onMouseOver:function(e){return e.currentTarget.style.textDecoration="underline"},onMouseOut:function(e){return e.currentTarget.style.textDecoration="none"}},{children:z?"View Less":"View More"}))]})),n("div",e({style:e(e({},g.section),{marginTop:"10px"})},{children:[l("p",e({style:e(e({},g.sectionLabel),{marginBottom:"18px"})},{children:"Table Of Content"})),l("div",e({style:e(e({},g.container),j?{}:g.lineClamp)},{children:(null==_?void 0:_.tableOfContent)&&!U?null===(M=null==_?void 0:_.tableOfContent)||void 0===M?void 0:M.map(function(t,i){return l("div",e({style:g.partContainer},{children:t.children?n(o,{children:[l("p",{style:g.partTitle,className:"book-card-part-title",dangerouslySetInnerHTML:{__html:H&&H.length>0?h(p(t.title,H)):t.title}}),l("ul",e({style:g.chapterList},{children:t.children.map(function(t,n){return l("li",e({style:g.chapterItem},{children:l("span",{style:g.chapterLink,className:"book-card-chapter-link",dangerouslySetInnerHTML:{__html:H&&H.length>0?h(p(t.title,H)):t.title}})}),n)})}))]}):l("div",e({style:g.singleChapter},{children:l("span",{style:g.chapterLink,className:"book-card-chapter-link",dangerouslySetInnerHTML:{__html:H&&H.length>0?h(p(t.title,H)):t.title}})}))}),i)}):l("p",e({style:{fontStyle:"italic",fontSize:"16px",color:"#6B7280",margin:"8px 0"}},{children:"Table of Contents not found for this book."}))})),(null==_?void 0:_.tableOfContent)&&!U&&(null==_?void 0:_.tableOfContent.length)>0&&l("button",e({style:e(e({},g.button),{marginBottom:"10px"}),onClick:function(){return R(function(e){return!e})},onMouseOver:function(e){return e.currentTarget.style.textDecoration="underline"},onMouseOut:function(e){return e.currentTarget.style.textDecoration="none"}},{children:j?"View Less":"View More"}))]}))]}))};export{v as default};
1
+ import{__assign as e,__rest as t}from"tslib";import{jsxs as n,jsx as l,Fragment as o}from"react/jsx-runtime";import{useState as i,useRef as r,useLayoutEffect as a,useEffect as d}from"react";import c from"react-markdown";import u from"remark-breaks";import s from"rehype-raw";import{highlightTermsFunc as p,processTextWithHighlight as m}from"../utils/highlight.js";import{sanitizeHtml as h}from"../../../utils/sanitizeHtml.js";var g={card:{border:"2px solid #E5E7EB",backgroundColor:"#FFFFFF",borderRadius:"12px",padding:"24px"},title:{fontSize:"16px",fontWeight:"bold",marginBottom:"24px"},grid:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(110px, 1fr))",gap:"24px",marginBottom:"24px"},gridItem:{backgroundColor:"#F8FAFC",border:"1px solid #DFE5EC",borderRadius:"8px",padding:"12px 8px",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"12px"},gridItemHeight:{height:"50px"},label:{fontSize:"14px",fontWeight:400,color:"#64748B",margin:0},value:{fontWeight:"bold",fontSize:"14px",color:"#434C55",margin:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"120px"},section:{marginBottom:"12px",padding:"8px 12px",borderRadius:"8px",border:"1px solid #DEE4EB"},sectionLabel:{fontSize:"14px",fontWeight:600,color:"#667085",marginBottom:"8px",whiteSpace:"pre-line"},summaryText:{marginTop:"0px"},sectionText:{fontSize:"16px",fontWeight:400,lineHeight:"1.625",color:"#64748B",marginBottom:"8px"},button:{color:"#5928ED",fontSize:"14px",fontWeight:600,background:"none",border:"none",cursor:"pointer",padding:0,textDecoration:"none"},lineClamp:{display:"-webkit-box",WebkitLineClamp:3,WebkitBoxOrient:"vertical",overflow:"hidden"},container:{fontFamily:"Inter, sans-serif",color:"#434C54",marginBottom:"8px"},partContainer:{marginBottom:"8px"},partTitle:{fontSize:"16px",fontWeight:"600",marginBottom:"10px"},chapterList:{listStyle:"none",paddingLeft:"20px",margin:0},chapterItem:{marginBottom:"6px"},chapterLink:{textDecoration:"none",color:"#63748A",fontSize:"16px",lineHeight:"1.5"},chapterLinkHover:{textDecoration:"underline"},singleChapter:{marginBottom:"4px",fontSize:"16px"},chapterNumber:{color:"#63748A"}},v=function(v){var f,b,y,x,k,T,C,S,N,L,B,w,I,D,M,_=v.data,H=v.highlightTerms,O=v.onHighlightMatch,A=v.highlightEnabled,z=i(!1),F=z[0],E=z[1],W=i(!1),P=W[0],V=W[1],j=i(!1),R=j[0],q=j[1],G=i(!1),J=G[0],K=G[1],Q=r(null),U=r(null),X=(null==_?void 0:_.tableOfContent)&&_.tableOfContent.every(function(e){return!e.title||""===e.title.trim()}),Y=null===(x=null===(y=null===(b=null===(f=null==_?void 0:_.bookDescription)||void 0===f?void 0:f.replace(/display:\s*-webkit-box;?/g,""))||void 0===b?void 0:b.replace(/-webkit-line-clamp:\s*\d+;?/g,""))||void 0===y?void 0:y.replace(/-webkit-box-orient:\s*vertical;?/g,""))||void 0===x?void 0:x.replace(/overflow:\s*hidden;?/g,""),Z=function(e){return null!=e?String(e):""};return a(function(){if(Q.current){var e=Q.current.scrollHeight>Q.current.clientHeight;K(e)}},[null==_?void 0:_.bookDescription,P]),d(function(){var e;if((null==H?void 0:H.length)&&A){var t=H.map(function(e){return e.toLowerCase()}),n=function(e){return e&&t.some(function(t){return e.toLowerCase().includes(t)})},l=n(_.title),o=n(_.author),i=n(_.bookDescription),r=n(_.summary),a=n(Z(null==_?void 0:_.totalSectionCount)),d=n(Z(null==_?void 0:_.totalPages)),c=n(_.readingTime),u=null===(e=null==_?void 0:_.tableOfContent)||void 0===e?void 0:e.some(function(e){var t;return n(null==e?void 0:e.title)||(null===(t=null==e?void 0:e.children)||void 0===t?void 0:t.some(function(e){return n(null==e?void 0:e.title)}))}),s=l||o||i||r||a||d||c||u;null==O||O(s),s&&(i&&V(!0),r&&E(!0),u&&q(!0))}},[H,_]),n("div",e({ref:U,style:g.card,className:"book-card-container"},{children:[n("div",e({style:g.grid,className:"book-card-grid"},{children:[n("div",e({style:g.gridItem},{children:[l("p",e({style:g.label},{children:"Book Title"})),H&&H.length>0&&A?l("p",{style:g.value,className:"book-card-value",title:null==_?void 0:_.title,dangerouslySetInnerHTML:{__html:h(p(null!==(k=null==_?void 0:_.title)&&void 0!==k?k:"NA",H))}}):l("p",e({style:g.value,className:"book-card-value",title:null==_?void 0:_.title},{children:null!==(T=null==_?void 0:_.title)&&void 0!==T?T:"NA"}))]})),n("div",e({style:g.gridItem},{children:[l("p",e({style:g.label},{children:"Book Author"})),H&&H.length>0&&A?l("p",{style:g.value,className:"book-card-value",title:null==_?void 0:_.author,dangerouslySetInnerHTML:{__html:h(p(null!==(C=null==_?void 0:_.author)&&void 0!==C?C:"NA",H))}}):l("p",e({style:g.value,className:"book-card-value",title:null==_?void 0:_.author},{children:null!==(S=null==_?void 0:_.author)&&void 0!==S?S:"NA"}))]})),n("div",e({style:g.gridItem},{children:[l("p",e({style:g.label},{children:"Total Sections"})),H&&H.length>0&&A?l("p",{style:g.value,className:"book-card-value",dangerouslySetInnerHTML:{__html:h(p(null!==(N=String(null==_?void 0:_.totalSectionCount))&&void 0!==N?N:"NA",H))}}):l("p",e({style:g.value,className:"book-card-value"},{children:null!==(L=null==_?void 0:_.totalSectionCount)&&void 0!==L?L:"NA"}))]})),n("div",e({style:g.gridItem},{children:[l("p",e({style:g.label},{children:"Total Pages"})),H&&H.length>0&&A?l("p",{style:g.value,className:"book-card-value",dangerouslySetInnerHTML:{__html:h(p(String(null!==(B=null==_?void 0:_.totalPages)&&void 0!==B?B:"NA"),H))}}):l("p",e({style:g.value,className:"book-card-value"},{children:null!==(w=null==_?void 0:_.totalPages)&&void 0!==w?w:"NA"}))]})),n("div",e({style:g.gridItem},{children:[l("p",e({style:g.label},{children:"Reading Time"})),H&&H.length>0&&A?l("p",{style:g.value,className:"book-card-value",dangerouslySetInnerHTML:{__html:h(p(String(null!==(I=null==_?void 0:_.readingTime)&&void 0!==I?I:"NA"),H))}}):l("p",e({style:g.value,className:"book-card-value"},{children:null!==(D=null==_?void 0:_.readingTime)&&void 0!==D?D:"NA"}))]}))]})),(null==_?void 0:_.bookDescription)&&(null==_?void 0:_.bookDescription.length)>0&&n("div",e({style:g.section,className:"book-card-section"},{children:[l("p",e({style:g.sectionLabel},{children:"Book Description"})),l("div",e({ref:Q,className:"book-card-section-text",style:e(e(e({},g.sectionText),g.summaryText),P?{}:g.lineClamp)},{children:l("div",{dangerouslySetInnerHTML:{__html:H&&H.length>0&&A?h(p(Y||"",H)):Y}})})),(J||P)&&l("button",e({style:e(e({},g.button),{marginBottom:"10px"}),onClick:function(){return V(function(e){return!e})},onMouseOver:function(e){return e.currentTarget.style.textDecoration="underline"},onMouseOut:function(e){return e.currentTarget.style.textDecoration="none"}},{children:P?"View Less":"View More"}))]})),n("div",e({style:g.section,className:"book-card-section"},{children:[l("p",e({style:g.sectionLabel},{children:"AI Book Summary"})),l("p",e({className:"book-card-section-text",style:e(e({},g.sectionText),F?{}:g.lineClamp)},{children:l(c,e({remarkPlugins:[u],rehypePlugins:[s],components:{p:function(n){n.node;var o=t(n,["node"]);return l("p",e({style:{marginTop:"0"}},o))}}},{children:m(null==_?void 0:_.summary,H)}))})),(null==_?void 0:_.summary)&&(null==_?void 0:_.summary.length)>0&&l("button",e({style:e(e({},g.button),{marginBottom:"10px"}),onClick:function(){return E(function(e){return!e})},onMouseOver:function(e){return e.currentTarget.style.textDecoration="underline"},onMouseOut:function(e){return e.currentTarget.style.textDecoration="none"}},{children:F?"View Less":"View More"}))]})),n("div",e({style:e(e({},g.section),{marginTop:"10px"})},{children:[l("p",e({style:e(e({},g.sectionLabel),{marginBottom:"18px"})},{children:"Table Of Content"})),l("div",e({style:e(e({},g.container),R?{}:g.lineClamp)},{children:(null==_?void 0:_.tableOfContent)&&!X?null===(M=null==_?void 0:_.tableOfContent)||void 0===M?void 0:M.map(function(t,i){return l("div",e({style:g.partContainer},{children:t.children?n(o,{children:[l("p",{style:g.partTitle,className:"book-card-part-title",dangerouslySetInnerHTML:{__html:H&&H.length>0&&A?h(p(t.title,H)):t.title}}),l("ul",e({style:g.chapterList},{children:t.children.map(function(t,n){return l("li",e({style:g.chapterItem},{children:l("span",{style:g.chapterLink,className:"book-card-chapter-link",dangerouslySetInnerHTML:{__html:H&&H.length>0&&A?h(p(t.title,H)):t.title}})}),n)})}))]}):l("div",e({style:g.singleChapter},{children:l("span",{style:g.chapterLink,className:"book-card-chapter-link",dangerouslySetInnerHTML:{__html:H&&H.length>0&&A?h(p(t.title,H)):t.title}})}))}),i)}):l("p",e({style:{fontStyle:"italic",fontSize:"16px",color:"#6B7280",margin:"8px 0"}},{children:"Table of Contents not found for this book."}))})),(null==_?void 0:_.tableOfContent)&&!X&&(null==_?void 0:_.tableOfContent.length)>0&&l("button",e({style:e(e({},g.button),{marginBottom:"10px"}),onClick:function(){return q(function(e){return!e})},onMouseOver:function(e){return e.currentTarget.style.textDecoration="underline"},onMouseOut:function(e){return e.currentTarget.style.textDecoration="none"}},{children:R?"View Less":"View More"}))]}))]}))};export{v as default};
2
2
  //# sourceMappingURL=BookOverviewCard.js.map
@@ -1,2 +1,2 @@
1
- import{__spreadArray as e,__assign as l}from"tslib";import{jsxs as n,jsx as o,Fragment as t}from"react/jsx-runtime";import{useRef as i,useEffect as r}from"react";import{highlightTermsFunc as a}from"../utils/highlight.js";import{sanitizeHtml as d}from"../../../utils/sanitizeHtml.js";var p={sectionTitle:{fontSize:"14px",fontWeight:600,color:"#667085",marginBottom:"12px"},card:{backgroundColor:"#ECEEF1",padding:"8px 12px",fontWeight:500,fontSize:"14px",borderRadius:"4px",color:"#64748B",maxWidth:"100%",wordBreak:"break-word",marginBottom:"24px",width:"fit-content"},tag:{padding:"4px 12px",fontSize:"14px",fontWeight:500,color:"#3B82F6",backgroundColor:"#F3F8FF",borderRadius:"6px"},avatar:{display:"flex",alignItems:"center",justifyContent:"center",height:"35px",width:"35px",borderRadius:"50%",backgroundColor:"#E5E7EB",color:"#4B5563",fontWeight:600,flexShrink:0,fontSize:"12px"},contributorName:{fontWeight:600,color:"#111827",marginTop:"8px",fontSize:"14px"},contributorRole:{fontSize:"12px",color:"#6B7280"},grid:{display:"grid",gridTemplateColumns:"repeat(4, minmax(0, 1fr))",gap:"24px",marginBottom:"24px",padding:"0 12px"},awardMeta:{fontSize:"14px",color:"#4B5563"},awardDesc:{fontSize:"14px",color:"#4B5563"},awardContainer:{display:"flex",gap:"8px"},awardInfo:{backgroundColor:"#ECEEF1",padding:"8px 12px",fontWeight:600,fontSize:"12px",borderRadius:"4px",color:"#434C54",maxWidth:"100%",wordBreak:"break-word",width:"fit-content"},listContainerWrapper:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:"30px",marginBottom:"24px"},awardContainerWrapper:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:"16px"}},s=function(s){var c,u,m,v=s.data,g=s.highlightTerms,h=s.onHighlightMatch,f=v.publisher,x=v.contributors,y=v.awards,b=void 0===y?[]:y,w=i(null),k=function(e){var l=e.trim().split(/\s+/).map(function(e){var l;return null===(l=e[0])||void 0===l?void 0:l.toUpperCase()}).join("");return l.length>3?"".concat(l.slice(0,3)):l};return r(function(){var l,n,o,t,i,r,a,d,p,s,c,u;if(g&&0!==g.length){var m=e(e(e(e([null!==(n=null===(l=v.publisher)||void 0===l?void 0:l.name)&&void 0!==n?n:""],null!==(t=null===(o=v.publisher)||void 0===o?void 0:o.tags)&&void 0!==t?t:[],!0),null!==(a=null===(r=null===(i=v.contributors)||void 0===i?void 0:i.primary)||void 0===r?void 0:r.flatMap(function(l){var n;return e([l.name,l.role],null!==(n=l.tags)&&void 0!==n?n:[],!0)}))&&void 0!==a?a:[],!0),null!==(s=null===(p=null===(d=v.contributors)||void 0===d?void 0:d.additional)||void 0===p?void 0:p.flatMap(function(l){var n;return e([l.name,l.role],null!==(n=l.tags)&&void 0!==n?n:[],!0)}))&&void 0!==s?s:[],!0),null!==(u=null===(c=v.awards)||void 0===c?void 0:c.flatMap(function(e){return[e.title,e.org,String(e.year),e.country]}))&&void 0!==u?u:[],!0).some(function(e){return!!e&&g.some(function(l){return e.toLowerCase().includes(l.toLowerCase())})});null==h||h(m)}},[g,v]),n("div",l({ref:w,className:"book-people-container"},{children:[o("p",l({style:p.sectionTitle,className:"book-people-section-title"},{children:"Publishers"})),n("div",l({style:p.card,className:"book-people-card"},{children:[o("span",l({style:{color:"rgb(67, 76, 85)"}},{children:g&&g.length>0?o("span",{dangerouslySetInnerHTML:{__html:d(a(f.name,g))}}):f.name})),(null==f?void 0:f.tags)&&(null==f?void 0:f.tags.length)>0&&o("div",l({style:{display:"flex",gap:"8px",marginTop:"18px"}},{children:null===(c=null==f?void 0:f.tags)||void 0===c?void 0:c.map(function(e,n){return o("span",l({style:p.tag},{children:g&&g.length>0?o("span",{dangerouslySetInnerHTML:{__html:d(a(e,g))}}):e}),n)})}))]})),o("p",l({style:p.sectionTitle,className:"book-people-section-title"},{children:"Contributors"})),o("div",l({style:p.listContainerWrapper,className:"book-people-list-wrapper"},{children:null===(u=null==x?void 0:x.primary)||void 0===u?void 0:u.map(function(e,t){var i;return n("div",l({style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}},{children:[o("div",l({style:p.avatar,className:"book-people-avatar"},{children:k(null==e?void 0:e.name)})),o("span",l({style:p.contributorName,className:"book-people-name"},{children:g&&g.length>0?o("span",{dangerouslySetInnerHTML:{__html:d(a(null==e?void 0:e.name,g))}}):null==e?void 0:e.name})),o("span",l({style:p.contributorRole,className:"book-people-role"},{children:g&&g.length>0?o("span",{dangerouslySetInnerHTML:{__html:d(a(null==e?void 0:e.role,g))}}):null==e?void 0:e.role})),o("div",l({style:{display:"flex",gap:"8px",marginTop:"8px"}},{children:null===(i=null==e?void 0:e.tags)||void 0===i?void 0:i.map(function(e,n){return o("span",l({style:p.tag},{children:g&&g.length>0?o("span",{dangerouslySetInnerHTML:{__html:d(a(e,g))}}):e}),n)})}))]}),t)})})),x.additional&&x.additional.length>0&&n(t,{children:[o("p",l({style:p.sectionTitle,className:"book-people-section-title"},{children:"Additional Contributors"})),o("div",l({style:p.listContainerWrapper,className:"book-people-list-wrapper"},{children:null===(m=null==x?void 0:x.additional)||void 0===m?void 0:m.map(function(e,t){return n("div",l({style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}},{children:[o("div",l({style:p.avatar,className:"book-people-avatar"},{children:k(null==e?void 0:e.name)})),o("span",l({style:p.contributorName,className:"book-people-name"},{children:g&&g.length>0?o("span",{dangerouslySetInnerHTML:{__html:d(a(null==e?void 0:e.name,g))}}):null==e?void 0:e.name})),o("span",l({style:p.contributorRole,className:"book-people-role"},{children:g&&g.length>0?o("span",{dangerouslySetInnerHTML:{__html:d(a(null==e?void 0:e.role,g))}}):null==e?void 0:e.role}))]}),t)})}))]}),b.length>0&&n(t,{children:[o("p",l({style:p.sectionTitle,className:"book-people-section-title"},{children:"Awards"})),o("div",l({style:p.awardContainerWrapper,className:"book-people-award-wrapper"},{children:null==b?void 0:b.map(function(e,n){return o("div",l({style:p.awardInfo},{children:o("span",{children:g&&g.length>0?o("span",{dangerouslySetInnerHTML:{__html:d(a(null==e?void 0:e.title,g))}}):null==e?void 0:e.title})}),n)})}))]})]}))};export{s as default};
1
+ import{__spreadArray as e,__assign as l}from"tslib";import{jsxs as n,jsx as o,Fragment as t}from"react/jsx-runtime";import{useRef as i,useEffect as r}from"react";import{highlightTermsFunc as a}from"../utils/highlight.js";import{sanitizeHtml as d}from"../../../utils/sanitizeHtml.js";var p={sectionTitle:{fontSize:"14px",fontWeight:600,color:"#667085",marginBottom:"12px"},card:{backgroundColor:"#ECEEF1",padding:"8px 12px",fontWeight:500,fontSize:"14px",borderRadius:"4px",color:"#64748B",maxWidth:"100%",wordBreak:"break-word",marginBottom:"24px",width:"fit-content"},tag:{padding:"4px 12px",fontSize:"14px",fontWeight:500,color:"#3B82F6",backgroundColor:"#F3F8FF",borderRadius:"6px"},avatar:{display:"flex",alignItems:"center",justifyContent:"center",height:"35px",width:"35px",borderRadius:"50%",backgroundColor:"#E5E7EB",color:"#4B5563",fontWeight:600,flexShrink:0,fontSize:"12px"},contributorName:{fontWeight:600,color:"#111827",marginTop:"8px",fontSize:"14px"},contributorRole:{fontSize:"12px",color:"#6B7280"},grid:{display:"grid",gridTemplateColumns:"repeat(4, minmax(0, 1fr))",gap:"24px",marginBottom:"24px",padding:"0 12px"},awardMeta:{fontSize:"14px",color:"#4B5563"},awardDesc:{fontSize:"14px",color:"#4B5563"},awardContainer:{display:"flex",gap:"8px"},awardInfo:{backgroundColor:"#ECEEF1",padding:"8px 12px",fontWeight:600,fontSize:"12px",borderRadius:"4px",color:"#434C54",maxWidth:"100%",wordBreak:"break-word",width:"fit-content"},listContainerWrapper:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:"30px",marginBottom:"24px"},awardContainerWrapper:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:"16px"}},s=function(s){var c,u,m,h=s.data,v=s.highlightTerms,g=s.onHighlightMatch,f=s.highlightEnabled,x=h.publisher,y=h.contributors,b=h.awards,w=void 0===b?[]:b,k=i(null),C=function(e){var l=e.trim().split(/\s+/).map(function(e){var l;return null===(l=e[0])||void 0===l?void 0:l.toUpperCase()}).join("");return l.length>3?"".concat(l.slice(0,3)):l};return r(function(){var l,n,o,t,i,r,a,d,p,s,c,u;if(v&&0!==v.length&&f){var m=e(e(e(e([null!==(n=null===(l=h.publisher)||void 0===l?void 0:l.name)&&void 0!==n?n:""],null!==(t=null===(o=h.publisher)||void 0===o?void 0:o.tags)&&void 0!==t?t:[],!0),null!==(a=null===(r=null===(i=h.contributors)||void 0===i?void 0:i.primary)||void 0===r?void 0:r.flatMap(function(l){var n;return e([l.name,l.role],null!==(n=l.tags)&&void 0!==n?n:[],!0)}))&&void 0!==a?a:[],!0),null!==(s=null===(p=null===(d=h.contributors)||void 0===d?void 0:d.additional)||void 0===p?void 0:p.flatMap(function(l){var n;return e([l.name,l.role],null!==(n=l.tags)&&void 0!==n?n:[],!0)}))&&void 0!==s?s:[],!0),null!==(u=null===(c=h.awards)||void 0===c?void 0:c.flatMap(function(e){return[e.title,e.org,String(e.year),e.country]}))&&void 0!==u?u:[],!0).some(function(e){return!!e&&v.some(function(l){return e.toLowerCase().includes(l.toLowerCase())})});null==g||g(m)}},[v,h]),n("div",l({ref:k,className:"book-people-container"},{children:[o("p",l({style:p.sectionTitle,className:"book-people-section-title"},{children:"Publishers"})),n("div",l({style:p.card,className:"book-people-card"},{children:[o("span",l({style:{color:"rgb(67, 76, 85)"}},{children:v&&v.length>0&&f?o("span",{dangerouslySetInnerHTML:{__html:d(a(x.name,v))}}):x.name})),(null==x?void 0:x.tags)&&(null==x?void 0:x.tags.length)>0&&o("div",l({style:{display:"flex",gap:"8px",marginTop:"18px"}},{children:null===(c=null==x?void 0:x.tags)||void 0===c?void 0:c.map(function(e,n){return o("span",l({style:p.tag},{children:v&&v.length>0&&f?o("span",{dangerouslySetInnerHTML:{__html:d(a(e,v))}}):e}),n)})}))]})),o("p",l({style:p.sectionTitle,className:"book-people-section-title"},{children:"Contributors"})),o("div",l({style:p.listContainerWrapper,className:"book-people-list-wrapper"},{children:null===(u=null==y?void 0:y.primary)||void 0===u?void 0:u.map(function(e,t){var i;return n("div",l({style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}},{children:[o("div",l({style:p.avatar,className:"book-people-avatar"},{children:C(null==e?void 0:e.name)})),o("span",l({style:p.contributorName,className:"book-people-name"},{children:v&&v.length>0&&f?o("span",{dangerouslySetInnerHTML:{__html:d(a(null==e?void 0:e.name,v))}}):null==e?void 0:e.name})),o("span",l({style:p.contributorRole,className:"book-people-role"},{children:v&&v.length>0&&f?o("span",{dangerouslySetInnerHTML:{__html:d(a(null==e?void 0:e.role,v))}}):null==e?void 0:e.role})),o("div",l({style:{display:"flex",gap:"8px",marginTop:"8px"}},{children:null===(i=null==e?void 0:e.tags)||void 0===i?void 0:i.map(function(e,n){return o("span",l({style:p.tag},{children:v&&v.length>0&&f?o("span",{dangerouslySetInnerHTML:{__html:d(a(e,v))}}):e}),n)})}))]}),t)})})),y.additional&&y.additional.length>0&&n(t,{children:[o("p",l({style:p.sectionTitle,className:"book-people-section-title"},{children:"Additional Contributors"})),o("div",l({style:p.listContainerWrapper,className:"book-people-list-wrapper"},{children:null===(m=null==y?void 0:y.additional)||void 0===m?void 0:m.map(function(e,t){return n("div",l({style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}},{children:[o("div",l({style:p.avatar,className:"book-people-avatar"},{children:C(null==e?void 0:e.name)})),o("span",l({style:p.contributorName,className:"book-people-name"},{children:v&&v.length>0&&f?o("span",{dangerouslySetInnerHTML:{__html:d(a(null==e?void 0:e.name,v))}}):null==e?void 0:e.name})),o("span",l({style:p.contributorRole,className:"book-people-role"},{children:v&&v.length>0&&f?o("span",{dangerouslySetInnerHTML:{__html:d(a(null==e?void 0:e.role,v))}}):null==e?void 0:e.role}))]}),t)})}))]}),w.length>0&&n(t,{children:[o("p",l({style:p.sectionTitle,className:"book-people-section-title"},{children:"Awards"})),o("div",l({style:p.awardContainerWrapper,className:"book-people-award-wrapper"},{children:null==w?void 0:w.map(function(e,n){return o("div",l({style:p.awardInfo},{children:o("span",{children:v&&v.length>0&&f?o("span",{dangerouslySetInnerHTML:{__html:d(a(null==e?void 0:e.title,v))}}):null==e?void 0:e.title})}),n)})}))]})]}))};export{s as default};
2
2
  //# sourceMappingURL=BookPeopleAwardsCard.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"tslib";import{jsx as o}from"react/jsx-runtime";import i from"@mui/material/Dialog";import t from"@mui/material/DialogContent";import{BookemonContent as n}from"./BookemonContent.js";var l={maxWidth:"none",fontFamily:"Inter, sans-serif"},r={wrapper:{alignItems:"center",justifyContent:"center",textAlign:"center"},inner:{width:"100%"},iconWrapper:{width:"80px",height:"80px",background:"linear-gradient(to right, #3B82F6, #9333EA)",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 24px auto"},icon:{width:"40px",height:"40px",color:"#FFFFFF"},heading:{fontSize:"36px",fontWeight:"bold",color:"#9333EA",marginBottom:"16px"},text:{fontSize:"18px",color:"#4B5563",lineHeight:1.6,textAlign:"center"},errorState:{color:"#CE3928",padding:"18px 0px",display:"flex",justifyContent:"center",width:"100%"}},a=o("svg",e({style:r.icon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},{children:o("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})})),s=function(r){var s=r.open,g=r.onClose,h=r.isDialog,d=void 0===h||h,m=r.isBookPreview,u=void 0===m||m,c=r.isNonHighlightedBlur,p=r.isBookemon,f=r.getHighlightContent,x=r.handleFetchManuscriptElements,B=r.data,C=r.showComingSoon,v=void 0!==C&&C,k=r.comingSoonData,w=void 0===k?{header:"Bookemon Coming Soon!!",subheader:"We're working on something amazing. Stay tuned for updates!",icon:a}:k,y=r.customStyle,S=void 0===y?{}:y,F=r.isBlurToggleVisible,D=void 0!==F&&F,E=r.highlightTerms,b=r.defaultElementPages,P=null!=g?g:function(){};return d?o(i,e({open:null!=s&&s,fullWidth:!0,PaperProps:{style:e(e({},l),null==S?void 0:S.dialogDimension)}},{children:o(t,e({style:{padding:0}},{children:o(n,{data:B,customStyle:S,comingSoonData:w,showComingSoon:v,isNonHighlightedBlur:c,isBlurToggleVisible:D,isBookemon:p,highlightTerms:E,getHighlightContent:f,handleFetchManuscriptElements:x,isBookPreview:u,isDialog:d,onClose:P,defaultElementPages:b})}))})):o("div",e({style:{width:"100%",height:"100%"}},{children:o(n,{data:B,customStyle:S,comingSoonData:w,showComingSoon:v,isNonHighlightedBlur:c,isBlurToggleVisible:D,isBookemon:p,highlightTerms:E,getHighlightContent:f,handleFetchManuscriptElements:x,isBookPreview:u,isDialog:d,onClose:P,defaultElementPages:b})}))};export{r as comingSoonStyles,s as default,a as defaultIcon};
1
+ import{__assign as e}from"tslib";import{jsx as i}from"react/jsx-runtime";import o from"@mui/material/Dialog";import t from"@mui/material/DialogContent";import{BookemonContent as n}from"./BookemonContent.js";var l={maxWidth:"none",fontFamily:"Inter, sans-serif"},r={wrapper:{alignItems:"center",justifyContent:"center",textAlign:"center"},inner:{width:"100%"},iconWrapper:{width:"80px",height:"80px",background:"linear-gradient(to right, #3B82F6, #9333EA)",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 24px auto"},icon:{width:"40px",height:"40px",color:"#FFFFFF"},heading:{fontSize:"36px",fontWeight:"bold",color:"#9333EA",marginBottom:"16px"},text:{fontSize:"18px",color:"#4B5563",lineHeight:1.6,textAlign:"center"},errorState:{color:"#CE3928",padding:"18px 0px",display:"flex",justifyContent:"center",width:"100%"}},a=i("svg",e({style:r.icon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},{children:i("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})})),s=function(r){var s=r.open,g=r.onClose,h=r.isDialog,d=void 0===h||h,m=r.isBookPreview,c=void 0===m||m,u=r.isNonHighlightedBlur,p=r.isBookemon,f=r.getHighlightContent,x=r.handleFetchManuscriptElements,B=r.data,C=r.showComingSoon,v=void 0!==C&&C,y=r.comingSoonData,S=void 0===y?{header:"Bookemon Coming Soon!!",subheader:"We're working on something amazing. Stay tuned for updates!",icon:a}:y,k=r.customStyle,w=void 0===k?{}:k,F=r.isBlurToggleVisible,b=void 0!==F&&F,T=r.highlightTerms,D=r.defaultElementPages,E=r.citationType,P=r.citationSubTitle,H=null!=g?g:function(){};return d?i(o,e({open:null!=s&&s,fullWidth:!0,PaperProps:{style:e(e({},l),null==w?void 0:w.dialogDimension)}},{children:i(t,e({style:{padding:0}},{children:i(n,{data:B,customStyle:w,comingSoonData:S,showComingSoon:v,isNonHighlightedBlur:u,isBlurToggleVisible:b,isBookemon:p,highlightTerms:T,getHighlightContent:f,handleFetchManuscriptElements:x,isBookPreview:c,isDialog:d,onClose:H,defaultElementPages:D})}))})):i("div",e({style:{width:"100%",height:"100%"}},{children:i(n,{data:B,customStyle:w,comingSoonData:S,showComingSoon:v,isNonHighlightedBlur:u,isBlurToggleVisible:b,isBookemon:p,highlightTerms:T,getHighlightContent:f,handleFetchManuscriptElements:x,isBookPreview:c,isDialog:d,onClose:H,defaultElementPages:D,citationType:E,citationSubTitle:P})}))};export{r as comingSoonStyles,s as default,a as defaultIcon};
2
2
  //# sourceMappingURL=Bookemon.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e,__awaiter as t,__generator as o}from"tslib";import{jsxs as r,jsx as i}from"react/jsx-runtime";import{useState as n,useRef as l,useEffect as a}from"react";import{PanelGroup as d,Panel as c,PanelResizeHandle as s}from"react-resizable-panels";import h from"@mui/material/Accordion";import u from"@mui/material/AccordionSummary";import g from"@mui/material/Typography";import p from"@mui/material/AccordionDetails";import m from"@mui/material/IconButton";import f from"./BookDetailsCard/BookDetailsCard.js";import v from"./BookOverviewCard/BookOverviewCard.js";import y from"./BookElementsCard/BookElementsCard.js";import b from"./BookCopyrightsCard/BookCopyrightsCard.js";import x from"./BookPeopleAwardsCard/BookPeopleAwardsCard.js";import k from"./BookPreview/BookPreview.js";import C from"@mui/icons-material/ExpandMore";import w from"@mui/icons-material/Close";var B={dialogPaper:{maxWidth:"none",fontFamily:"Inter, sans-serif"},dialogHeight:{overflow:"hidden",height:"90vh",position:"relative"},dialogContent:{padding:0,backgroundColor:"#FFFFFF"},container:{display:"flex",height:"100%",width:"100%",alignItems:"flex-start"},leftPanel:{height:"100%",padding:"24px",overflowY:"auto",backgroundColor:"#F3F4F6",borderRadius:"12px",boxSizing:"border-box"},rightPanel:{width:"40%",backgroundColor:"#FFFFFF",height:"100%",display:"flex",flexDirection:"column",justifyContent:"flex-start",overflow:"auto",flex:1,boxSizing:"border-box",overflowY:"auto"},accordion:{borderRadius:"12px",boxShadow:"none",marginBottom:"24px"},accordionSummary:{paddingLeft:"16px",paddingRight:"16px"},accordionDetails:{paddingLeft:"16px",paddingRight:"16px",paddingBottom:"16px"},heading:{fontWeight:"bold",color:"#000000",fontSize:"16px"},blurOverlay:{position:"absolute",top:0,left:0,width:"100%",height:"100%",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)",backgroundColor:"rgba(255, 255, 255, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:10,borderRadius:"12px"},closeButton:{position:"absolute",top:"8px",right:"8px",color:"#111827"},resizeHandle:{width:"10px",backgroundColor:"#e5e7eb",cursor:"col-resize",display:"flex",alignItems:"center",justifyContent:"center"},iconContainer:{display:"flex",flexDirection:"column",gap:"4px"},dot:{width:"4px",height:"4px",backgroundColor:"#6b7280",borderRadius:"50%"},resizeHandleBar:{width:"2px",height:"24px",backgroundColor:"#666",borderRadius:"2px"}},S={wrapper:{alignItems:"center",justifyContent:"center",textAlign:"center"},inner:{width:"100%"},iconWrapper:{width:"80px",height:"80px",background:"linear-gradient(to right, #3B82F6, #9333EA)",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 24px auto"},icon:{width:"40px",height:"40px",color:"#FFFFFF"},heading:{fontSize:"36px",fontWeight:"bold",color:"#9333EA",marginBottom:"16px"},text:{fontSize:"18px",color:"#4B5563",lineHeight:1.6,textAlign:"center"},errorState:{color:"#CE3928",padding:"18px 0px",display:"flex",justifyContent:"center",width:"100%"}},D=function(t){var o=t.header,n=t.subheader,l=t.icon;return i("div",e({style:S.wrapper},{children:r("div",e({style:S.inner},{children:[i("div",e({style:{marginBottom:"32px"}},{children:i("div",e({style:S.iconWrapper},{children:l}))})),r("div",{children:[i("h1",e({style:S.heading},{children:o})),i("p",e({style:S.text},{children:n}))]})]}))}))},F=function(S){var F=S.showComingSoon,P=S.onClose,I=S.highlightTerms,H=S.data,z=S.customStyle,j=S.comingSoonData,E=S.isNonHighlightedBlur,M=S.isBlurToggleVisible,T=S.isBookemon,A=S.getHighlightContent,O=S.handleFetchManuscriptElements,L=S.isBookPreview,V=S.isDialog,R=S.defaultElementPages,q=n({textToHighLight:"",content:""}),W=q[0],N=q[1],Q=n(1),Y=Q[0],_=Q[1],G=n(!1),J=G[0],K=G[1],U=n("Book Preview"),X=U[0],Z=U[1],$=n(70),ee=$[0],te=$[1],oe=l(null),re=n(!1),ie=re[0],ne=re[1],le=l(null),ae=l(null),de=l(null),ce=l(null),se=l(null),he=function(e,r,i,n){return void 0===n&&(n=0),t(void 0,void 0,void 0,function(){var t,l,a,d,c,s,h,u,g,p,m,f,v,y,b,x;return o(this,function(o){switch(o.label){case 0:N({textToHighLight:"",content:""}),ne(!1),K(!0),Z(r),o.label=1;case 1:return o.trys.push([1,5,6,7]),i&&0!==i.length?[4,null==A?void 0:A([i[n]])]:(K(!1),te(70),null===(b=oe.current)||void 0===b||b.resize(70),[2]);case 2:if(t=o.sent(),l=(null==t?void 0:t.data)||t||[],!Array.isArray(l)||0===l.length)return ne(!0),K(!1),[2];for(d=(a=function(e){return e?e.replace(/<[^>]*>/g," ").replace(/&nbsp;/g," ").replace(/[\u200B-\u200D\uFEFF]/g,"").replace(/[\u2018\u2019]/g,"'").replace(/[\u201C\u201D]/g,'"').replace(/[\u2013\u2014]/g,"-").replace(/[.,!?;:'"(){}\[\]—–…\/\\@#&*_|\^~%=+<>`]/g,"").replace(/\s+/g," ").trim().toLowerCase():""})(e),c=null,s=0,h=l;s<h.length;s++)if(f=h[s],a(f.normalizedContent||f.htmlContent).includes(d)){c=f;break}if(!c)for(u=d.split(" ").filter(Boolean);u.length>0;){for(g=u.join(" "),p=0,m=l;p<m.length;p++)if(f=m[p],a(f.normalizedContent||f.htmlContent).includes(g)){c=f;break}if(c)break;u.pop()}return v=l.map(function(e){return e.htmlContent}).join("\n"),N({textToHighLight:c?c.htmlContent:"",content:v}),te(50),null===(x=oe.current)||void 0===x||x.resize(50),!c&&n+1<i.length?[4,he(e,r,i,n+1)]:[3,4];case 3:return[2,o.sent()];case 4:return[2];case 5:return y=o.sent(),console.error("Highlight error:",y),ne(!0),[3,7];case 6:return K(!1),[7];case 7:return[2]}})})},ue=n(!1),ge=ue[0],pe=ue[1],me=n(!1),fe=me[0],ve=me[1],ye=n(!1),be=ye[0],xe=ye[1],ke=n(!1),Ce=ke[0],we=ke[1],Be=n(!1),Se=Be[0],De=Be[1],Fe=n(!1),Pe=Fe[0],Ie=Fe[1],He=n(!1),ze=He[0],je=He[1],Ee=n(!1),Me=Ee[0],Te=Ee[1],Ae=n(!1),Oe=Ae[0],Le=Ae[1],Ve=n(!1),Re=Ve[0],qe=Ve[1];a(function(){ge&&Ie(!0),fe&&je(!0),be&&Te(!0),Ce&&Le(!0),Se&&qe(!0)},[ge,fe,be,Ce,Se]);var We=H.bookAwards,Ne=H.bookCopyRight,Qe=H.bookDetails,Ye=H.bookElements,_e=H.bookOverView,Ge=H.bookCoverImage,Je=null==Qe?void 0:Qe.isbn,Ke=null!=P?P:function(){};return r("div",e({style:e(e({},B.dialogContent),V?B.dialogHeight:{})},{children:[!F&&i("div",e({style:B.container},{children:r(d,e({direction:"horizontal"},{children:[i(c,e({order:1,ref:oe,defaultSize:ee||70},{children:r("div",e({style:e(e({},null==B?void 0:B.leftPanel),null==z?void 0:z.leftPanel)},{children:[i("div",e({ref:le,style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:r(h,e({expanded:Pe,onChange:function(e,t){return Ie(t)},slotProps:{transition:{onEntered:function(){var e=le.current,t=null==e?void 0:e.querySelector('[data-highlight="true"]');t&&e&&!e.dataset.scrolled&&(t.scrollIntoView({behavior:"smooth",block:"center"}),e.dataset.scrolled="true")}}},elevation:0,style:B.accordion},{children:[i(u,e({expandIcon:i(C,{}),style:B.accordionSummary},{children:i(g,e({style:B.heading},{children:"Book Overview"}))})),i(p,e({style:B.accordionDetails},{children:_e&&Object.keys(_e).length>0?i(v,{data:_e,highlightTerms:I,onHighlightMatch:pe}):i("div",e({style:B.errorState},{children:"No overview data available."}))}))]}))})),i("div",e({ref:ae,style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:r(h,e({elevation:0,style:B.accordion,expanded:ze,onChange:function(e,t){return je(t)},slotProps:{transition:{onEntered:function(){var e=ae.current;if(e){var t=e.querySelector('[data-highlight="true"]');if(t){t.scrollIntoView({behavior:"smooth",block:"center"});var o=new MutationObserver(function(){var t=e.querySelector('[data-highlight="true"]');t&&t.scrollIntoView({behavior:"auto",block:"center"}),o.disconnect()});o.observe(e,{childList:!0,subtree:!0})}}}}}},{children:[i(u,e({expandIcon:i(C,{}),style:B.accordionSummary},{children:i(g,e({style:B.heading},{children:"Book Manuscript Elements"}))})),i(p,e({style:B.accordionDetails},{children:i(y,{data:Ye,title:(null==_e?void 0:_e.title)||"",handleFetchManuscriptElements:O,BookIsbn:Je,updateQuotesToHighLight:he,highlightTerms:I,onHighlightMatch:ve,defaultPages:R})}))]}))})),i("div",e({ref:de,style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:r(h,e({expanded:Me,onChange:function(e,t){return Te(t)},elevation:0,style:B.accordion,slotProps:{transition:{onEntered:function(){var e=de.current,t=null==e?void 0:e.querySelector('[data-highlight="true"]');t&&e&&!e.dataset.scrolled&&(t.scrollIntoView({behavior:"smooth",block:"center"}),e.dataset.scrolled="true")}}}},{children:[i(u,e({expandIcon:i(C,{}),style:B.accordionSummary},{children:i(g,e({style:B.heading},{children:"Book Metadata Details"}))})),i(p,e({style:B.accordionDetails},{children:Qe&&Object.keys(Qe).length>0?i(f,{data:Qe,highlightTerms:I,onHighlightMatch:xe}):i("div",e({style:B.errorState},{children:"No Book Metadata data available."}))}))]}))})),i("div",e({ref:ce,style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:r(h,e({elevation:0,style:B.accordion,expanded:Oe,onChange:function(e,t){return Le(t)},slotProps:{transition:{onEntered:function(){var e=ce.current,t=null==e?void 0:e.querySelector('[data-highlight="true"]');t&&e&&!e.dataset.scrolled&&(t.scrollIntoView({behavior:"smooth",block:"center"}),e.dataset.scrolled="true")}}}},{children:[i(u,e({expandIcon:i(C,{}),style:B.accordionSummary},{children:i(g,e({style:B.heading},{children:"Copyrights & Marketing"}))})),i(p,e({style:B.accordionDetails},{children:Ne&&Object.keys(Ne).length>0?i(b,{data:Ne,highlightTerms:I,onHighlightMatch:we}):i("div",e({style:B.errorState},{children:"No Copyrights & Marketing data available."}))}))]}))})),i("div",e({ref:se},{children:r(h,e({elevation:0,style:B.accordion,expanded:Re,onChange:function(e,t){return qe(t)},slotProps:{transition:{onEntered:function(){var e=se.current,t=null==e?void 0:e.querySelector('[data-highlight="true"]');t&&e&&!e.dataset.scrolled&&(t.scrollIntoView({behavior:"smooth",block:"center"}),e.dataset.scrolled="true")}}}},{children:[i(u,e({expandIcon:i(C,{}),style:B.accordionSummary},{children:i(g,e({style:B.heading},{children:"People & Awards"}))})),i(p,e({style:B.accordionDetails},{children:We&&Object.keys(We).length>0?i(x,{data:We,highlightTerms:I,onHighlightMatch:De}):i("div",e({style:B.errorState},{children:"No People & Awards data available."}))}))]}))}))]}))})),L&&i(s,{style:{width:"3px",background:"#D1D5DC",cursor:"col-resize"}}),L&&i(c,e({order:2,minSize:30,maxSize:50,style:{overflow:"visible",position:"relative",transition:"all 300ms ease-in-out",WebkitTransition:"all 300ms ease-in-out"}},{children:i(k,{bookOverView:_e,bookCoverImage:Ge,onClose:Ke,clickableElementCategory:X,quotesToHighLightData:W,updateQuotesToHighLight:he,citationLoad:J,previewPage:Y,setPreviewPage:_,customStyle:z,comingSoonData:j,isNonHighlightedBlur:E,isBlurToggleVisible:M,isBookemon:T,noHtmlContent:ie})}))]}))})),F&&r("div",e({style:B.blurOverlay},{children:[i(m,e({style:B.closeButton,onClick:P,size:"large"},{children:i(w,{})})),i(D,{header:null==j?void 0:j.header,subheader:null==j?void 0:j.subheader,icon:null==j?void 0:j.icon})]}))]}))};export{F as BookemonContent};
1
+ import{__assign as e,__awaiter as t,__generator as o}from"tslib";import{jsxs as i,jsx as r}from"react/jsx-runtime";import{useState as n,useRef as l,useEffect as a}from"react";import{PanelGroup as d,Panel as c,PanelResizeHandle as s}from"react-resizable-panels";import h from"@mui/material/Accordion";import u from"@mui/material/AccordionSummary";import g from"@mui/material/Typography";import p from"@mui/material/AccordionDetails";import m from"@mui/material/IconButton";import f from"./BookDetailsCard/BookDetailsCard.js";import v from"./BookOverviewCard/BookOverviewCard.js";import b from"./BookElementsCard/BookElementsCard.js";import y from"./BookCopyrightsCard/BookCopyrightsCard.js";import x from"./BookPeopleAwardsCard/BookPeopleAwardsCard.js";import k from"./BookPreview/BookPreview.js";import C from"@mui/icons-material/ExpandMore";import w from"@mui/icons-material/Close";var B={dialogPaper:{maxWidth:"none",fontFamily:"Inter, sans-serif"},dialogHeight:{overflow:"hidden",height:"90vh",position:"relative"},dialogContent:{padding:0,backgroundColor:"#FFFFFF"},container:{display:"flex",height:"100%",width:"100%",alignItems:"flex-start"},leftPanel:{height:"100%",padding:"24px",overflowY:"auto",backgroundColor:"#F3F4F6",borderRadius:"12px",boxSizing:"border-box"},rightPanel:{width:"40%",backgroundColor:"#FFFFFF",height:"100%",display:"flex",flexDirection:"column",justifyContent:"flex-start",overflow:"auto",flex:1,boxSizing:"border-box",overflowY:"auto"},accordion:{borderRadius:"12px",boxShadow:"none",marginBottom:"24px"},accordionSummary:{paddingLeft:"16px",paddingRight:"16px"},accordionDetails:{paddingLeft:"16px",paddingRight:"16px",paddingBottom:"16px"},heading:{fontWeight:"bold",color:"#000000",fontSize:"16px"},blurOverlay:{position:"absolute",top:0,left:0,width:"100%",height:"100%",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)",backgroundColor:"rgba(255, 255, 255, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:10,borderRadius:"12px"},closeButton:{position:"absolute",top:"8px",right:"8px",color:"#111827"},resizeHandle:{width:"10px",backgroundColor:"#e5e7eb",cursor:"col-resize",display:"flex",alignItems:"center",justifyContent:"center"},iconContainer:{display:"flex",flexDirection:"column",gap:"4px"},dot:{width:"4px",height:"4px",backgroundColor:"#6b7280",borderRadius:"50%"},resizeHandleBar:{width:"2px",height:"24px",backgroundColor:"#666",borderRadius:"2px"}},S={wrapper:{alignItems:"center",justifyContent:"center",textAlign:"center"},inner:{width:"100%"},iconWrapper:{width:"80px",height:"80px",background:"linear-gradient(to right, #3B82F6, #9333EA)",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 24px auto"},icon:{width:"40px",height:"40px",color:"#FFFFFF"},heading:{fontSize:"36px",fontWeight:"bold",color:"#9333EA",marginBottom:"16px"},text:{fontSize:"18px",color:"#4B5563",lineHeight:1.6,textAlign:"center"},errorState:{color:"#CE3928",padding:"18px 0px",display:"flex",justifyContent:"center",width:"100%"}},D=function(t){var o=t.header,n=t.subheader,l=t.icon;return r("div",e({style:S.wrapper},{children:i("div",e({style:S.inner},{children:[r("div",e({style:{marginBottom:"32px"}},{children:r("div",e({style:S.iconWrapper},{children:l}))})),i("div",{children:[r("h1",e({style:S.heading},{children:o})),r("p",e({style:S.text},{children:n}))]})]}))}))},F=function(S){var F=S.showComingSoon,E=S.onClose,P=S.highlightTerms,I=S.data,T=S.customStyle,H=S.comingSoonData,z=S.isNonHighlightedBlur,j=S.isBlurToggleVisible,M=S.isBookemon,A=S.getHighlightContent,O=S.handleFetchManuscriptElements,L=S.isBookPreview,V=S.isDialog,R=S.defaultElementPages,q=S.citationType,W=S.citationSubTitle,N=n({textToHighLight:"",content:""}),_=N[0],Q=N[1],Y=n(1),G=Y[0],J=Y[1],K=n(!1),U=K[0],X=K[1],Z=n("Book Preview"),$=Z[0],ee=Z[1],te=n(70),oe=te[0],ie=te[1],re=l(null),ne=n(!1),le=ne[0],ae=ne[1],de=l(null),ce=l(null),se=l(null),he=l(null),ue=l(null),ge=function(e,i,r,n){return void 0===n&&(n=0),t(void 0,void 0,void 0,function(){var t,l,a,d,c,s,h,u,g,p,m,f,v,b,y,x;return o(this,function(o){switch(o.label){case 0:Q({textToHighLight:"",content:""}),ae(!1),X(!0),ee(i),o.label=1;case 1:return o.trys.push([1,5,6,7]),r&&0!==r.length?[4,null==A?void 0:A([r[n]])]:(X(!1),ie(70),null===(y=re.current)||void 0===y||y.resize(70),[2]);case 2:if(t=o.sent(),l=(null==t?void 0:t.data)||t||[],!Array.isArray(l)||0===l.length)return ae(!0),X(!1),[2];for(d=(a=function(e){return e?e.replace(/<[^>]*>/g," ").replace(/&nbsp;/g," ").replace(/[\u200B-\u200D\uFEFF]/g,"").replace(/[\u2018\u2019]/g,"'").replace(/[\u201C\u201D]/g,'"').replace(/[\u2013\u2014]/g,"-").replace(/[.,!?;:'"(){}\[\]—–…\/\\@#&*_|\^~%=+<>`]/g,"").replace(/\s+/g," ").trim().toLowerCase():""})(e),c=null,s=0,h=l;s<h.length;s++)if(f=h[s],a(f.normalizedContent||f.htmlContent).includes(d)){c=f;break}if(!c)for(u=d.split(" ").filter(Boolean);u.length>0;){for(g=u.join(" "),p=0,m=l;p<m.length;p++)if(f=m[p],a(f.normalizedContent||f.htmlContent).includes(g)){c=f;break}if(c)break;u.pop()}return v=l.map(function(e){return e.htmlContent}).join("\n"),Q({textToHighLight:c?c.htmlContent:"",content:v}),ie(50),null===(x=re.current)||void 0===x||x.resize(50),!c&&n+1<r.length?[4,ge(e,i,r,n+1)]:[3,4];case 3:return[2,o.sent()];case 4:return[2];case 5:return b=o.sent(),console.error("Highlight error:",b),ae(!0),[3,7];case 6:return X(!1),[7];case 7:return[2]}})})},pe=n(!1),me=pe[0],fe=pe[1],ve=n(!1),be=ve[0],ye=ve[1],xe=n(!1),ke=xe[0],Ce=xe[1],we=n(!1),Be=we[0],Se=we[1],De=n(!1),Fe=De[0],Ee=De[1],Pe=n(!1),Ie=Pe[0],Te=Pe[1],He=n(!1),ze=He[0],je=He[1],Me=n(!1),Ae=Me[0],Oe=Me[1],Le=n(!1),Ve=Le[0],Re=Le[1],qe=n(!1),We=qe[0],Ne=qe[1];a(function(){me&&Te(!0),be&&je(!0),ke&&Oe(!0),Be&&Re(!0),Fe&&Ne(!0)},[me,be,ke,Be,Fe]);var _e=I.bookAwards,Qe=I.bookCopyRight,Ye=I.bookDetails,Ge=I.bookElements,Je=I.bookOverView,Ke=I.bookCoverImage,Ue=null==Ye?void 0:Ye.isbn,Xe=null!=E?E:function(){},Ze=void 0!==W&&!!W.length&&["notable_quotes","location_details","notable_characters"].includes(W);return i("div",e({style:e(e({},B.dialogContent),V?B.dialogHeight:{})},{children:[!F&&r("div",e({style:B.container},{children:i(d,e({direction:"horizontal"},{children:[r(c,e({order:1,ref:re,defaultSize:oe||70},{children:i("div",e({style:e(e({},null==B?void 0:B.leftPanel),null==T?void 0:T.leftPanel)},{children:[r("div",e({ref:de,style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:i(h,e({expanded:Ie,onChange:function(e,t){return Te(t)},slotProps:{transition:{onEntered:function(){var e=de.current,t=null==e?void 0:e.querySelector('[data-highlight="true"]');t&&e&&!e.dataset.scrolled&&(t.scrollIntoView({behavior:"smooth",block:"center"}),e.dataset.scrolled="true")}}},elevation:0,style:B.accordion},{children:[r(u,e({expandIcon:r(C,{}),style:B.accordionSummary},{children:r(g,e({style:B.heading},{children:"Book Overview"}))})),r(p,e({style:B.accordionDetails},{children:Je&&Object.keys(Je).length>0?r(v,{data:Je,highlightTerms:P,onHighlightMatch:fe,highlightEnabled:!Ze}):r("div",e({style:B.errorState},{children:"No overview data available."}))}))]}))})),r("div",e({ref:ce,style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:i(h,e({elevation:0,style:B.accordion,expanded:ze,onChange:function(e,t){return je(t)},slotProps:{transition:{onEntered:function(){var e=ce.current;if(e){var t=e.querySelector('[data-highlight="true"]');if(t){t.scrollIntoView({behavior:"smooth",block:"center"});var o=new MutationObserver(function(){var t=e.querySelector('[data-highlight="true"]');t&&t.scrollIntoView({behavior:"auto",block:"center"}),o.disconnect()});o.observe(e,{childList:!0,subtree:!0})}}}}}},{children:[r(u,e({expandIcon:r(C,{}),style:B.accordionSummary},{children:r(g,e({style:B.heading},{children:"Book Manuscript Elements"}))})),r(p,e({style:B.accordionDetails},{children:r(b,{data:Ge,title:(null==Je?void 0:Je.title)||"",handleFetchManuscriptElements:O,BookIsbn:Ue,updateQuotesToHighLight:ge,highlightTerms:P,onHighlightMatch:ye,defaultPages:R,citationType:q,citationSubTitle:W,highlightEnabled:Ze})}))]}))})),r("div",e({ref:se,style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:i(h,e({expanded:Ae,onChange:function(e,t){return Oe(t)},elevation:0,style:B.accordion,slotProps:{transition:{onEntered:function(){var e=se.current,t=null==e?void 0:e.querySelector('[data-highlight="true"]');t&&e&&!e.dataset.scrolled&&(t.scrollIntoView({behavior:"smooth",block:"center"}),e.dataset.scrolled="true")}}}},{children:[r(u,e({expandIcon:r(C,{}),style:B.accordionSummary},{children:r(g,e({style:B.heading},{children:"Book Metadata Details"}))})),r(p,e({style:B.accordionDetails},{children:Ye&&Object.keys(Ye).length>0?r(f,{data:Ye,highlightTerms:P,onHighlightMatch:Ce,highlightEnabled:!Ze,citationType:q,citationSubTitle:W}):r("div",e({style:B.errorState},{children:"No Book Metadata data available."}))}))]}))})),r("div",e({ref:he,style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:i(h,e({elevation:0,style:B.accordion,expanded:Ve,onChange:function(e,t){return Re(t)},slotProps:{transition:{onEntered:function(){var e=he.current,t=null==e?void 0:e.querySelector('[data-highlight="true"]');t&&e&&!e.dataset.scrolled&&(t.scrollIntoView({behavior:"smooth",block:"center"}),e.dataset.scrolled="true")}}}},{children:[r(u,e({expandIcon:r(C,{}),style:B.accordionSummary},{children:r(g,e({style:B.heading},{children:"Copyrights & Marketing"}))})),r(p,e({style:B.accordionDetails},{children:Qe&&Object.keys(Qe).length>0?r(y,{data:Qe,highlightTerms:P,onHighlightMatch:Se,highlightEnabled:!Ze}):r("div",e({style:B.errorState},{children:"No Copyrights & Marketing data available."}))}))]}))})),r("div",e({ref:ue},{children:i(h,e({elevation:0,style:B.accordion,expanded:We,onChange:function(e,t){return Ne(t)},slotProps:{transition:{onEntered:function(){var e=ue.current,t=null==e?void 0:e.querySelector('[data-highlight="true"]');t&&e&&!e.dataset.scrolled&&(t.scrollIntoView({behavior:"smooth",block:"center"}),e.dataset.scrolled="true")}}}},{children:[r(u,e({expandIcon:r(C,{}),style:B.accordionSummary},{children:r(g,e({style:B.heading},{children:"People & Awards"}))})),r(p,e({style:B.accordionDetails},{children:_e&&Object.keys(_e).length>0?r(x,{data:_e,highlightTerms:P,onHighlightMatch:Ee,highlightEnabled:!Ze}):r("div",e({style:B.errorState},{children:"No People & Awards data available."}))}))]}))}))]}))})),L&&r(s,{style:{width:"3px",background:"#D1D5DC",cursor:"col-resize"}}),L&&r(c,e({order:2,minSize:30,maxSize:50,style:{overflow:"visible",position:"relative",transition:"all 300ms ease-in-out",WebkitTransition:"all 300ms ease-in-out"}},{children:r(k,{bookOverView:Je,bookCoverImage:Ke,onClose:Xe,clickableElementCategory:$,quotesToHighLightData:_,updateQuotesToHighLight:ge,citationLoad:U,previewPage:G,setPreviewPage:J,customStyle:T,comingSoonData:H,isNonHighlightedBlur:z,isBlurToggleVisible:j,isBookemon:M,noHtmlContent:le})}))]}))})),F&&i("div",e({style:B.blurOverlay},{children:[r(m,e({style:B.closeButton,onClick:E,size:"large"},{children:r(w,{})})),r(D,{header:null==H?void 0:H.header,subheader:null==H?void 0:H.subheader,icon:null==H?void 0:H.icon})]}))]}))};export{F as BookemonContent};
2
2
  //# sourceMappingURL=BookemonContent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BookemonTest.d.ts","sourceRoot":"","sources":["../../../src/BookemonTest.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgYd,CAAA;AAGH,eAAO,MAAM,mBAAmB,aAAmB,MAAM,EAAE,iBA2B1D,CAAC;AAGF,eAAO,MAAM,kBAAkB;cAAmE,GAAG;UAAS,GAAG;cAAa,GAAG;UAAS,GAAG;WAAW,MAAM;kBAW7J,CAAC;AAGF,eAAO,MAAM,6BAA6B;cAAkE,GAAG;UAAS,GAAG;cAAW,GAAG;UAAQ,GAAG;WAAU,MAAM;kBASjK,CAAC;AAEJ,eAAO,MAAM,cAAc,UAAU,CAAA;AAErC,QAAA,MAAM,YAAY,+CAwHjB,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"BookemonTest.d.ts","sourceRoot":"","sources":["../../../src/BookemonTest.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgYd,CAAA;AAGH,eAAO,MAAM,mBAAmB,aAAmB,MAAM,EAAE,iBA2B1D,CAAC;AAGF,eAAO,MAAM,kBAAkB;cAAmE,GAAG;UAAS,GAAG;cAAa,GAAG;UAAS,GAAG;WAAW,MAAM;kBAW7J,CAAC;AAGF,eAAO,MAAM,6BAA6B;cAAkE,GAAG;UAAS,GAAG;cAAW,GAAG;UAAQ,GAAG;WAAU,MAAM;kBASjK,CAAC;AAEJ,eAAO,MAAM,cAAc,UAAmB,CAAA;AAE9C,QAAA,MAAM,YAAY,+CAkIjB,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -14,7 +14,8 @@ interface BookCopyrightsCardProps {
14
14
  data: IBookCopyrightsData;
15
15
  highlightTerms?: string[];
16
16
  onHighlightMatch?: (matched: boolean) => void;
17
+ highlightEnabled: boolean;
17
18
  }
18
- declare const BookCopyrightsCard: ({ data, highlightTerms, onHighlightMatch }: BookCopyrightsCardProps) => import("react/jsx-runtime").JSX.Element;
19
+ declare const BookCopyrightsCard: ({ data, highlightTerms, onHighlightMatch, highlightEnabled }: BookCopyrightsCardProps) => import("react/jsx-runtime").JSX.Element;
19
20
  export default BookCopyrightsCard;
20
21
  //# sourceMappingURL=BookCopyrightsCard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BookCopyrightsCard.d.ts","sourceRoot":"","sources":["../../../../../../src/features/Bookemon/BookCopyrightsCard/BookCopyrightsCard.tsx"],"names":[],"mappings":"AAkBA,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,YAAY;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,UAAU,CAAC;IACtB,WAAW,EAAE,YAAY,CAAC;CAC3B;AAED,UAAU,uBAAuB;IAC/B,IAAI,EAAE,mBAAmB,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;CAC/C;AAED,QAAA,MAAM,kBAAkB,+CAAgD,uBAAuB,4CAkE9F,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"BookCopyrightsCard.d.ts","sourceRoot":"","sources":["../../../../../../src/features/Bookemon/BookCopyrightsCard/BookCopyrightsCard.tsx"],"names":[],"mappings":"AAkBA,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,YAAY;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,UAAU,CAAC;IACtB,WAAW,EAAE,YAAY,CAAC;CAC3B;AAED,UAAU,uBAAuB;IAC/B,IAAI,EAAE,mBAAmB,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC9C,gBAAgB,EAAE,OAAO,CAAA;CAC1B;AAED,QAAA,MAAM,kBAAkB,iEAAkE,uBAAuB,4CAkEhH,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -1,10 +1,13 @@
1
- import { IBookDetails } from "../types/citation.types";
1
+ import { BookemonProps, IBookDetails } from "../types/citation.types";
2
2
  import "./BookDetailsCard.css";
3
3
  type BookDetailsCardProps = {
4
4
  data: IBookDetails;
5
5
  highlightTerms?: string[];
6
6
  onHighlightMatch?: (matched: boolean) => void;
7
+ highlightEnabled: boolean;
8
+ citationType?: BookemonProps['citationType'];
9
+ citationSubTitle?: BookemonProps['citationSubTitle'];
7
10
  };
8
- declare const BookDetailsCard: ({ data, highlightTerms, onHighlightMatch }: BookDetailsCardProps) => import("react/jsx-runtime").JSX.Element;
11
+ declare const BookDetailsCard: ({ data, highlightTerms, onHighlightMatch, highlightEnabled, citationType, citationSubTitle }: BookDetailsCardProps) => import("react/jsx-runtime").JSX.Element;
9
12
  export default BookDetailsCard;
10
13
  //# sourceMappingURL=BookDetailsCard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BookDetailsCard.d.ts","sourceRoot":"","sources":["../../../../../../src/features/Bookemon/BookDetailsCard/BookDetailsCard.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,uBAAuB,CAAC;AAmF/B,KAAK,oBAAoB,GAAG;IAC1B,IAAI,EAAE,YAAY,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;CAC/C,CAAC;AACF,QAAA,MAAM,eAAe,+CAAgD,oBAAoB,4CAiMxF,CAAC;AAEF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"BookDetailsCard.d.ts","sourceRoot":"","sources":["../../../../../../src/features/Bookemon/BookDetailsCard/BookDetailsCard.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,uBAAuB,CAAC;AAmF/B,KAAK,oBAAoB,GAAG;IAC1B,IAAI,EAAE,YAAY,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC9C,gBAAgB,EAAE,OAAO,CAAA;IACzB,YAAY,CAAC,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC;IAC7C,gBAAgB,CAAC,EAAE,aAAa,CAAC,kBAAkB,CAAC,CAAC;CACtD,CAAC;AACF,QAAA,MAAM,eAAe,iGAAkG,oBAAoB,4CAmM1I,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import "./BookElementsCard.css";
2
+ import { BookemonProps } from '../types/citation.types';
2
3
  export interface IQuote {
3
4
  text: string;
4
5
  chapter: string;
@@ -42,7 +43,10 @@ interface BookElementsCardProps {
42
43
  locations?: number;
43
44
  characters?: number;
44
45
  };
46
+ citationType: BookemonProps['citationType'];
47
+ citationSubTitle: BookemonProps['citationSubTitle'];
48
+ highlightEnabled: boolean;
45
49
  }
46
- declare const BookElementsCard: ({ data, updateQuotesToHighLight, handleFetchManuscriptElements, BookIsbn, title, highlightTerms, onHighlightMatch, defaultPages }: BookElementsCardProps) => import("react/jsx-runtime").JSX.Element;
50
+ declare const BookElementsCard: ({ data, updateQuotesToHighLight, handleFetchManuscriptElements, BookIsbn, title, highlightTerms, onHighlightMatch, defaultPages, citationType, citationSubTitle, highlightEnabled }: BookElementsCardProps) => import("react/jsx-runtime").JSX.Element;
47
51
  export default BookElementsCard;
48
52
  //# sourceMappingURL=BookElementsCard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BookElementsCard.d.ts","sourceRoot":"","sources":["../../../../../../src/features/Bookemon/BookElementsCard/BookElementsCard.tsx"],"names":[],"mappings":"AASA,OAAO,wBAAwB,CAAC;AA0IhC,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAG,MAAM,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAG,MAAM,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAG,MAAM,EAAE,CAAC;IACpB,IAAI,EAAG,MAAM,CAAA;CACd;AAED,MAAM,WAAW,iBAAiB;IAChC,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,YAAY,EAAE,eAAe,EAAE,CAAC;IAChC,UAAU,EAAE,UAAU,EAAE,CAAC;CAC1B;AAED,UAAU,qBAAqB;IAC7B,IAAI,EAAE,iBAAiB,CAAC;IACxB,uBAAuB,EAAE,CAAC,eAAe,EAAE,MAAM,EAAC,OAAO,EAAC,MAAM,EAAE,QAAQ,EAAC,MAAM,EAAE,EAAE,YAAY,EAAG,MAAM,KAAK,IAAI,CAAC;IACnH,6BAA6B,EAAE,CAAC,EAC/B,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,KAAK,EACN,EAAE;QACD,QAAQ,EAAE,GAAG,CAAC;QACd,IAAI,EAAE,GAAG,CAAC;QACV,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,GAAG,CAAC;QACV,KAAK,EAAG,MAAM,CAAA;KACf,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;IACnB,QAAQ,EAAG,MAAM,CAAC;IAClB,KAAK,EAAG,MAAM,CAAA;IACd,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC9C,YAAY,CAAC,EAAE;QACb,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;CACH;AAED,QAAA,MAAM,gBAAgB,sIASnB,qBAAqB,4CA6iBvB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"BookElementsCard.d.ts","sourceRoot":"","sources":["../../../../../../src/features/Bookemon/BookElementsCard/BookElementsCard.tsx"],"names":[],"mappings":"AASA,OAAO,wBAAwB,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AA0IxD,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAG,MAAM,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAG,MAAM,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAG,MAAM,EAAE,CAAC;IACpB,IAAI,EAAG,MAAM,CAAA;CACd;AAED,MAAM,WAAW,iBAAiB;IAChC,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,YAAY,EAAE,eAAe,EAAE,CAAC;IAChC,UAAU,EAAE,UAAU,EAAE,CAAC;CAC1B;AAED,UAAU,qBAAqB;IAC7B,IAAI,EAAE,iBAAiB,CAAC;IACxB,uBAAuB,EAAE,CAAC,eAAe,EAAE,MAAM,EAAC,OAAO,EAAC,MAAM,EAAE,QAAQ,EAAC,MAAM,EAAE,EAAE,YAAY,EAAG,MAAM,KAAK,IAAI,CAAC;IACnH,6BAA6B,EAAE,CAAC,EAC/B,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,KAAK,EACN,EAAE;QACD,QAAQ,EAAE,GAAG,CAAC;QACd,IAAI,EAAE,GAAG,CAAC;QACV,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,GAAG,CAAC;QACV,KAAK,EAAG,MAAM,CAAA;KACf,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;IACnB,QAAQ,EAAG,MAAM,CAAC;IAClB,KAAK,EAAG,MAAM,CAAA;IACd,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC9C,YAAY,CAAC,EAAE;QACb,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;IACF,YAAY,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC;IAC5C,gBAAgB,EAAE,aAAa,CAAC,kBAAkB,CAAC,CAAC;IACpD,gBAAgB,EAAE,OAAO,CAAA;CAC1B;AAED,QAAA,MAAM,gBAAgB,wLAYnB,qBAAqB,4CAijBvB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -13,7 +13,8 @@ interface BookOverviewCardProps {
13
13
  data: IBookOverview;
14
14
  highlightTerms?: string[];
15
15
  onHighlightMatch?: (matched: boolean) => void;
16
+ highlightEnabled?: boolean;
16
17
  }
17
- declare const BookOverviewCard: ({ data, highlightTerms, onHighlightMatch }: BookOverviewCardProps) => import("react/jsx-runtime").JSX.Element;
18
+ declare const BookOverviewCard: ({ data, highlightTerms, onHighlightMatch, highlightEnabled }: BookOverviewCardProps) => import("react/jsx-runtime").JSX.Element;
18
19
  export default BookOverviewCard;
19
20
  //# sourceMappingURL=BookOverviewCard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BookOverviewCard.d.ts","sourceRoot":"","sources":["../../../../../../src/features/Bookemon/BookOverviewCard/BookOverviewCard.tsx"],"names":[],"mappings":"AAMA,OAAO,wBAAwB,CAAC;AAwIhC,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAG,MAAM,CAAC;IAChB,iBAAiB,EAAG,MAAM,CAAC;IAC3B,eAAe,EAAG,MAAM,CAAC;IACzB,cAAc,EAAG,GAAG,EAAE,CAAA;CACvB;AAED,UAAU,qBAAqB;IAC7B,IAAI,EAAE,aAAa,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;CAC/C;AAED,QAAA,MAAM,gBAAgB,+CAAgD,qBAAqB,4CAqP1F,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"BookOverviewCard.d.ts","sourceRoot":"","sources":["../../../../../../src/features/Bookemon/BookOverviewCard/BookOverviewCard.tsx"],"names":[],"mappings":"AAMA,OAAO,wBAAwB,CAAC;AAyIhC,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAG,MAAM,CAAC;IAChB,iBAAiB,EAAG,MAAM,CAAC;IAC3B,eAAe,EAAG,MAAM,CAAC;IACzB,cAAc,EAAG,GAAG,EAAE,CAAA;CACvB;AAED,UAAU,qBAAqB;IAC7B,IAAI,EAAE,aAAa,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC9C,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B;AAED,QAAA,MAAM,gBAAgB,iEAAkE,qBAAqB,4CAsP5G,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -28,7 +28,8 @@ interface BookPeopleAwardsCardProps {
28
28
  data: IBookPeopleAwardsData;
29
29
  highlightTerms?: string[];
30
30
  onHighlightMatch?: (matched: boolean) => void;
31
+ highlightEnabled: boolean;
31
32
  }
32
- declare const BookPeopleAwardsCard: ({ data, highlightTerms, onHighlightMatch }: BookPeopleAwardsCardProps) => import("react/jsx-runtime").JSX.Element;
33
+ declare const BookPeopleAwardsCard: ({ data, highlightTerms, onHighlightMatch, highlightEnabled }: BookPeopleAwardsCardProps) => import("react/jsx-runtime").JSX.Element;
33
34
  export default BookPeopleAwardsCard;
34
35
  //# sourceMappingURL=BookPeopleAwardsCard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BookPeopleAwardsCard.d.ts","sourceRoot":"","sources":["../../../../../../src/features/Bookemon/BookPeopleAwardsCard/BookPeopleAwardsCard.tsx"],"names":[],"mappings":"AAGA,OAAO,4BAA4B,CAAA;AAwGnC,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAG,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,UAAU,CAAC;IACtB,YAAY,EAAE;QACZ,OAAO,EAAE,YAAY,EAAE,CAAC;QACxB,UAAU,CAAC,EAAE,YAAY,EAAE,CAAC;KAC7B,CAAC;IACF,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,UAAU,yBAAyB;IACjC,IAAI,EAAE,qBAAqB,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;CAC/C;AAED,QAAA,MAAM,oBAAoB,+CAAgD,yBAAyB,4CA2LlG,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
1
+ {"version":3,"file":"BookPeopleAwardsCard.d.ts","sourceRoot":"","sources":["../../../../../../src/features/Bookemon/BookPeopleAwardsCard/BookPeopleAwardsCard.tsx"],"names":[],"mappings":"AAGA,OAAO,4BAA4B,CAAA;AAwGnC,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAG,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,UAAU,CAAC;IACtB,YAAY,EAAE;QACZ,OAAO,EAAE,YAAY,EAAE,CAAC;QACxB,UAAU,CAAC,EAAE,YAAY,EAAE,CAAC;KAC7B,CAAC;IACF,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,UAAU,yBAAyB;IACjC,IAAI,EAAE,qBAAqB,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC9C,gBAAgB,EAAE,OAAO,CAAA;CAC1B;AAED,QAAA,MAAM,oBAAoB,iEAAkE,yBAAyB,4CA2LpH,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
@@ -4,6 +4,6 @@ export declare const comingSoonStyles: {
4
4
  [key: string]: CSSProperties;
5
5
  };
6
6
  export declare const defaultIcon: import("react/jsx-runtime").JSX.Element;
7
- declare const Bookemon: ({ open, onClose, isDialog, isBookPreview, isNonHighlightedBlur, isBookemon, getHighlightContent, handleFetchManuscriptElements, data, showComingSoon, comingSoonData, customStyle, isBlurToggleVisible, highlightTerms, defaultElementPages }: BookemonProps) => import("react/jsx-runtime").JSX.Element;
7
+ declare const Bookemon: ({ open, onClose, isDialog, isBookPreview, isNonHighlightedBlur, isBookemon, getHighlightContent, handleFetchManuscriptElements, data, showComingSoon, comingSoonData, customStyle, isBlurToggleVisible, highlightTerms, defaultElementPages, citationType, citationSubTitle }: BookemonProps) => import("react/jsx-runtime").JSX.Element;
8
8
  export default Bookemon;
9
9
  //# sourceMappingURL=Bookemon.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Bookemon.d.ts","sourceRoot":"","sources":["../../../../../src/features/Bookemon/Bookemon.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAa7C,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAWvD,eAAO,MAAM,gBAAgB,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAAA;CA4C5D,CAAC;AACF,eAAO,MAAM,WAAW,yCAcvB,CAAC;AAUF,QAAA,MAAM,QAAQ,kPAoBX,aAAa,4CAsMf,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"Bookemon.d.ts","sourceRoot":"","sources":["../../../../../src/features/Bookemon/Bookemon.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAa7C,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAWvD,eAAO,MAAM,gBAAgB,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAAA;CA4C5D,CAAC;AACF,eAAO,MAAM,WAAW,yCAcvB,CAAC;AAUF,QAAA,MAAM,QAAQ,kRAsBX,aAAa,4CAwMf,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -1,3 +1,3 @@
1
1
  import { BookemonProps } from "./types/citation.types";
2
- export declare const BookemonContent: ({ showComingSoon, onClose, highlightTerms, data, customStyle, comingSoonData, isNonHighlightedBlur, isBlurToggleVisible, isBookemon, getHighlightContent, handleFetchManuscriptElements, isBookPreview, isDialog, defaultElementPages }: BookemonProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const BookemonContent: ({ showComingSoon, onClose, highlightTerms, data, customStyle, comingSoonData, isNonHighlightedBlur, isBlurToggleVisible, isBookemon, getHighlightContent, handleFetchManuscriptElements, isBookPreview, isDialog, defaultElementPages, citationType, citationSubTitle }: BookemonProps) => import("react/jsx-runtime").JSX.Element;
3
3
  //# sourceMappingURL=BookemonContent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BookemonContent.d.ts","sourceRoot":"","sources":["../../../../../src/features/Bookemon/BookemonContent.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AA0LvD,eAAO,MAAM,eAAe,4OAevB,aAAa,4CAwgBf,CAAC"}
1
+ {"version":3,"file":"BookemonContent.d.ts","sourceRoot":"","sources":["../../../../../src/features/Bookemon/BookemonContent.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AA0LvD,eAAO,MAAM,eAAe,4QAiBvB,aAAa,4CAmhBf,CAAC"}
@@ -59,5 +59,7 @@ export interface BookemonProps {
59
59
  locations?: number;
60
60
  characters?: number;
61
61
  };
62
+ citationType?: string;
63
+ citationSubTitle?: "book_summary" | "genre_details" | "book_marketing_collateral" | "contributor_biography_details" | "audience_details" | "prize_details" | "location_details" | "notable_characters" | "notable_quotes" | "section_details" | "contributor_details" | "publisher_details" | "book_stats" | "copyright_details" | "supporting_excerpts";
62
64
  }
63
65
  //# sourceMappingURL=citation.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"citation.types.d.ts","sourceRoot":"","sources":["../../../../../../src/features/Bookemon/types/citation.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,cAAc,EAAE,MAAM,CAAA;CACvB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,UAAU,EAAE,OAAO,CAAC;IACpB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAE9B,mBAAmB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;IAC3D,6BAA6B,EAAE,CAAC,IAAI,EAAE;QACpC,QAAQ,EAAE,GAAG,CAAC;QACd,IAAI,EAAE,GAAG,CAAC;QACV,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,GAAG,CAAC;QACV,KAAK,EAAE,MAAM,CAAC;KACf,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;IAEnB,IAAI,EAAE,GAAG,CAAC;IACV,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;KACxB,CAAC;IACF,WAAW,CAAC,EAAE;QACZ,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,SAAS,CAAC,EAAE,aAAa,CAAC;QAC1B,UAAU,CAAC,EAAE,aAAa,CAAC;QAC3B,mBAAmB,CAAC,EAAE;YACpB,qBAAqB,CAAC,EAAE,aAAa,CAAC;YACtC,KAAK,CAAC,EAAE,aAAa,CAAC;YACtB,cAAc,CAAC,EAAE,aAAa,CAAC;YAC/B,iBAAiB,CAAC,EAAE,aAAa,CAAC;YAClC,UAAU,CAAC,EAAE,aAAa,CAAC;YAC3B,QAAQ,CAAC,EAAE,aAAa,CAAC;YACzB,SAAS,CAAC,EAAE,aAAa,CAAC;YAC1B,eAAe,CAAC,EAAE,aAAa,CAAC;YAChC,eAAe,CAAC,EAAE,aAAa,CAAC;YAChC,mBAAmB,CAAC,EAAE,aAAa,CAAC;YACpC,eAAe,CAAC,EAAE,aAAa,CAAC;YAChC,oBAAoB,CAAC,EAAE,aAAa,CAAC;YACrC,eAAe,CAAC,EAAE,aAAa,CAAC;SACjC,CAAC;KACH,CAAC;IACF,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,mBAAmB,CAAC,EAAE;QACpB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;CACH"}
1
+ {"version":3,"file":"citation.types.d.ts","sourceRoot":"","sources":["../../../../../../src/features/Bookemon/types/citation.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,MAAM,WAAW,YAAY;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,aAAa;IAC1B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,UAAU,EAAE,OAAO,CAAC;IACpB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAE9B,mBAAmB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;IAC3D,6BAA6B,EAAE,CAAC,IAAI,EAAE;QAClC,QAAQ,EAAE,GAAG,CAAC;QACd,IAAI,EAAE,GAAG,CAAC;QACV,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,GAAG,CAAC;QACV,KAAK,EAAE,MAAM,CAAC;KACjB,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;IAEnB,IAAI,EAAE,GAAG,CAAC;IACV,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE;QACb,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;KAC1B,CAAC;IACF,WAAW,CAAC,EAAE;QACV,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,SAAS,CAAC,EAAE,aAAa,CAAC;QAC1B,UAAU,CAAC,EAAE,aAAa,CAAC;QAC3B,mBAAmB,CAAC,EAAE;YAClB,qBAAqB,CAAC,EAAE,aAAa,CAAC;YACtC,KAAK,CAAC,EAAE,aAAa,CAAC;YACtB,cAAc,CAAC,EAAE,aAAa,CAAC;YAC/B,iBAAiB,CAAC,EAAE,aAAa,CAAC;YAClC,UAAU,CAAC,EAAE,aAAa,CAAC;YAC3B,QAAQ,CAAC,EAAE,aAAa,CAAC;YACzB,SAAS,CAAC,EAAE,aAAa,CAAC;YAC1B,eAAe,CAAC,EAAE,aAAa,CAAC;YAChC,eAAe,CAAC,EAAE,aAAa,CAAC;YAChC,mBAAmB,CAAC,EAAE,aAAa,CAAC;YACpC,eAAe,CAAC,EAAE,aAAa,CAAC;YAChC,oBAAoB,CAAC,EAAE,aAAa,CAAC;YACrC,eAAe,CAAC,EAAE,aAAa,CAAC;SACnC,CAAC;KACL,CAAC;IACF,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,mBAAmB,CAAC,EAAE;QAClB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,UAAU,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;IACF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EACX,cAAc,GACd,eAAe,GACf,2BAA2B,GAC3B,+BAA+B,GAC/B,kBAAkB,GAClB,eAAe,GACf,kBAAkB,GAClB,oBAAoB,GACpB,gBAAgB,GAChB,iBAAiB,GACjB,qBAAqB,GACrB,mBAAmB,GACnB,YAAY,GACZ,mBAAmB,GACnB,qBAAqB,CAAC;CAC/B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-llm-studio/citation",
3
- "version": "0.0.140",
3
+ "version": "0.0.141",
4
4
  "author": "Devesh Patel",
5
5
  "description": "",
6
6
  "license": "MIT",