1(function(e){"use strict";var t,n={},s=!1;if(typeof coauthorsConfig!="undefined"&&coauthorsConfig.enableLogging===!0&&(s=!0),t=s&&typeof t!="undefined"?t:{info:function(){},debug:function(){},warn:function(){}},window.coauthorsIntegrationInitialized){t.info("Co-Authors Integration: Already initialized, skipping");return}window.coauthorsIntegrationInitialized=!0,t.info("Co-Authors Integration: Module initialized"),e(document).ready(function(){if(typeof coauthorsAjax=="undefined")return;t.info("Co-Authors Integration: Document ready triggered");var s,i,n=e(".td-post-author-name, .tdb-author-name");if(t.info("Co-Authors Integration: Found "+n.length+" author elements"),n.each(function(){var n=e(this);n.hasClass("coauthors-immediate-processed")&&t.debug("Co-Authors Integration: Byline processed, content:",n.html())}),n.length===0)return;if(window.coauthorsProcessing){t.info("Co-Authors Integration: Already processing, skipping");return}if(window.coauthorsProcessing=!0,i=n.first(),s=r(i),t.info("Co-Authors Integration: Found post ID: "+s),!s){o()?(t.info("Co-Authors Integration: Author archive page detected - removing loading overlays and marking as processed"),e(".coauthors-authorbox-loading-overlay").remove(),e(".tdb-block-inner").removeClass("coauthors-immediate-processed").css("position",""),n.each(function(){var t=e(this);t.hasClass("coauthors-processed")||t.removeClass("coauthors-immediate-processed").addClass("coauthors-processed")})):(t.warn("Co-Authors Integration: No post ID found and not an author page, marking as processed"),n.each(function(){var t=e(this);!t.hasClass("coauthors-processed")&&!t.hasClass("coauthors-processing")&&t.addClass("coauthors-processed")})),window.coauthorsProcessing=!1;return}n.each(function(){var n,t=e(this);if(t.hasClass("coauthors-processed")||t.hasClass("coauthors-processing"))return;n=t.data("original-content")||t.attr("data-original-content"),n&&t.data("original-content",n),t.addClass("coauthors-processing")}),t.info("Co-Authors Integration: Making AJAX call for post ID: "+s),c(s,n)});function o(){var t=e("body").attr("class");return!!(t&&t.indexOf("archive")!==-1&&t.indexOf("author")!==-1)||window.location.pathname.indexOf("/author/")!==-1}function r(n){if(o())return t.debug("Co-Authors Integration: Author archive page detected, no post ID available"),null;var i,a,r,c,l,d,u,h,m,p,s=null,f=e("body").attr("class");return f&&(r=f.match(/postid-(\d+)/),r)?(s=parseInt(r[1]),s):(i=n.closest('[class*="post-"]'),i.length>0&&(c=i.attr("class"),c&&(l=c.match(/post-(\d+)/),l&&(s=parseInt(l[1]))),!s&&i.attr("id")&&(p=i.attr("id"),d=p.match(/post-(\d+)/),d&&(s=parseInt(d[1]))),s||(s=i.data("post-id")||i.data("postId"),s&&(s=parseInt(s)))),s||(u=n.closest(".tdb-template, article").find('a[href*="p="], a[href*="post"], a[href*="?post_type="]'),u.length>0&&(a=u.first().attr("href"),a&&(h=new URLSearchParams(a.split("?")[1]),s=parseInt(h.get("p"))||parseInt(h.get("post_id")),s||(m=a.match(/\/post\/(\d+)/)||a.match(/\/(\d+)\/$/),m&&(s=parseInt(m[1])))))),s)}function c(s,o){if(n[s]){i(n[s],o);return}t.info("Co-Authors Integration: AJAX call starting for post ID: "+s),e.ajax({url:coauthorsAjax.ajaxurl,type:"POST",data:{action:coauthorsAjax.action,post_id:s},success:function(e){t.info("Co-Authors Integration: AJAX success for post ID: "+s),t.debug("Co-Authors Integration: Raw response:",e);try{var a=typeof e=="object"?e:JSON.parse(e);t.debug("Co-Authors Integration: Parsed data:",a),t.debug("Co-Authors Integration: author_links content:",a.author_links),t.debug("Co-Authors Integration: all_authors_data length:",a.all_authors_data?a.all_authors_data.length:0),n[s]=a,typeof coauthorsAuthorData!="undefined"&&(coauthorsAuthorData.all_authors_data=a.all_authors_data||[],coauthorsAuthorData.author_links=a.author_links),i(a,o)}catch(n){t.warn("Co-Authors Plus integration error: Invalid JSON response"),t.warn("Response was:",e),t.warn("Parse error:",n),o.removeClass("coauthors-processing").addClass("coauthors-processed")}},error:function(e,n,s){t.warn("Co-Authors Plus integration error:",s),window.coauthorsProcessing=!1,o.removeClass("coauthors-processing").addClass("coauthors-processed")}})}function i(n,s){if(t.debug("Co-Authors Integration: Handling response"),n.author_links&&n.author_links.trim()!=="")if(s.each(function(){var i,a,s=e(this),o=!1;s.hasClass("tdb-author-name")&&(i=s.closest(".tdb-author-name-wrap"),i.length>0&&i.find(".tdb-author-by").length>0?(o=!0,t.debug("Co-Authors Integration: Found byline wrapper")):(a=s.closest(".tdb-block-inner"),a.length>0&&a.find(".tdb-author-photo").length>0?(t.debug("Co-Authors Integration: Found author box element, skipping"),o=!1):(t.warn("Co-Authors Integration: Unknown element structure, treating as byline"),o=!0))),o?(t.info("Co-Authors Integration: Replacing byline wrapper"),l(s,n.author_links)):t.debug("Co-Authors Integration: Skipping author box element")}),t.debug("Co-Authors Integration: Checking if author box update needed"),t.debug("Co-Authors Integration: all_authors_data length:",n.all_authors_data?n.all_authors_data.length:0),n.all_authors_data&&n.all_authors_data.length>0)t.info("Co-Authors Integration: Calling updateAuthorBoxes with multiple authors:",n.all_authors_data.length),a(n.all_authors_data,n.author_links);else if(n.author_data&&n.author_data.length>0)t.info("Co-Authors Integration: Calling updateAuthorBoxes with author_data"),a(n.author_data,n.author_links);else{var o=e(".tdb-author-photo").closest(".tdb-block-inner");o.length>0&&u(o)}else t.warn("Co-Authors Integration: author_links condition failed - keeping loading placeholder"),s.removeClass("coauthors-processing").addClass("coauthors-processed");window.coauthorsProcessing=!1,t.info("Co-Authors Integration: Processing complete")}function l(n,s){t.debug("Co-Authors Integration: Author links received:",s);var i,a,o=n.closest(".tdb-author-name-wrap");o.length>0&&o.find(".tdb-author-by").length>0?(t.info("Co-Authors Integration: Found byline wrapper - replacing with span to avoid nested <a>"),o.find(".tdb-author-name").remove(),i='<span class="tdb-author-name">'+s+"</span>",o.find(".tdb-author-by").after(i),t.debug("Co-Authors Integration: Wrapper HTML after update:",o.html())):(t.debug("Co-Authors Integration: Standard replacement for author box"),t.debug("Co-Authors Integration: Target element before update:",n.html()),n.html(s),t.debug("Co-Authors Integration: Target element after update:",n.html())),a=o.length>0?o:n.closest(".tdb-author-box, .tdb-block-inner"),a.find("a").each(function(){var n,o,i,s=e(this),a=s.text().trim();if(t.debug("Co-Authors Integration: Processing link:",a),o=!1,typeof coauthorsAuthorData!="undefined"&&coauthorsAuthorData.all_authors_data)for(n=0;n<coauthorsAuthorData.all_authors_data.length;n++)if(i=coauthorsAuthorData.all_authors_data[n],i.display_name===a&&i.type==="guest-author"){o=!0,t.debug("Co-Authors Integration: Found guest author, remov
1ing href");break}o&&(s.removeAttr("href"),s.removeAttr("title"))}),n.removeClass("coauthors-processing").addClass("coauthors-processed")}function a(n,s){t.info("Co-Authors Integration: updateAuthorBoxes called with",n.length,"authors");var o,a,r,c,l,u,i=e(".tdb-author-photo").closest(".tdb-block-inner");if(i.length===0&&(i=e(".tdb-author-info").closest(".tdb-block-inner")),i.length===0&&(i=e('[class*="tdb-block-inner"]').filter(function(){return e(this).find(".tdb-author-name, .tdb-author-info").length>0})),t.debug("Co-Authors Integration: Author box found:",i.length),i.length===0){t.warn("Co-Authors Integration: No author box found, returning");return}l=i.first(),i.not(l).remove();for(o=1;o<n.length;o++)a=l.clone(),a.find(".coauthors-loading-overlay").remove(),a.removeClass("coauthors-immediate-processed"),a.find(".tdb-author-photo, .tdb-author-name, .tdb-author-url, .tdb-author-descr").html(""),l.after(a),t.info("Co-Authors Integration: Created author box",o+1);r=e(".tdb-author-photo").closest(".tdb-block-inner"),r.find(".coauthors-authorbox-loading-overlay").remove(),t.debug("Co-Authors Integration: Total author boxes to process:",r.length);for(o=0;o<n.length&&o<r.length;o++)u=n[o],c=r.eq(o),t.debug("Co-Authors Integration: Author box mapping:"),t.debug(" - Box index:",o),t.debug(" - Author data:",u.display_name,"Type:",u.type),t.debug(" - Box element .tdb-author-name:",c.find(".tdb-author-name").text()),t.debug(" - Box before update .tdb-author-name:",c.find(".tdb-author-name").html()),d(c,u,s),t.debug(" - Box after update .tdb-author-name:",c.find(".tdb-author-name").html());t.info("Co-Authors Integration: All author boxes updated")}function d(n,s){if(t.info("Co-Authors Integration: updateSingleAuthorBox called for:",s.display_name),n.hasClass("coauthors-immediate-processed")&&(t.debug("Co-Authors Integration: Removing loading overlay"),n.find(".coauthors-authorbox-loading-overlay").remove(),n.css("position",""),n.removeClass("coauthors-immediate-processed"),t.debug("Co-Authors Integration: Loading overlay removed and class removed")),t.debug("Co-Authors Integration: Updating author box content for:",s.display_name),s.avatar_html){t.debug("Co-Authors Integration: Replacing author photo with avatar HTML for:",s.display_name),t.debug("Co-Authors Integration: Author type:",s.type),t.debug("Co-Authors Integration: Avatar HTML:",s.avatar_html);var i,r,c,l,d,u,h,a=n.find(".tdb-author-photo");a.length>0?s.type==="guest-author"?(t.debug("Co-Authors Integration: Processing guest author - removing href and title"),n.addClass("tdb-guest-author-box"),a.removeAttr("href"),a.removeAttr("title"),a.html(s.avatar_html),t.debug("Co-Authors Integration: Removed href and title, updated content for guest author")):(t.debug("Co-Authors Integration: Regular user - updating photo and link"),a.html(s.avatar_html),s.author_url&&(a.attr("href",s.author_url),a.attr("title",s.display_name),t.debug("Co-Authors Integration: Updated photo href and title"))):(t.warn("Co-Authors Integration: No .tdb-author-photo found, updating all photos in box"),n.find("img").each(function(){var n=e(this);n.hasClass("avatar")&&(n.replaceWith(s.avatar_html),t.debug("Co-Authors Integration: Replaced avatar image"))}))}r=n.find(".tdb-author-name"),r.length>0&&(r.is("a")?i=r:(i=r.find("a"),i.length===0&&(i=r)),s.type==="guest-author"?(i.text(s.display_name),i.removeAttr("href"),i.removeAttr("title")):s.author_url?(u="Posts by "+s.display_name,i.html('<a href="'+s.author_url+'" title="'+u+'">'+s.display_name+"</a>")):i.text(s.display_name)),c=n.find(".tdb-author-url"),c.length>0&&(s.website&&s.website.trim()!==""?(c.attr("href",s.website),c.text(s.website),c.show()):c.remove()),l=n.find(".tdb-author-descr"),l.length>0&&(s.description&&s.description.trim()!==""?(h=!1,typeof coauthorsConfig!="undefined"&&coauthorsConfig.allowHtmlInDescriptions===!0&&(h=!0),l.html(s.description),l.show()):l.hide()),d=n.find(".tdb-author-social"),d.length>0&&(t.info("Co-Authors Integration: Removing social links for co-author:",s.display_name),d.remove()),n.find('[style*="display: none"]').each(function(){var s=e(this),n=s.attr("class");
1n&&(n.indexOf("social")!==-1||n.indexOf("contact")!==-1||n.indexOf("widget")!==-1)&&(t.debug("Co-Authors Integration: Removing hidden element:",n),s.remove())}),t.debug("Co-Authors Integration: Single author box update complete for:",s.display_name)}function u(e){t.debug("Co-Authors Integration: Removing loading overlay"),e.find(".coauthors-authorbox-loading-overlay").remove(),e.css("position",""),e.removeClass("coauthors-immediate-processed"),t.debug("Co-Authors Integration: Loading overlay removed and class removed")}})(jQuery)
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.