@e-llm-studio/citation 0.0.83 → 0.0.85

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../node_modules/tslib/tslib.es6.mjs.js"),a=require("react/jsx-runtime"),t=require("react"),n=require("./BookCitation.module.css.js"),i=require("./text-cleaner.js");exports.default=function(s){var o=s.title,c=s.author,r=s.paragraphs,l=s.chevronUpComponent,d=s.chevronDownComponent,u=s.externalLinkComponent,f=s.textToHighlight,h=s.pageNumber,v=s.totalPageNumber,m=void 0===v?null:v,p=s.citationTitle;s.customStyle;var g=s.handleExternalLinkClick,x=s.bookCoverImage,_=s.partialMatch,j=void 0!==_&&_,N=s.citationNumber,b=void 0===N?1:N,C=s.defaultState,k=void 0!==C&&C,E=s.isNonHighlightedBlur,y=void 0!==E&&E,L=s.toggleBlur,T=void 0===L?y:L,q=s.fixedWidth,A=void 0===q||q,I=s.isBookemon,w=void 0!==I&&I,B=t.useState(k),M=B[0],W=B[1],H=["address","article","aside","blockquote","canvas","dd","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","li","main","nav","noscript","ol","p","pre","section","table","tfoot","ul","video"];t.useEffect((function(){if(M){var e=document.getElementById("quotes-citations-".concat(null!=b?b:""));e&&e.scrollIntoView({behavior:"smooth",block:"center"})}}),[M,f,b]);var S=function(e){void 0===e&&(e="");var a=document.createElement("div");a.innerHTML=e;var t=a.textContent||a.innerText||"";return(t=(t=t.replace(/<\/?[^>]+(>|$)/g,"")).replace(/\s+/g," ")).trim()};function O(e){var a=document.createElement("div");a.innerHTML=e;var t=n.default.highlighted,i=function(e,a){var s,o;if(void 0===a&&(a=!1),e.nodeType===Node.TEXT_NODE){if(!a&&(null===(s=e.textContent)||void 0===s?void 0:s.trim())){var c=document.createElement("span");c.classList.add(n.default.blurred),c.textContent=e.textContent,null===(o=e.parentNode)||void 0===o||o.replaceChild(c,e)}}else if(e.nodeType===Node.ELEMENT_NODE){var r=e,l=r.classList.contains(t);Array.from(r.childNodes).forEach((function(e){return i(e,a||l)}))}};return Array.from(a.childNodes).forEach((function(e){return i(e)})),a.innerHTML}function $(e,a,t,i,s,o){void 0===s&&(s=[]),void 0===o&&(o=!1);var c,r=n.default.highlighted,l=n.default.highlightedInline,d=n.default.highlightedBlock,u="".concat(r," ").concat(l),f="".concat(r," ").concat(d),h=a,v=(c=document.createElement("textarea"),function(e){return c.innerHTML=e,c.value});if(s.length>0){if(o){return s.forEach((function(e){e&&(h=function(e,a,t){for(var n='<span id="'.concat(t,'" class="').concat(u,'">'),i="</span>",s=e,o=0,c=new RegExp("(<(?:".concat(H.join("|"),")[^>]*>.*?)(?=<(?:").concat(H.join("|"),")|$)"),"gi"),r=(a.match(c)||[a]).map((function(e){var a=e.match(/^<([a-zA-Z0-9]+)([^>]*)>/);if(a&&H.includes(a[1].toLowerCase())){var t=a[0].length;return a[0]+n+e.slice(t)+i}return n+e+i})).join("");;){var l=s.indexOf(a,o);if(-1===l)break;s=s.slice(0,l)+r+s.slice(l+a.length),o=l+r.length}var f=d;return s.replace(/<span([^>]*)>([\s\S]*?)<\/span>/gi,(function(e,a,t){if(H.some((function(e){return new RegExp("<".concat(e,"\\b[^>]*>"),"i").test(t)}))){var n=a.match(/\sclass\s*=\s*(['"])(.*?)\1/);if(n){var i=n[2],s=i.split(/\s+/).includes(f)?i:"".concat(i," ").concat(f);a=a.replace(n[0],' class="'.concat(s,'"'))}else a+=' class="'.concat(f,'"')}return"<span".concat(a,">").concat(t,"</span>")}))}(h,e,"Annotation"===t?"quotes-annotations-".concat(null!=i?i:""):"quotes-citations-".concat(null!=i?i:"")))})),y&&T?O(h):h}return s.forEach((function(e){var n=v(e).trim();if(n&&v(a).trim().toLowerCase()===n.toLowerCase()){var s="Annotation"===t?"quotes-annotations-".concat(null!=i?i:""):"quotes-citations-".concat(null!=i?i:"");h='<span id="'.concat(s,'" class="').concat(f,'">').concat(a,"</span>")}})),y&&T?O(h):h}var m=f;if(!e||!a)return"Annotation"===t?a:'<span id="quotes-citations" class="'.concat(m,'">').concat(a,"</span>");var p=Array.from(e.matchAll(/`([^`]+)`/g));if(0===p.length)return"Annotation"===t?a:'<span id="quotes-citations" class="'.concat(m,'">').concat(a,"</span>");h=a;var g=!1;return p.forEach((function(e){var a=v(e[1]).trim();if(a){var n=a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),i=new RegExp("(".concat(n,")"),"gi");h.match(i)&&(g=!0,h=h.replace(i,'<span id="'.concat("Annotation"===t?"quotes-annotations":"quotes-citations",'" class="').concat(m,'">$1</span>')))}})),g?h:"Annotation"===t?a:'<span id="quotes-citations" class="'.concat(m,'">').concat(a,"</span>")}return a.jsx(a.Fragment,{children:a.jsxs("span",e.__assign({className:"".concat(n.default.relativeWrapper," ").concat(w?n.default.height95percent+" "+n.default.displayFlex:n.default.height100percent)},{children:[!k&&a.jsx("div",e.__assign({className:n.default.citationButtonWrapper},{children:a.jsxs("div",e.__assign({onClick:function(){return W((function(e){return!e}))},className:n.default.citationButton},{children:[a.jsx("span",e.__assign({className:n.default.citationText},{children:p})),M?l:d]}))})),M&&a.jsx("div",e.__assign({className:n.default.expandedWrapper},{children:a.jsx("div",e.__assign({className:"".concat(n.default.expandableContainer," ").concat(A?n.default.expandableContainerWidth:"")},{children:a.jsx("div",e.__assign({className:n.default.expandableContent},{children:a.jsxs("div",e.__assign({className:n.default.bookBodyContent},{children:[!k&&a.jsx("div",e.__assign({className:n.default.header},{children:a.jsxs("div",e.__assign({className:n.default.bookInfo},{children:[x&&a.jsx("div",e.__assign({className:n.default.bookImageWrapper},{children:a.jsx("img",{src:x,alt:o||"Book cover",className:n.default.bookImage})})),a.jsxs("div",e.__assign({className:n.default.bookTextInfo},{children:[a.jsx("h1",e.__assign({className:n.default.bookTitle},{children:o})),c||Array.isArray(c)&&a.jsxs("p",e.__assign({className:n.default.bookAuthor},{children:["by"," ",Array.isArray(c)?c.join(", "):c||""]}))]})),a.jsx("div",e.__assign({onClick:g,className:n.default.externalLink},{children:u}))]}))})),a.jsx("div",e.__assign({className:n.default.relativeContainer},{children:a.jsx("div",e.__assign({className:n.default.container},{children:a.jsxs("div",e.__assign({className:"".concat(n.default.contentWrapper," ").concat(n.default.customScrollbarClass," ").concat(w?"":n.default.maxheight38rem)},{children:[a.jsx("div",{className:n.default.gradientOverlayLeft}),a.jsx("div",{className:n.default.gradientOverlayRight}),a.jsxs("div",e.__assign({className:n.default.contentWrapper},{children:[r.map((function(e,t){i.cleanScannedText(e);var s=(j?e.includes(f[0]):f.some((function(a){return S(e).toLowerCase()===S(a).toLowerCase()})))?$(r.join("\n"),e,"Citation",b,f,j):e;return a.jsx("div",{className:"".concat(n.default.paragraph," ").concat(0!==t?n.default.textIndent:""),dangerouslySetInnerHTML:{__html:s}},t)})),h&&a.jsx("div",e.__assign({className:n.default.pageIndex},{children:a.jsxs("div",e.__assign({className:n.default.pageLabel},{children:[h," ",m&&"of ".concat(m)]}))}))]}))]}))}))}))]}))}))}))}))]}))})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../node_modules/tslib/tslib.es6.mjs.js"),a=require("react/jsx-runtime"),n=require("react"),t=require("./BookCitation.module.css.js"),i=require("./text-cleaner.js");exports.default=function(o){var s=o.title,c=o.author,r=o.paragraphs,l=o.chevronUpComponent,d=o.chevronDownComponent,u=o.externalLinkComponent,f=o.textToHighlight,h=o.pageNumber,v=o.totalPageNumber,m=void 0===v?null:v,p=o.citationTitle;o.customStyle;var g=o.handleExternalLinkClick,x=o.bookCoverImage,_=o.partialMatch,j=void 0!==_&&_,N=o.citationNumber,b=void 0===N?1:N,C=o.defaultState,k=void 0!==C&&C,E=o.isNonHighlightedBlur,T=void 0!==E&&E,q=o.toggleBlur,y=void 0===q?T:q,A=o.fixedWidth,L=void 0===A||A,w=o.isBookemon,I=void 0!==w&&w,B=n.useState(k),M=B[0],H=B[1],W=["address","article","aside","blockquote","canvas","dd","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","li","main","nav","noscript","ol","p","pre","section","table","tfoot","ul","video"];n.useEffect((function(){if(M){var e,a="quotes-citations-".concat(null!=b?b:""),n=!1;return requestAnimationFrame((function(){requestAnimationFrame((function(){e=function(){var e=document.getElementById(a);if(e&&!n){e.scrollIntoView({behavior:"smooth",block:"center"});var t=setTimeout((function(){if(!n){var a=e.getBoundingClientRect(),t=window.innerHeight/2;Math.abs(a.top-t)>40&&e.scrollIntoView({behavior:"auto",block:"center"})}}),400);return function(){return clearTimeout(t)}}}()||void 0}))})),function(){n=!0,e&&e()}}}),[M,f,b]);var S=function(e){void 0===e&&(e="");var a=document.createElement("div");a.innerHTML=e;var n=a.textContent||a.innerText||"";return(n=(n=n.replace(/<\/?[^>]+(>|$)/g,"")).replace(/\s+/g," ")).trim()};function O(e){var a=document.createElement("div");a.innerHTML=e;var n=t.default.highlighted,i=function(e,a){var o,s;if(void 0===a&&(a=!1),e.nodeType===Node.TEXT_NODE){if(!a&&(null===(o=e.textContent)||void 0===o?void 0:o.trim())){var c=document.createElement("span");c.classList.add(t.default.blurred),c.textContent=e.textContent,null===(s=e.parentNode)||void 0===s||s.replaceChild(c,e)}}else if(e.nodeType===Node.ELEMENT_NODE){var r=e,l=r.classList.contains(n);Array.from(r.childNodes).forEach((function(e){return i(e,a||l)}))}};return Array.from(a.childNodes).forEach((function(e){return i(e)})),a.innerHTML}function R(e,a,n,i,o,s){void 0===o&&(o=[]),void 0===s&&(s=!1);var c,r=t.default.highlighted,l=t.default.highlightedInline,d=t.default.highlightedBlock,u="".concat(r," ").concat(l),f="".concat(r," ").concat(d),h=a,v=(c=document.createElement("textarea"),function(e){return c.innerHTML=e,c.value});if(o.length>0){if(s){return o.forEach((function(e){e&&(h=function(e,a,n){for(var t='<span id="'.concat(n,'" class="').concat(u,'">'),i="</span>",o=e,s=0,c=new RegExp("(<(?:".concat(W.join("|"),")[^>]*>.*?)(?=<(?:").concat(W.join("|"),")|$)"),"gi"),r=(a.match(c)||[a]).map((function(e){var a=e.match(/^<([a-zA-Z0-9]+)([^>]*)>/);if(a&&W.includes(a[1].toLowerCase())){var n=a[0].length;return a[0]+t+e.slice(n)+i}return t+e+i})).join("");;){var l=o.indexOf(a,s);if(-1===l)break;o=o.slice(0,l)+r+o.slice(l+a.length),s=l+r.length}var f=d;return o.replace(/<span([^>]*)>([\s\S]*?)<\/span>/gi,(function(e,a,n){if(W.some((function(e){return new RegExp("<".concat(e,"\\b[^>]*>"),"i").test(n)}))){var t=a.match(/\sclass\s*=\s*(['"])(.*?)\1/);if(t){var i=t[2],o=i.split(/\s+/).includes(f)?i:"".concat(i," ").concat(f);a=a.replace(t[0],' class="'.concat(o,'"'))}else a+=' class="'.concat(f,'"')}return"<span".concat(a,">").concat(n,"</span>")}))}(h,e,"Annotation"===n?"quotes-annotations-".concat(null!=i?i:""):"quotes-citations-".concat(null!=i?i:"")))})),T&&y?O(h):h}return o.forEach((function(e){var t=v(e).trim();if(t&&v(a).trim().toLowerCase()===t.toLowerCase()){var o="Annotation"===n?"quotes-annotations-".concat(null!=i?i:""):"quotes-citations-".concat(null!=i?i:"");h='<span id="'.concat(o,'" class="').concat(f,'">').concat(a,"</span>")}})),T&&y?O(h):h}var m=f;if(!e||!a)return"Annotation"===n?a:'<span id="quotes-citations" class="'.concat(m,'">').concat(a,"</span>");var p=Array.from(e.matchAll(/`([^`]+)`/g));if(0===p.length)return"Annotation"===n?a:'<span id="quotes-citations" class="'.concat(m,'">').concat(a,"</span>");h=a;var g=!1;return p.forEach((function(e){var a=v(e[1]).trim();if(a){var t=a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),i=new RegExp("(".concat(t,")"),"gi");h.match(i)&&(g=!0,h=h.replace(i,'<span id="'.concat("Annotation"===n?"quotes-annotations":"quotes-citations",'" class="').concat(m,'">$1</span>')))}})),g?h:"Annotation"===n?a:'<span id="quotes-citations" class="'.concat(m,'">').concat(a,"</span>")}return a.jsx(a.Fragment,{children:a.jsxs("span",e.__assign({className:"".concat(t.default.relativeWrapper," ").concat(I?t.default.height95percent+" "+t.default.displayFlex:t.default.height100percent)},{children:[!k&&a.jsx("div",e.__assign({className:t.default.citationButtonWrapper},{children:a.jsxs("div",e.__assign({onClick:function(){return H((function(e){return!e}))},className:t.default.citationButton},{children:[a.jsx("span",e.__assign({className:t.default.citationText},{children:p})),M?l:d]}))})),M&&a.jsx("div",e.__assign({className:t.default.expandedWrapper},{children:a.jsx("div",e.__assign({className:"".concat(t.default.expandableContainer," ").concat(L?t.default.expandableContainerWidth:"")},{children:a.jsx("div",e.__assign({className:t.default.expandableContent},{children:a.jsxs("div",e.__assign({className:t.default.bookBodyContent},{children:[!k&&a.jsx("div",e.__assign({className:t.default.header},{children:a.jsxs("div",e.__assign({className:t.default.bookInfo},{children:[x&&a.jsx("div",e.__assign({className:t.default.bookImageWrapper},{children:a.jsx("img",{src:x,alt:s||"Book cover",className:t.default.bookImage})})),a.jsxs("div",e.__assign({className:t.default.bookTextInfo},{children:[a.jsx("h1",e.__assign({className:t.default.bookTitle},{children:s})),c||Array.isArray(c)&&a.jsxs("p",e.__assign({className:t.default.bookAuthor},{children:["by"," ",Array.isArray(c)?c.join(", "):c||""]}))]})),a.jsx("div",e.__assign({onClick:g,className:t.default.externalLink},{children:u}))]}))})),a.jsx("div",e.__assign({className:t.default.relativeContainer},{children:a.jsx("div",e.__assign({className:t.default.container},{children:a.jsxs("div",e.__assign({className:"".concat(t.default.contentWrapper," ").concat(t.default.customScrollbarClass," ").concat(I?"":t.default.maxheight38rem)},{children:[a.jsx("div",{className:t.default.gradientOverlayLeft}),a.jsx("div",{className:t.default.gradientOverlayRight}),a.jsxs("div",e.__assign({className:t.default.contentWrapper},{children:[r.map((function(e,n){i.cleanScannedText(e);var o=(j?e.includes(f[0]):f.some((function(a){return S(e).toLowerCase()===S(a).toLowerCase()})))?R(r.join("\n"),e,"Citation",b,f,j):e;return a.jsx("div",{className:"".concat(t.default.paragraph," ").concat(0!==n?t.default.textIndent:""),dangerouslySetInnerHTML:{__html:o}},n)})),h&&a.jsx("div",e.__assign({className:t.default.pageIndex},{children:a.jsxs("div",e.__assign({className:t.default.pageLabel},{children:[h," ",m&&"of ".concat(m)]}))}))]}))]}))}))}))]}))}))}))}))]}))})};
2
2
  //# sourceMappingURL=BookCitation.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../node_modules/tslib/tslib.es6.mjs.js"),i=require("react/jsx-runtime"),t=require("react"),o=require("../../node_modules/@material-ui/core/esm/Accordion/Accordion.js"),n=require("../../node_modules/@material-ui/core/esm/AccordionSummary/AccordionSummary.js"),r=require("../../_virtual/ExpandMore.js"),a=require("../../_virtual/Close.js"),s=require("../../node_modules/react-resizable-panels/dist/react-resizable-panels.browser.js"),l=require("./BookDetailsCard/BookDetailsCard.js"),d=require("./BookOverviewCard/BookOverviewCard.js"),c=require("./BookElementsCard/BookElementsCard.js"),u=require("./BookCopyrightsCard/BookCopyrightsCard.js"),g=require("./BookPeopleAwardsCard/BookPeopleAwardsCard.js"),h=require("./BookPreview/BookPreview.js"),x=require("../../node_modules/@material-ui/core/esm/Dialog/Dialog.js"),p=require("../../node_modules/@material-ui/core/esm/DialogContent/DialogContent.js"),_=require("../../node_modules/@material-ui/core/esm/Typography/Typography.js"),f=require("../../node_modules/@material-ui/core/esm/AccordionDetails/AccordionDetails.js"),m=require("../../node_modules/@material-ui/core/esm/IconButton/IconButton.js"),j={dialogPaper:{maxWidth:"none",fontFamily:"Inter, sans-serif"},dialogContent:{padding:0,backgroundColor:"#FFFFFF",overflow:"hidden",height:"90vh",position:"relative"},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"}},y={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=i.jsx("svg",e.__assign({style:y.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"})})),v=function(t){var o=t.header,n=t.subheader,r=t.icon;return i.jsx("div",e.__assign({style:y.wrapper},{children:i.jsxs("div",e.__assign({style:y.inner},{children:[i.jsx("div",e.__assign({style:{marginBottom:"32px"}},{children:i.jsx("div",e.__assign({style:y.iconWrapper},{children:r||b}))})),i.jsxs("div",{children:[i.jsx("h1",e.__assign({style:y.heading},{children:o})),i.jsx("p",e.__assign({style:y.text},{children:n}))]})]}))}))};exports.comingSoonStyles=y,exports.default=function(y){var k=y.open,C=y.onClose,B=y.isNonHighlightedBlur,w=y.isBookemon,S=y.getHighlightContent,F=y.handleFetchManuscriptElements,D=y.data,z=y.showComingSoon,P=void 0!==z&&z,q=y.comingSoonData,I=void 0===q?{header:"Bookemon Coming Soon!!",subheader:"We're working on something amazing. Stay tuned for updates!",icon:b}:q,A=y.customStyle,H=void 0===A?{}:A,E=y.isBlurToggleVisible,O=void 0!==E&&E,L=t.useState({textToHighLight:"",content:""}),R=L[0],M=L[1],T=t.useState(1),W=T[0],N=T[1],V=t.useState(!1),Q=V[0],Y=V[1],G=t.useState("Book Preview"),J=G[0],K=G[1],U=t.useState(70),X=U[0],Z=U[1],$=t.useRef(null),ee=t.useState(!1),ie=ee[0],te=ee[1],oe=function(i,t,o,n){return void 0===n&&(n=0),e.__awaiter(void 0,void 0,void 0,(function(){var r,a,s,l,d,c,u,g,h,x,p,_,f,m,j,y,b,v,k,C,B,w,F,D,z,P,q,I,A,H,E,O,L,R;return e.__generator(this,(function(e){switch(e.label){case 0:M({textToHighLight:"",content:""}),te(!1),Y(!0),K(t),e.label=1;case 1:return e.trys.push([1,4,5,6]),o&&0!==o.length?[4,S([o[n]])]:(Y(!1),Z(70),null===(L=$.current)||void 0===L||L.resize(70),[2]);case 2:if(r=e.sent(),a=(null==r?void 0:r.data)||r||[],!Array.isArray(a)||0===a.length)return te(!0),Y(!1),[2];for(l=(s=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():""})(i),d=l.split(" ").filter(Boolean),c=[],u=0;u<d.length;u++)for(g=d.length;g>u;g--)B=d.slice(u,g).join(" "),B.split(" ").length>=4&&c.push(B);for(h=null,x=0,p=c;x<p.length;x++){for(B=p[x],_=0,f=a;_<f.length;_++)if(q=f[_],(I=s(q.normalizedContent||q.htmlContent))===B){h=q;break}if(h)break}if(!h)for(m=0,j=c;m<j.length;m++){for(B=j[m],y=new RegExp("\\b".concat(B,"\\b"),"i"),b=0,v=a;b<v.length;b++)if(q=v[b],I=s(q.normalizedContent||q.htmlContent),y.test(I)){h=q;break}if(h)break}if(!h)for(k=0,C=c;k<C.length;k++)if(B=C[k],!((w=B.split(" ")).length<2)){for(F=w[0],D=w[w.length-1],z=0,P=a;z<P.length;z++)if(q=P[z],I=s(q.normalizedContent||q.htmlContent),A=I.indexOf(F),H=I.indexOf(D),-1!==A&&-1!==H&&Math.abs(H-A)<40){h=q;break}if(h)break}return E=a.map((function(e){return e.htmlContent})).join("\n"),h?(M({textToHighLight:h.htmlContent,content:E}),Z(50),null===(R=$.current)||void 0===R||R.resize(50),Y(!1),[2]):n+1>=o.length?(te(!0),Y(!1),[2]):[4,oe(i,t,o,n+1)];case 3:return[2,e.sent()];case 4:return O=e.sent(),console.error("Highlight error:",O),te(!0),[3,6];case 5:return Y(!1),[7];case 6:return[2]}}))}))},ne=D.bookAwards,re=D.bookCopyRight,ae=D.bookDetails,se=D.bookElements,le=D.bookOverView,de=D.bookCoverImage,ce=null==ae?void 0:ae.isbn;return i.jsx(x.default,e.__assign({open:k,fullWidth:!0,PaperProps:{style:e.__assign(e.__assign({},null==j?void 0:j.dialogPaper),null==H?void 0:H.dialogDimension)}},{children:i.jsxs(p.default,e.__assign({style:j.dialogContent},{children:[!P&&i.jsx("div",e.__assign({style:j.container},{children:i.jsxs(s.PanelGroup,e.__assign({direction:"horizontal"},{children:[i.jsx(s.Panel,e.__assign({order:1,ref:$,defaultSize:X||70},{children:i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},null==j?void 0:j.leftPanel),null==H?void 0:H.leftPanel)},{children:[i.jsx("div",e.__assign({style:{marginBottom:"24px"}},{children:i.jsxs(o.default,e.__assign({defaultExpanded:!0,elevation:0,style:j.accordion},{children:[i.jsx(n.default,e.__assign({expandIcon:i.jsx(r.default,{}),style:j.accordionSummary},{children:i.jsx(_.default,e.__assign({style:j.heading},{children:"Book Overview"}))})),i.jsx(f.default,e.__assign({style:j.accordionDetails},{children:le&&Object.keys(le).length>0?i.jsx(d.default,{data:le}):i.jsx("div",e.__assign({style:j.errorState},{children:"No overview data available."}))}))]}))})),i.jsx("div",e.__assign({style:{marginBottom:"24px"}},{children:i.jsxs(o.default,e.__assign({elevation:0,style:j.accordion},{children:[i.jsx(n.default,e.__assign({expandIcon:i.jsx(r.default,{}),style:j.accordionSummary},{children:i.jsx(_.default,e.__assign({style:j.heading},{children:"Book Manuscript Elements"}))})),i.jsx(f.default,e.__assign({style:j.accordionDetails},{children:i.jsx(c.default,{data:se,handleFetchManuscriptElements:F,BookIsbn:ce,updateQuotesToHighLight:oe})}))]}))})),i.jsx("div",e.__assign({style:{marginBottom:"24px"}},{children:i.jsxs(o.default,e.__assign({elevation:0,style:j.accordion},{children:[i.jsx(n.default,e.__assign({expandIcon:i.jsx(r.default,{}),style:j.accordionSummary},{children:i.jsx(_.default,e.__assign({style:j.heading},{children:"Book Metadata Details"}))})),i.jsx(f.default,e.__assign({style:j.accordionDetails},{children:ae&&Object.keys(ae).length>0?i.jsx(l.default,{data:ae}):i.jsx("div",e.__assign({style:j.errorState},{children:"No Book Metadata data available."}))}))]}))})),i.jsx("div",e.__assign({style:{marginBottom:"24px"}},{children:i.jsxs(o.default,e.__assign({elevation:0,style:j.accordion},{children:[i.jsx(n.default,e.__assign({expandIcon:i.jsx(r.default,{}),style:j.accordionSummary},{children:i.jsx(_.default,e.__assign({style:j.heading},{children:"Copyrights & Marketing"}))})),i.jsx(f.default,e.__assign({style:j.accordionDetails},{children:re&&Object.keys(re).length>0?i.jsx(u.default,{data:re}):i.jsx("div",e.__assign({style:j.errorState},{children:"No Copyrights & Marketing data available."}))}))]}))})),i.jsx("div",{children:i.jsxs(o.default,e.__assign({elevation:0,style:j.accordion},{children:[i.jsx(n.default,e.__assign({expandIcon:i.jsx(r.default,{}),style:j.accordionSummary},{children:i.jsx(_.default,e.__assign({style:j.heading},{children:"People & Awards"}))})),i.jsx(f.default,e.__assign({style:j.accordionDetails},{children:ne&&Object.keys(ne).length>0?i.jsx(g.default,{data:ne}):i.jsx("div",e.__assign({style:j.errorState},{children:"No People & Awards data available."}))}))]}))})]}))})),i.jsx(s.PanelResizeHandle,{style:{width:"3px",background:"#D1D5DC",cursor:"col-resize"}}),i.jsx(s.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:i.jsx(h.default,{bookOverView:le,bookCoverImage:de,onClose:C,clickableElementCategory:J,quotesToHighLightData:R,updateQuotesToHighLight:oe,citationLoad:Q,previewPage:W,setPreviewPage:N,customStyle:H,comingSoonData:I,isNonHighlightedBlur:B,isBlurToggleVisible:O,isBookemon:w,noHtmlContent:ie})}))]}))})),P?i.jsxs("div",e.__assign({style:j.blurOverlay},{children:[i.jsx(m.default,e.__assign({style:j.closeButton,onClick:C},{children:i.jsx(a.default,{})})),i.jsx(v,{header:I.header,subheader:I.subheader,icon:I.icon})]})):i.jsx(i.Fragment,{})]}))}))},exports.defaultIcon=b;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../node_modules/tslib/tslib.es6.mjs.js"),i=require("react/jsx-runtime"),t=require("react"),o=require("../../node_modules/@material-ui/core/esm/Accordion/Accordion.js"),n=require("../../node_modules/@material-ui/core/esm/AccordionSummary/AccordionSummary.js"),r=require("../../_virtual/ExpandMore.js"),a=require("../../_virtual/Close.js"),s=require("../../node_modules/react-resizable-panels/dist/react-resizable-panels.browser.js"),l=require("./BookDetailsCard/BookDetailsCard.js"),d=require("./BookOverviewCard/BookOverviewCard.js"),c=require("./BookElementsCard/BookElementsCard.js"),u=require("./BookCopyrightsCard/BookCopyrightsCard.js"),g=require("./BookPeopleAwardsCard/BookPeopleAwardsCard.js"),h=require("./BookPreview/BookPreview.js"),x=require("../../node_modules/@material-ui/core/esm/Dialog/Dialog.js"),p=require("../../node_modules/@material-ui/core/esm/DialogContent/DialogContent.js"),_=require("../../node_modules/@material-ui/core/esm/Typography/Typography.js"),m=require("../../node_modules/@material-ui/core/esm/AccordionDetails/AccordionDetails.js"),f=require("../../node_modules/@material-ui/core/esm/IconButton/IconButton.js"),j={dialogPaper:{maxWidth:"none",fontFamily:"Inter, sans-serif"},dialogContent:{padding:0,backgroundColor:"#FFFFFF",overflow:"hidden",height:"90vh",position:"relative"},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"}},y={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%"}},v=i.jsx("svg",e.__assign({style:y.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"})})),b=function(t){var o=t.header,n=t.subheader,r=t.icon;return i.jsx("div",e.__assign({style:y.wrapper},{children:i.jsxs("div",e.__assign({style:y.inner},{children:[i.jsx("div",e.__assign({style:{marginBottom:"32px"}},{children:i.jsx("div",e.__assign({style:y.iconWrapper},{children:r||v}))})),i.jsxs("div",{children:[i.jsx("h1",e.__assign({style:y.heading},{children:o})),i.jsx("p",e.__assign({style:y.text},{children:n}))]})]}))}))};exports.comingSoonStyles=y,exports.default=function(y){var k=y.open,C=y.onClose,B=y.isNonHighlightedBlur,w=y.isBookemon,S=y.getHighlightContent,F=y.handleFetchManuscriptElements,D=y.data,z=y.showComingSoon,P=void 0!==z&&z,q=y.comingSoonData,I=void 0===q?{header:"Bookemon Coming Soon!!",subheader:"We're working on something amazing. Stay tuned for updates!",icon:v}:q,A=y.customStyle,H=void 0===A?{}:A,E=y.isBlurToggleVisible,L=void 0!==E&&E,O=t.useState({textToHighLight:"",content:""}),R=O[0],T=O[1],M=t.useState(1),W=M[0],N=M[1],V=t.useState(!1),Q=V[0],Y=V[1],G=t.useState("Book Preview"),J=G[0],K=G[1],U=t.useState(70),X=U[0],Z=U[1],$=t.useRef(null),ee=t.useState(!1),ie=ee[0],te=ee[1],oe=function(i,t,o,n){return void 0===n&&(n=0),e.__awaiter(void 0,void 0,void 0,(function(){var r,a,s,l,d,c,u,g,h,x,p,_,m,f,j,y;return e.__generator(this,(function(e){switch(e.label){case 0:T({textToHighLight:"",content:""}),te(!1),Y(!0),K(t),e.label=1;case 1:return e.trys.push([1,5,6,7]),o&&0!==o.length?[4,S([o[n]])]:(Y(!1),Z(70),null===(j=$.current)||void 0===j||j.resize(70),[2]);case 2:if(r=e.sent(),a=(null==r?void 0:r.data)||r||[],!Array.isArray(a)||0===a.length)return te(!0),Y(!1),[2];for(l=(s=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():""})(i),d=null,c=0,u=a;c<u.length;c++)if(_=u[c],s(_.normalizedContent||_.htmlContent).includes(l)){d=_;break}if(!d)for(g=l.split(" ").filter(Boolean);g.length>0;){for(h=g.join(" "),x=0,p=a;x<p.length;x++)if(_=p[x],s(_.normalizedContent||_.htmlContent).includes(h)){d=_;break}if(d)break;g.pop()}return m=a.map((function(e){return e.htmlContent})).join("\n"),d?(T({textToHighLight:d.htmlContent,content:m}),Z(50),null===(y=$.current)||void 0===y||y.resize(50),Y(!1),[2]):n+1<o.length?[4,oe(i,t,o,n+1)]:[3,4];case 3:return[2,e.sent()];case 4:return te(!0),Y(!1),[3,7];case 5:return f=e.sent(),console.error("Highlight error:",f),te(!0),[3,7];case 6:return Y(!1),[7];case 7:return[2]}}))}))},ne=D.bookAwards,re=D.bookCopyRight,ae=D.bookDetails,se=D.bookElements,le=D.bookOverView,de=D.bookCoverImage,ce=null==ae?void 0:ae.isbn;return i.jsx(x.default,e.__assign({open:k,fullWidth:!0,PaperProps:{style:e.__assign(e.__assign({},null==j?void 0:j.dialogPaper),null==H?void 0:H.dialogDimension)}},{children:i.jsxs(p.default,e.__assign({style:j.dialogContent},{children:[!P&&i.jsx("div",e.__assign({style:j.container},{children:i.jsxs(s.PanelGroup,e.__assign({direction:"horizontal"},{children:[i.jsx(s.Panel,e.__assign({order:1,ref:$,defaultSize:X||70},{children:i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},null==j?void 0:j.leftPanel),null==H?void 0:H.leftPanel)},{children:[i.jsx("div",e.__assign({style:{marginBottom:"24px"}},{children:i.jsxs(o.default,e.__assign({defaultExpanded:!0,elevation:0,style:j.accordion},{children:[i.jsx(n.default,e.__assign({expandIcon:i.jsx(r.default,{}),style:j.accordionSummary},{children:i.jsx(_.default,e.__assign({style:j.heading},{children:"Book Overview"}))})),i.jsx(m.default,e.__assign({style:j.accordionDetails},{children:le&&Object.keys(le).length>0?i.jsx(d.default,{data:le}):i.jsx("div",e.__assign({style:j.errorState},{children:"No overview data available."}))}))]}))})),i.jsx("div",e.__assign({style:{marginBottom:"24px"}},{children:i.jsxs(o.default,e.__assign({elevation:0,style:j.accordion},{children:[i.jsx(n.default,e.__assign({expandIcon:i.jsx(r.default,{}),style:j.accordionSummary},{children:i.jsx(_.default,e.__assign({style:j.heading},{children:"Book Manuscript Elements"}))})),i.jsx(m.default,e.__assign({style:j.accordionDetails},{children:i.jsx(c.default,{data:se,handleFetchManuscriptElements:F,BookIsbn:ce,updateQuotesToHighLight:oe})}))]}))})),i.jsx("div",e.__assign({style:{marginBottom:"24px"}},{children:i.jsxs(o.default,e.__assign({elevation:0,style:j.accordion},{children:[i.jsx(n.default,e.__assign({expandIcon:i.jsx(r.default,{}),style:j.accordionSummary},{children:i.jsx(_.default,e.__assign({style:j.heading},{children:"Book Metadata Details"}))})),i.jsx(m.default,e.__assign({style:j.accordionDetails},{children:ae&&Object.keys(ae).length>0?i.jsx(l.default,{data:ae}):i.jsx("div",e.__assign({style:j.errorState},{children:"No Book Metadata data available."}))}))]}))})),i.jsx("div",e.__assign({style:{marginBottom:"24px"}},{children:i.jsxs(o.default,e.__assign({elevation:0,style:j.accordion},{children:[i.jsx(n.default,e.__assign({expandIcon:i.jsx(r.default,{}),style:j.accordionSummary},{children:i.jsx(_.default,e.__assign({style:j.heading},{children:"Copyrights & Marketing"}))})),i.jsx(m.default,e.__assign({style:j.accordionDetails},{children:re&&Object.keys(re).length>0?i.jsx(u.default,{data:re}):i.jsx("div",e.__assign({style:j.errorState},{children:"No Copyrights & Marketing data available."}))}))]}))})),i.jsx("div",{children:i.jsxs(o.default,e.__assign({elevation:0,style:j.accordion},{children:[i.jsx(n.default,e.__assign({expandIcon:i.jsx(r.default,{}),style:j.accordionSummary},{children:i.jsx(_.default,e.__assign({style:j.heading},{children:"People & Awards"}))})),i.jsx(m.default,e.__assign({style:j.accordionDetails},{children:ne&&Object.keys(ne).length>0?i.jsx(g.default,{data:ne}):i.jsx("div",e.__assign({style:j.errorState},{children:"No People & Awards data available."}))}))]}))})]}))})),i.jsx(s.PanelResizeHandle,{style:{width:"3px",background:"#D1D5DC",cursor:"col-resize"}}),i.jsx(s.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:i.jsx(h.default,{bookOverView:le,bookCoverImage:de,onClose:C,clickableElementCategory:J,quotesToHighLightData:R,updateQuotesToHighLight:oe,citationLoad:Q,previewPage:W,setPreviewPage:N,customStyle:H,comingSoonData:I,isNonHighlightedBlur:B,isBlurToggleVisible:L,isBookemon:w,noHtmlContent:ie})}))]}))})),P?i.jsxs("div",e.__assign({style:j.blurOverlay},{children:[i.jsx(f.default,e.__assign({style:j.closeButton,onClick:C},{children:i.jsx(a.default,{})})),i.jsx(b,{header:I.header,subheader:I.subheader,icon:I.icon})]})):i.jsx(i.Fragment,{})]}))}))},exports.defaultIcon=v;
2
2
  //# sourceMappingURL=Bookemon.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as n}from"../../node_modules/tslib/tslib.es6.mjs.js";import{jsx as e,Fragment as t,jsxs as a}from"react/jsx-runtime";import{useState as o,useEffect as c}from"react";import i from"./BookCitation.module.css.js";import{cleanScannedText as r}from"./text-cleaner.js";var s=function(s){var l=s.title,d=s.author,u=s.paragraphs,h=s.chevronUpComponent,m=s.chevronDownComponent,v=s.externalLinkComponent,p=s.textToHighlight,f=s.pageNumber,g=s.totalPageNumber,N=void 0===g?null:g,x=s.citationTitle;s.customStyle;var b=s.handleExternalLinkClick,C=s.bookCoverImage,k=s.partialMatch,E=void 0!==k&&k,L=s.citationNumber,y=void 0===L?1:L,A=s.defaultState,T=void 0!==A&&A,q=s.isNonHighlightedBlur,I=void 0!==q&&q,j=s.toggleBlur,w=void 0===j?I:j,B=s.fixedWidth,W=void 0===B||B,H=s.isBookemon,M=void 0!==H&&H,O=o(T),S=O[0],$=O[1],_=["address","article","aside","blockquote","canvas","dd","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","li","main","nav","noscript","ol","p","pre","section","table","tfoot","ul","video"];c((function(){if(S){var n=document.getElementById("quotes-citations-".concat(null!=y?y:""));n&&n.scrollIntoView({behavior:"smooth",block:"center"})}}),[S,p,y]);var R=function(n){void 0===n&&(n="");var e=document.createElement("div");e.innerHTML=n;var t=e.textContent||e.innerText||"";return(t=(t=t.replace(/<\/?[^>]+(>|$)/g,"")).replace(/\s+/g," ")).trim()};function D(n){var e=document.createElement("div");e.innerHTML=n;var t=i.highlighted,a=function(n,e){var o,c;if(void 0===e&&(e=!1),n.nodeType===Node.TEXT_NODE){if(!e&&(null===(o=n.textContent)||void 0===o?void 0:o.trim())){var r=document.createElement("span");r.classList.add(i.blurred),r.textContent=n.textContent,null===(c=n.parentNode)||void 0===c||c.replaceChild(r,n)}}else if(n.nodeType===Node.ELEMENT_NODE){var s=n,l=s.classList.contains(t);Array.from(s.childNodes).forEach((function(n){return a(n,e||l)}))}};return Array.from(e.childNodes).forEach((function(n){return a(n)})),e.innerHTML}function z(n,e,t,a,o,c){void 0===o&&(o=[]),void 0===c&&(c=!1);var r,s=i.highlighted,l=i.highlightedInline,d=i.highlightedBlock,u="".concat(s," ").concat(l),h="".concat(s," ").concat(d),m=e,v=(r=document.createElement("textarea"),function(n){return r.innerHTML=n,r.value});if(o.length>0){if(c){return o.forEach((function(n){n&&(m=function(n,e,t){for(var a='<span id="'.concat(t,'" class="').concat(u,'">'),o="</span>",c=n,i=0,r=new RegExp("(<(?:".concat(_.join("|"),")[^>]*>.*?)(?=<(?:").concat(_.join("|"),")|$)"),"gi"),s=(e.match(r)||[e]).map((function(n){var e=n.match(/^<([a-zA-Z0-9]+)([^>]*)>/);if(e&&_.includes(e[1].toLowerCase())){var t=e[0].length;return e[0]+a+n.slice(t)+o}return a+n+o})).join("");;){var l=c.indexOf(e,i);if(-1===l)break;c=c.slice(0,l)+s+c.slice(l+e.length),i=l+s.length}var h=d;return c.replace(/<span([^>]*)>([\s\S]*?)<\/span>/gi,(function(n,e,t){if(_.some((function(n){return new RegExp("<".concat(n,"\\b[^>]*>"),"i").test(t)}))){var a=e.match(/\sclass\s*=\s*(['"])(.*?)\1/);if(a){var o=a[2],c=o.split(/\s+/).includes(h)?o:"".concat(o," ").concat(h);e=e.replace(a[0],' class="'.concat(c,'"'))}else e+=' class="'.concat(h,'"')}return"<span".concat(e,">").concat(t,"</span>")}))}(m,n,"Annotation"===t?"quotes-annotations-".concat(null!=a?a:""):"quotes-citations-".concat(null!=a?a:"")))})),I&&w?D(m):m}return o.forEach((function(n){var o=v(n).trim();if(o&&v(e).trim().toLowerCase()===o.toLowerCase()){var c="Annotation"===t?"quotes-annotations-".concat(null!=a?a:""):"quotes-citations-".concat(null!=a?a:"");m='<span id="'.concat(c,'" class="').concat(h,'">').concat(e,"</span>")}})),I&&w?D(m):m}var p=h;if(!n||!e)return"Annotation"===t?e:'<span id="quotes-citations" class="'.concat(p,'">').concat(e,"</span>");var f=Array.from(n.matchAll(/`([^`]+)`/g));if(0===f.length)return"Annotation"===t?e:'<span id="quotes-citations" class="'.concat(p,'">').concat(e,"</span>");m=e;var g=!1;return f.forEach((function(n){var e=v(n[1]).trim();if(e){var a=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp("(".concat(a,")"),"gi");m.match(o)&&(g=!0,m=m.replace(o,'<span id="'.concat("Annotation"===t?"quotes-annotations":"quotes-citations",'" class="').concat(p,'">$1</span>')))}})),g?m:"Annotation"===t?e:'<span id="quotes-citations" class="'.concat(p,'">').concat(e,"</span>")}return e(t,{children:a("span",n({className:"".concat(i.relativeWrapper," ").concat(M?i.height95percent+" "+i.displayFlex:i.height100percent)},{children:[!T&&e("div",n({className:i.citationButtonWrapper},{children:a("div",n({onClick:function(){return $((function(n){return!n}))},className:i.citationButton},{children:[e("span",n({className:i.citationText},{children:x})),S?h:m]}))})),S&&e("div",n({className:i.expandedWrapper},{children:e("div",n({className:"".concat(i.expandableContainer," ").concat(W?i.expandableContainerWidth:"")},{children:e("div",n({className:i.expandableContent},{children:a("div",n({className:i.bookBodyContent},{children:[!T&&e("div",n({className:i.header},{children:a("div",n({className:i.bookInfo},{children:[C&&e("div",n({className:i.bookImageWrapper},{children:e("img",{src:C,alt:l||"Book cover",className:i.bookImage})})),a("div",n({className:i.bookTextInfo},{children:[e("h1",n({className:i.bookTitle},{children:l})),d||Array.isArray(d)&&a("p",n({className:i.bookAuthor},{children:["by"," ",Array.isArray(d)?d.join(", "):d||""]}))]})),e("div",n({onClick:b,className:i.externalLink},{children:v}))]}))})),e("div",n({className:i.relativeContainer},{children:e("div",n({className:i.container},{children:a("div",n({className:"".concat(i.contentWrapper," ").concat(i.customScrollbarClass," ").concat(M?"":i.maxheight38rem)},{children:[e("div",{className:i.gradientOverlayLeft}),e("div",{className:i.gradientOverlayRight}),a("div",n({className:i.contentWrapper},{children:[u.map((function(n,t){r(n);var a=(E?n.includes(p[0]):p.some((function(e){return R(n).toLowerCase()===R(e).toLowerCase()})))?z(u.join("\n"),n,"Citation",y,p,E):n;return e("div",{className:"".concat(i.paragraph," ").concat(0!==t?i.textIndent:""),dangerouslySetInnerHTML:{__html:a}},t)})),f&&e("div",n({className:i.pageIndex},{children:a("div",n({className:i.pageLabel},{children:[f," ",N&&"of ".concat(N)]}))}))]}))]}))}))}))]}))}))}))}))]}))})};export{s as default};
1
+ import{__assign as n}from"../../node_modules/tslib/tslib.es6.mjs.js";import{jsx as e,Fragment as t,jsxs as a}from"react/jsx-runtime";import{useState as o,useEffect as i}from"react";import c from"./BookCitation.module.css.js";import{cleanScannedText as r}from"./text-cleaner.js";var s=function(s){var l=s.title,d=s.author,u=s.paragraphs,m=s.chevronUpComponent,h=s.chevronDownComponent,v=s.externalLinkComponent,p=s.textToHighlight,f=s.pageNumber,g=s.totalPageNumber,N=void 0===g?null:g,b=s.citationTitle;s.customStyle;var x=s.handleExternalLinkClick,C=s.bookCoverImage,k=s.partialMatch,E=void 0!==k&&k,A=s.citationNumber,L=void 0===A?1:A,T=s.defaultState,y=void 0!==T&&T,q=s.isNonHighlightedBlur,w=void 0!==q&&q,I=s.toggleBlur,B=void 0===I?w:I,j=s.fixedWidth,H=void 0===j||j,M=s.isBookemon,W=void 0!==M&&M,O=o(y),R=O[0],S=O[1],$=["address","article","aside","blockquote","canvas","dd","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","li","main","nav","noscript","ol","p","pre","section","table","tfoot","ul","video"];i((function(){if(R){var n,e="quotes-citations-".concat(null!=L?L:""),t=!1;return requestAnimationFrame((function(){requestAnimationFrame((function(){n=function(){var n=document.getElementById(e);if(n&&!t){n.scrollIntoView({behavior:"smooth",block:"center"});var a=setTimeout((function(){if(!t){var e=n.getBoundingClientRect(),a=window.innerHeight/2;Math.abs(e.top-a)>40&&n.scrollIntoView({behavior:"auto",block:"center"})}}),400);return function(){return clearTimeout(a)}}}()||void 0}))})),function(){t=!0,n&&n()}}}),[R,p,L]);var _=function(n){void 0===n&&(n="");var e=document.createElement("div");e.innerHTML=n;var t=e.textContent||e.innerText||"";return(t=(t=t.replace(/<\/?[^>]+(>|$)/g,"")).replace(/\s+/g," ")).trim()};function D(n){var e=document.createElement("div");e.innerHTML=n;var t=c.highlighted,a=function(n,e){var o,i;if(void 0===e&&(e=!1),n.nodeType===Node.TEXT_NODE){if(!e&&(null===(o=n.textContent)||void 0===o?void 0:o.trim())){var r=document.createElement("span");r.classList.add(c.blurred),r.textContent=n.textContent,null===(i=n.parentNode)||void 0===i||i.replaceChild(r,n)}}else if(n.nodeType===Node.ELEMENT_NODE){var s=n,l=s.classList.contains(t);Array.from(s.childNodes).forEach((function(n){return a(n,e||l)}))}};return Array.from(e.childNodes).forEach((function(n){return a(n)})),e.innerHTML}function F(n,e,t,a,o,i){void 0===o&&(o=[]),void 0===i&&(i=!1);var r,s=c.highlighted,l=c.highlightedInline,d=c.highlightedBlock,u="".concat(s," ").concat(l),m="".concat(s," ").concat(d),h=e,v=(r=document.createElement("textarea"),function(n){return r.innerHTML=n,r.value});if(o.length>0){if(i){return o.forEach((function(n){n&&(h=function(n,e,t){for(var a='<span id="'.concat(t,'" class="').concat(u,'">'),o="</span>",i=n,c=0,r=new RegExp("(<(?:".concat($.join("|"),")[^>]*>.*?)(?=<(?:").concat($.join("|"),")|$)"),"gi"),s=(e.match(r)||[e]).map((function(n){var e=n.match(/^<([a-zA-Z0-9]+)([^>]*)>/);if(e&&$.includes(e[1].toLowerCase())){var t=e[0].length;return e[0]+a+n.slice(t)+o}return a+n+o})).join("");;){var l=i.indexOf(e,c);if(-1===l)break;i=i.slice(0,l)+s+i.slice(l+e.length),c=l+s.length}var m=d;return i.replace(/<span([^>]*)>([\s\S]*?)<\/span>/gi,(function(n,e,t){if($.some((function(n){return new RegExp("<".concat(n,"\\b[^>]*>"),"i").test(t)}))){var a=e.match(/\sclass\s*=\s*(['"])(.*?)\1/);if(a){var o=a[2],i=o.split(/\s+/).includes(m)?o:"".concat(o," ").concat(m);e=e.replace(a[0],' class="'.concat(i,'"'))}else e+=' class="'.concat(m,'"')}return"<span".concat(e,">").concat(t,"</span>")}))}(h,n,"Annotation"===t?"quotes-annotations-".concat(null!=a?a:""):"quotes-citations-".concat(null!=a?a:"")))})),w&&B?D(h):h}return o.forEach((function(n){var o=v(n).trim();if(o&&v(e).trim().toLowerCase()===o.toLowerCase()){var i="Annotation"===t?"quotes-annotations-".concat(null!=a?a:""):"quotes-citations-".concat(null!=a?a:"");h='<span id="'.concat(i,'" class="').concat(m,'">').concat(e,"</span>")}})),w&&B?D(h):h}var p=m;if(!n||!e)return"Annotation"===t?e:'<span id="quotes-citations" class="'.concat(p,'">').concat(e,"</span>");var f=Array.from(n.matchAll(/`([^`]+)`/g));if(0===f.length)return"Annotation"===t?e:'<span id="quotes-citations" class="'.concat(p,'">').concat(e,"</span>");h=e;var g=!1;return f.forEach((function(n){var e=v(n[1]).trim();if(e){var a=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp("(".concat(a,")"),"gi");h.match(o)&&(g=!0,h=h.replace(o,'<span id="'.concat("Annotation"===t?"quotes-annotations":"quotes-citations",'" class="').concat(p,'">$1</span>')))}})),g?h:"Annotation"===t?e:'<span id="quotes-citations" class="'.concat(p,'">').concat(e,"</span>")}return e(t,{children:a("span",n({className:"".concat(c.relativeWrapper," ").concat(W?c.height95percent+" "+c.displayFlex:c.height100percent)},{children:[!y&&e("div",n({className:c.citationButtonWrapper},{children:a("div",n({onClick:function(){return S((function(n){return!n}))},className:c.citationButton},{children:[e("span",n({className:c.citationText},{children:b})),R?m:h]}))})),R&&e("div",n({className:c.expandedWrapper},{children:e("div",n({className:"".concat(c.expandableContainer," ").concat(H?c.expandableContainerWidth:"")},{children:e("div",n({className:c.expandableContent},{children:a("div",n({className:c.bookBodyContent},{children:[!y&&e("div",n({className:c.header},{children:a("div",n({className:c.bookInfo},{children:[C&&e("div",n({className:c.bookImageWrapper},{children:e("img",{src:C,alt:l||"Book cover",className:c.bookImage})})),a("div",n({className:c.bookTextInfo},{children:[e("h1",n({className:c.bookTitle},{children:l})),d||Array.isArray(d)&&a("p",n({className:c.bookAuthor},{children:["by"," ",Array.isArray(d)?d.join(", "):d||""]}))]})),e("div",n({onClick:x,className:c.externalLink},{children:v}))]}))})),e("div",n({className:c.relativeContainer},{children:e("div",n({className:c.container},{children:a("div",n({className:"".concat(c.contentWrapper," ").concat(c.customScrollbarClass," ").concat(W?"":c.maxheight38rem)},{children:[e("div",{className:c.gradientOverlayLeft}),e("div",{className:c.gradientOverlayRight}),a("div",n({className:c.contentWrapper},{children:[u.map((function(n,t){r(n);var a=(E?n.includes(p[0]):p.some((function(e){return _(n).toLowerCase()===_(e).toLowerCase()})))?F(u.join("\n"),n,"Citation",L,p,E):n;return e("div",{className:"".concat(c.paragraph," ").concat(0!==t?c.textIndent:""),dangerouslySetInnerHTML:{__html:a}},t)})),f&&e("div",n({className:c.pageIndex},{children:a("div",n({className:c.pageLabel},{children:[f," ",N&&"of ".concat(N)]}))}))]}))]}))}))}))]}))}))}))}))]}))})};export{s as default};
2
2
  //# sourceMappingURL=BookCitation.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e,__awaiter as o,__generator as t}from"../../node_modules/tslib/tslib.es6.mjs.js";import{jsx as i,jsxs as r,Fragment as n}from"react/jsx-runtime";import{useState as l,useRef as a}from"react";import d from"../../node_modules/@material-ui/core/esm/Accordion/Accordion.js";import s from"../../node_modules/@material-ui/core/esm/AccordionSummary/AccordionSummary.js";import c from"../../_virtual/ExpandMore.js";import h from"../../_virtual/Close.js";import{PanelGroup as g,Panel as p,PanelResizeHandle as m}from"../../node_modules/react-resizable-panels/dist/react-resizable-panels.browser.js";import u from"./BookDetailsCard/BookDetailsCard.js";import f from"./BookOverviewCard/BookOverviewCard.js";import y from"./BookElementsCard/BookElementsCard.js";import b from"./BookCopyrightsCard/BookCopyrightsCard.js";import v from"./BookPeopleAwardsCard/BookPeopleAwardsCard.js";import x from"./BookPreview/BookPreview.js";import k from"../../node_modules/@material-ui/core/esm/Dialog/Dialog.js";import C from"../../node_modules/@material-ui/core/esm/DialogContent/DialogContent.js";import B from"../../node_modules/@material-ui/core/esm/Typography/Typography.js";import w from"../../node_modules/@material-ui/core/esm/AccordionDetails/AccordionDetails.js";import j from"../../node_modules/@material-ui/core/esm/IconButton/IconButton.js";var F={dialogPaper:{maxWidth:"none",fontFamily:"Inter, sans-serif"},dialogContent:{padding:0,backgroundColor:"#FFFFFF",overflow:"hidden",height:"90vh",position:"relative"},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=i("svg",e({style:S.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"})})),z=function(o){var t=o.header,n=o.subheader,l=o.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||D}))})),r("div",{children:[i("h1",e({style:S.heading},{children:t})),i("p",e({style:S.text},{children:n}))]})]}))}))},P=function(S){var P=S.open,A=S.onClose,I=S.isNonHighlightedBlur,E=S.isBookemon,H=S.getHighlightContent,L=S.handleFetchManuscriptElements,O=S.data,_=S.showComingSoon,T=void 0!==_&&_,M=S.comingSoonData,R=void 0===M?{header:"Bookemon Coming Soon!!",subheader:"We're working on something amazing. Stay tuned for updates!",icon:D}:M,W=S.customStyle,N=void 0===W?{}:W,V=S.isBlurToggleVisible,Q=void 0!==V&&V,Y=l({textToHighLight:"",content:""}),q=Y[0],G=Y[1],J=l(1),K=J[0],U=J[1],X=l(!1),Z=X[0],$=X[1],ee=l("Book Preview"),oe=ee[0],te=ee[1],ie=l(70),re=ie[0],ne=ie[1],le=a(null),ae=l(!1),de=ae[0],se=ae[1],ce=function(e,i,r,n){return void 0===n&&(n=0),o(void 0,void 0,void 0,(function(){var o,l,a,d,s,c,h,g,p,m,u,f,y,b,v,x,k,C,B,w,j,F,S,D,z,P,A,I,E,L,O,_,T,M;return t(this,(function(t){switch(t.label){case 0:G({textToHighLight:"",content:""}),se(!1),$(!0),te(i),t.label=1;case 1:return t.trys.push([1,4,5,6]),r&&0!==r.length?[4,H([r[n]])]:($(!1),ne(70),null===(T=le.current)||void 0===T||T.resize(70),[2]);case 2:if(o=t.sent(),l=(null==o?void 0:o.data)||o||[],!Array.isArray(l)||0===l.length)return se(!0),$(!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),s=d.split(" ").filter(Boolean),c=[],h=0;h<s.length;h++)for(g=s.length;g>h;g--)j=s.slice(h,g).join(" "),j.split(" ").length>=4&&c.push(j);for(p=null,m=0,u=c;m<u.length;m++){for(j=u[m],f=0,y=l;f<y.length;f++)if(A=y[f],(I=a(A.normalizedContent||A.htmlContent))===j){p=A;break}if(p)break}if(!p)for(b=0,v=c;b<v.length;b++){for(j=v[b],x=new RegExp("\\b".concat(j,"\\b"),"i"),k=0,C=l;k<C.length;k++)if(A=C[k],I=a(A.normalizedContent||A.htmlContent),x.test(I)){p=A;break}if(p)break}if(!p)for(B=0,w=c;B<w.length;B++)if(j=w[B],!((F=j.split(" ")).length<2)){for(S=F[0],D=F[F.length-1],z=0,P=l;z<P.length;z++)if(A=P[z],I=a(A.normalizedContent||A.htmlContent),E=I.indexOf(S),L=I.indexOf(D),-1!==E&&-1!==L&&Math.abs(L-E)<40){p=A;break}if(p)break}return O=l.map((function(e){return e.htmlContent})).join("\n"),p?(G({textToHighLight:p.htmlContent,content:O}),ne(50),null===(M=le.current)||void 0===M||M.resize(50),$(!1),[2]):n+1>=r.length?(se(!0),$(!1),[2]):[4,ce(e,i,r,n+1)];case 3:return[2,t.sent()];case 4:return _=t.sent(),console.error("Highlight error:",_),se(!0),[3,6];case 5:return $(!1),[7];case 6:return[2]}}))}))},he=O.bookAwards,ge=O.bookCopyRight,pe=O.bookDetails,me=O.bookElements,ue=O.bookOverView,fe=O.bookCoverImage,ye=null==pe?void 0:pe.isbn;return i(k,e({open:P,fullWidth:!0,PaperProps:{style:e(e({},null==F?void 0:F.dialogPaper),null==N?void 0:N.dialogDimension)}},{children:r(C,e({style:F.dialogContent},{children:[!T&&i("div",e({style:F.container},{children:r(g,e({direction:"horizontal"},{children:[i(p,e({order:1,ref:le,defaultSize:re||70},{children:r("div",e({style:e(e({},null==F?void 0:F.leftPanel),null==N?void 0:N.leftPanel)},{children:[i("div",e({style:{marginBottom:"24px"}},{children:r(d,e({defaultExpanded:!0,elevation:0,style:F.accordion},{children:[i(s,e({expandIcon:i(c,{}),style:F.accordionSummary},{children:i(B,e({style:F.heading},{children:"Book Overview"}))})),i(w,e({style:F.accordionDetails},{children:ue&&Object.keys(ue).length>0?i(f,{data:ue}):i("div",e({style:F.errorState},{children:"No overview data available."}))}))]}))})),i("div",e({style:{marginBottom:"24px"}},{children:r(d,e({elevation:0,style:F.accordion},{children:[i(s,e({expandIcon:i(c,{}),style:F.accordionSummary},{children:i(B,e({style:F.heading},{children:"Book Manuscript Elements"}))})),i(w,e({style:F.accordionDetails},{children:i(y,{data:me,handleFetchManuscriptElements:L,BookIsbn:ye,updateQuotesToHighLight:ce})}))]}))})),i("div",e({style:{marginBottom:"24px"}},{children:r(d,e({elevation:0,style:F.accordion},{children:[i(s,e({expandIcon:i(c,{}),style:F.accordionSummary},{children:i(B,e({style:F.heading},{children:"Book Metadata Details"}))})),i(w,e({style:F.accordionDetails},{children:pe&&Object.keys(pe).length>0?i(u,{data:pe}):i("div",e({style:F.errorState},{children:"No Book Metadata data available."}))}))]}))})),i("div",e({style:{marginBottom:"24px"}},{children:r(d,e({elevation:0,style:F.accordion},{children:[i(s,e({expandIcon:i(c,{}),style:F.accordionSummary},{children:i(B,e({style:F.heading},{children:"Copyrights & Marketing"}))})),i(w,e({style:F.accordionDetails},{children:ge&&Object.keys(ge).length>0?i(b,{data:ge}):i("div",e({style:F.errorState},{children:"No Copyrights & Marketing data available."}))}))]}))})),i("div",{children:r(d,e({elevation:0,style:F.accordion},{children:[i(s,e({expandIcon:i(c,{}),style:F.accordionSummary},{children:i(B,e({style:F.heading},{children:"People & Awards"}))})),i(w,e({style:F.accordionDetails},{children:he&&Object.keys(he).length>0?i(v,{data:he}):i("div",e({style:F.errorState},{children:"No People & Awards data available."}))}))]}))})]}))})),i(m,{style:{width:"3px",background:"#D1D5DC",cursor:"col-resize"}}),i(p,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(x,{bookOverView:ue,bookCoverImage:fe,onClose:A,clickableElementCategory:oe,quotesToHighLightData:q,updateQuotesToHighLight:ce,citationLoad:Z,previewPage:K,setPreviewPage:U,customStyle:N,comingSoonData:R,isNonHighlightedBlur:I,isBlurToggleVisible:Q,isBookemon:E,noHtmlContent:de})}))]}))})),T?r("div",e({style:F.blurOverlay},{children:[i(j,e({style:F.closeButton,onClick:A},{children:i(h,{})})),i(z,{header:R.header,subheader:R.subheader,icon:R.icon})]})):i(n,{})]}))}))};export{S as comingSoonStyles,P as default,D as defaultIcon};
1
+ import{__assign as e,__awaiter as o,__generator as t}from"../../node_modules/tslib/tslib.es6.mjs.js";import{jsx as i,jsxs as r,Fragment as n}from"react/jsx-runtime";import{useState as l,useRef as a}from"react";import d from"../../node_modules/@material-ui/core/esm/Accordion/Accordion.js";import s from"../../node_modules/@material-ui/core/esm/AccordionSummary/AccordionSummary.js";import c from"../../_virtual/ExpandMore.js";import h from"../../_virtual/Close.js";import{PanelGroup as p,Panel as u,PanelResizeHandle as m}from"../../node_modules/react-resizable-panels/dist/react-resizable-panels.browser.js";import g from"./BookDetailsCard/BookDetailsCard.js";import y from"./BookOverviewCard/BookOverviewCard.js";import v from"./BookElementsCard/BookElementsCard.js";import f from"./BookCopyrightsCard/BookCopyrightsCard.js";import x from"./BookPeopleAwardsCard/BookPeopleAwardsCard.js";import b from"./BookPreview/BookPreview.js";import k from"../../node_modules/@material-ui/core/esm/Dialog/Dialog.js";import C from"../../node_modules/@material-ui/core/esm/DialogContent/DialogContent.js";import B from"../../node_modules/@material-ui/core/esm/Typography/Typography.js";import w from"../../node_modules/@material-ui/core/esm/AccordionDetails/AccordionDetails.js";import j from"../../node_modules/@material-ui/core/esm/IconButton/IconButton.js";var F={dialogPaper:{maxWidth:"none",fontFamily:"Inter, sans-serif"},dialogContent:{padding:0,backgroundColor:"#FFFFFF",overflow:"hidden",height:"90vh",position:"relative"},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=i("svg",e({style:S.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"})})),z=function(o){var t=o.header,n=o.subheader,l=o.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||D}))})),r("div",{children:[i("h1",e({style:S.heading},{children:t})),i("p",e({style:S.text},{children:n}))]})]}))}))},P=function(S){var P=S.open,A=S.onClose,I=S.isNonHighlightedBlur,H=S.isBookemon,E=S.getHighlightContent,L=S.handleFetchManuscriptElements,_=S.data,O=S.showComingSoon,T=void 0!==O&&O,W=S.comingSoonData,M=void 0===W?{header:"Bookemon Coming Soon!!",subheader:"We're working on something amazing. Stay tuned for updates!",icon:D}:W,R=S.customStyle,N=void 0===R?{}:R,V=S.isBlurToggleVisible,Q=void 0!==V&&V,Y=l({textToHighLight:"",content:""}),q=Y[0],G=Y[1],J=l(1),K=J[0],U=J[1],X=l(!1),Z=X[0],$=X[1],ee=l("Book Preview"),oe=ee[0],te=ee[1],ie=l(70),re=ie[0],ne=ie[1],le=a(null),ae=l(!1),de=ae[0],se=ae[1],ce=function(e,i,r,n){return void 0===n&&(n=0),o(void 0,void 0,void 0,(function(){var o,l,a,d,s,c,h,p,u,m,g,y,v,f,x,b;return t(this,(function(t){switch(t.label){case 0:G({textToHighLight:"",content:""}),se(!1),$(!0),te(i),t.label=1;case 1:return t.trys.push([1,5,6,7]),r&&0!==r.length?[4,E([r[n]])]:($(!1),ne(70),null===(x=le.current)||void 0===x||x.resize(70),[2]);case 2:if(o=t.sent(),l=(null==o?void 0:o.data)||o||[],!Array.isArray(l)||0===l.length)return se(!0),$(!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),s=null,c=0,h=l;c<h.length;c++)if(y=h[c],a(y.normalizedContent||y.htmlContent).includes(d)){s=y;break}if(!s)for(p=d.split(" ").filter(Boolean);p.length>0;){for(u=p.join(" "),m=0,g=l;m<g.length;m++)if(y=g[m],a(y.normalizedContent||y.htmlContent).includes(u)){s=y;break}if(s)break;p.pop()}return v=l.map((function(e){return e.htmlContent})).join("\n"),s?(G({textToHighLight:s.htmlContent,content:v}),ne(50),null===(b=le.current)||void 0===b||b.resize(50),$(!1),[2]):n+1<r.length?[4,ce(e,i,r,n+1)]:[3,4];case 3:return[2,t.sent()];case 4:return se(!0),$(!1),[3,7];case 5:return f=t.sent(),console.error("Highlight error:",f),se(!0),[3,7];case 6:return $(!1),[7];case 7:return[2]}}))}))},he=_.bookAwards,pe=_.bookCopyRight,ue=_.bookDetails,me=_.bookElements,ge=_.bookOverView,ye=_.bookCoverImage,ve=null==ue?void 0:ue.isbn;return i(k,e({open:P,fullWidth:!0,PaperProps:{style:e(e({},null==F?void 0:F.dialogPaper),null==N?void 0:N.dialogDimension)}},{children:r(C,e({style:F.dialogContent},{children:[!T&&i("div",e({style:F.container},{children:r(p,e({direction:"horizontal"},{children:[i(u,e({order:1,ref:le,defaultSize:re||70},{children:r("div",e({style:e(e({},null==F?void 0:F.leftPanel),null==N?void 0:N.leftPanel)},{children:[i("div",e({style:{marginBottom:"24px"}},{children:r(d,e({defaultExpanded:!0,elevation:0,style:F.accordion},{children:[i(s,e({expandIcon:i(c,{}),style:F.accordionSummary},{children:i(B,e({style:F.heading},{children:"Book Overview"}))})),i(w,e({style:F.accordionDetails},{children:ge&&Object.keys(ge).length>0?i(y,{data:ge}):i("div",e({style:F.errorState},{children:"No overview data available."}))}))]}))})),i("div",e({style:{marginBottom:"24px"}},{children:r(d,e({elevation:0,style:F.accordion},{children:[i(s,e({expandIcon:i(c,{}),style:F.accordionSummary},{children:i(B,e({style:F.heading},{children:"Book Manuscript Elements"}))})),i(w,e({style:F.accordionDetails},{children:i(v,{data:me,handleFetchManuscriptElements:L,BookIsbn:ve,updateQuotesToHighLight:ce})}))]}))})),i("div",e({style:{marginBottom:"24px"}},{children:r(d,e({elevation:0,style:F.accordion},{children:[i(s,e({expandIcon:i(c,{}),style:F.accordionSummary},{children:i(B,e({style:F.heading},{children:"Book Metadata Details"}))})),i(w,e({style:F.accordionDetails},{children:ue&&Object.keys(ue).length>0?i(g,{data:ue}):i("div",e({style:F.errorState},{children:"No Book Metadata data available."}))}))]}))})),i("div",e({style:{marginBottom:"24px"}},{children:r(d,e({elevation:0,style:F.accordion},{children:[i(s,e({expandIcon:i(c,{}),style:F.accordionSummary},{children:i(B,e({style:F.heading},{children:"Copyrights & Marketing"}))})),i(w,e({style:F.accordionDetails},{children:pe&&Object.keys(pe).length>0?i(f,{data:pe}):i("div",e({style:F.errorState},{children:"No Copyrights & Marketing data available."}))}))]}))})),i("div",{children:r(d,e({elevation:0,style:F.accordion},{children:[i(s,e({expandIcon:i(c,{}),style:F.accordionSummary},{children:i(B,e({style:F.heading},{children:"People & Awards"}))})),i(w,e({style:F.accordionDetails},{children:he&&Object.keys(he).length>0?i(x,{data:he}):i("div",e({style:F.errorState},{children:"No People & Awards data available."}))}))]}))})]}))})),i(m,{style:{width:"3px",background:"#D1D5DC",cursor:"col-resize"}}),i(u,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(b,{bookOverView:ge,bookCoverImage:ye,onClose:A,clickableElementCategory:oe,quotesToHighLightData:q,updateQuotesToHighLight:ce,citationLoad:Z,previewPage:K,setPreviewPage:U,customStyle:N,comingSoonData:M,isNonHighlightedBlur:I,isBlurToggleVisible:Q,isBookemon:H,noHtmlContent:de})}))]}))})),T?r("div",e({style:F.blurOverlay},{children:[i(j,e({style:F.closeButton,onClick:A},{children:i(h,{})})),i(z,{header:M.header,subheader:M.subheader,icon:M.icon})]})):i(n,{})]}))}))};export{S as comingSoonStyles,P as default,D as defaultIcon};
2
2
  //# sourceMappingURL=Bookemon.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BookCitation.d.ts","sourceRoot":"","sources":["../../../../../src/features/BookCitation/BookCitation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAuB,MAAM,OAAO,CAAC;AAIlE,UAAU,iBAAiB;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,uBAAuB,CAAC,EAAE,MAAM,IAAI,CAAC;IACrC,qBAAqB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxC,kBAAkB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACrC,oBAAoB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvC,WAAW,CAAC,EAAE;QACZ,qBAAqB,CAAC,EAAE,aAAa,CAAC;QACtC,KAAK,CAAC,EAAE,aAAa,CAAC;QACtB,cAAc,CAAC,EAAE,aAAa,CAAC;QAC/B,iBAAiB,CAAC,EAAE,aAAa,CAAC;QAClC,UAAU,CAAC,EAAE,aAAa,CAAC;QAC3B,QAAQ,CAAC,EAAE,aAAa,CAAC;QACzB,SAAS,CAAC,EAAE,aAAa,CAAC;QAC1B,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,mBAAmB,CAAC,EAAE,aAAa,CAAC;QACpC,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,oBAAoB,CAAC,EAAE,aAAa,CAAC;QACrC,eAAe,CAAC,EAAE,aAAa,CAAC;KACjC,CAAC;IACF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAED,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAka7C,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"BookCitation.d.ts","sourceRoot":"","sources":["../../../../../src/features/BookCitation/BookCitation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAuB,MAAM,OAAO,CAAC;AAIlE,UAAU,iBAAiB;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,uBAAuB,CAAC,EAAE,MAAM,IAAI,CAAC;IACrC,qBAAqB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxC,kBAAkB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACrC,oBAAoB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvC,WAAW,CAAC,EAAE;QACZ,qBAAqB,CAAC,EAAE,aAAa,CAAC;QACtC,KAAK,CAAC,EAAE,aAAa,CAAC;QACtB,cAAc,CAAC,EAAE,aAAa,CAAC;QAC/B,iBAAiB,CAAC,EAAE,aAAa,CAAC;QAClC,UAAU,CAAC,EAAE,aAAa,CAAC;QAC3B,QAAQ,CAAC,EAAE,aAAa,CAAC;QACzB,SAAS,CAAC,EAAE,aAAa,CAAC;QAC1B,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,mBAAmB,CAAC,EAAE,aAAa,CAAC;QACpC,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,oBAAoB,CAAC,EAAE,aAAa,CAAC;QACrC,eAAe,CAAC,EAAE,aAAa,CAAC;KACjC,CAAC;IACF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAED,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAoc7C,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Bookemon.d.ts","sourceRoot":"","sources":["../../../../../src/features/Bookemon/Bookemon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAY,aAAa,EAAU,MAAM,OAAO,CAAC;AAuI/D,eAAO,MAAM,gBAAgB,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAAA;CA4C5D,CAAC;AACF,eAAO,MAAM,WAAW,yCAcvB,CAAC;AAyBF,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,kBAAkB;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACxB;AAKD,QAAA,MAAM,QAAQ;UAiBN,OAAO;aACJ,MAAM,IAAI;0BACI,OAAO;gBACjB,OAAO;;oCAEY,MAAM,EAAE,KAAK,QAAQ,GAAG,CAAC;;kBAO7C,GAAG;cACP,GAAG;kBACC,MAAM;cACV,GAAG;UACL,QAAQ,GAAG,CAAC;UACZ,GAAG;;;;;eAKA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;6CA2azB,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"Bookemon.d.ts","sourceRoot":"","sources":["../../../../../src/features/Bookemon/Bookemon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAY,aAAa,EAAU,MAAM,OAAO,CAAC;AAuI/D,eAAO,MAAM,gBAAgB,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAAA;CA4C5D,CAAC;AACF,eAAO,MAAM,WAAW,yCAcvB,CAAC;AAyBF,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,kBAAkB;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACxB;AAKD,QAAA,MAAM,QAAQ;UAiBN,OAAO;aACJ,MAAM,IAAI;0BACI,OAAO;gBACjB,OAAO;;oCAEY,MAAM,EAAE,KAAK,QAAQ,GAAG,CAAC;;kBAO7C,GAAG;cACP,GAAG;kBACC,MAAM;cACV,GAAG;UACL,QAAQ,GAAG,CAAC;UACZ,GAAG;;;;;eAKA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;6CA6XzB,CAAC;AAEF,eAAe,QAAQ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-llm-studio/citation",
3
- "version": "0.0.83",
3
+ "version": "0.0.85",
4
4
  "author": "Devesh Patel",
5
5
  "description": "",
6
6
  "license": "MIT",