PageSourceSearch

https://fossilsketch.org/_next/static/chunks/6870-25965ed0b4cc2a1f.js

js fossilsketch.org collected 2026-10-09 00:41:57 UTC 8,450 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6870],{1191:function(e,r,t){"use strict";t.d(r,{Z:function(){return o}});var n=t(2784),a=t(2589);function o(e){var r=e.activityKey,t=e.classroomId,o=(0,n.useRef)(Date.now()),i=(0,n.useRef)(!0),s=(0,n.useRef)(0),u=(0,n.useRef)(0),c=(0,n.useRef)(0),l=(0,n.useRef)(null),d=a.S.useMutation(["user.logActivityTime"]).mutate;return(0,n.useEffect)((function(){if(Number.isFinite(t)&&!(t<=0)&&r){o.current=Date.now(),i.current=!0,s.current=0,u.current=0,c.current=0;var e=function(){var e=function(){var e=Date.now(),r=i.current?e-o.current:0;return Math.floor((s.current+r)/1e3)}()-u.current-c.current;e<=0||(c.current+=e,d({classroomId:t,activityKey:r,seconds:e},{onSuccess:function(){u.current+=e,c.current=Math.max(0,c.current-e)},onError:function(r){console.error("Failed to log activity time",r),c.current=Math.max(0,c.current-e)}}))},n=function(){var r=Date.now();"hidden"===document.visibilityState?(i.current&&(s.current+=r-o.current,i.current=!1),e()):i.current||(o.current=r,i.current=!0)},a=function(){var e=Date.now();i.current&&(s.current+=e-o.current,i.current=!1);var n=Math.floor(s.current/1e3)-u.current-c.current;n>0&&function(e){if(!e||e<=0)return!1;var n=new Blob([JSON.stringify({0:{classroomId:t,activityKey:r,seconds:Math.round(e)}})],{type:"application/json"});try{var a;return Boolean(null===(a=navigator.sendBeacon)||void 0===a?void 0:a.call(navigator,"/api/trpc/user.logActivityTime?batch=1",n))}catch(o){return console.error("Beacon failed",o),!1}}(n)&&(u.current+=n)};return document.addEventListener("visibilitychange",n),window.addEventListener("pagehide",a),l.current=window.setInterval(e,5e3),function(){document.removeEventListener("visibilitychange",n),window.removeEventListener("pagehide",a),l.current&&clearInterval(l.current),i.current&&(s.current+=Date.now()-o.current,i.current=!1);var e=Math.floor(s.current/1e3)-u.current-c.current;e>0&&d({classroomId:t,activityKey:r,seconds:e})}}}),[r,t]),null}},9454:function(e,r,t){"use strict";t.d(r,{DE:function(){return g},Ix:function(){return u},JF:function(){return p},Kk:function(){return v},NO:function(){return d},a9:function(){return h},ao:function(){return m},h0:function(){return i},yk:function(){return b}});var n=t(8788),a=t(2838),o=t(2970);function i(e,r,t){return s.apply(this,arguments)}function s(){return(s=(0,n.Z)((function(e,r,t){return(0,o.__generator)(this,(function(n){return(0,a.Z)(e,File)?[2,new Promise((function(n,a){var o=new FormData;o.append("image",e),o.append("fossilType",r);var i=new XMLHttpRequest;i.upload.addEventListener("progress",(function(e){if(e.lengthComputable){var r=Math.round(e.loaded/e.total*100);t({percentage:r,status:"uploading"})}})),i.addEventListener("load",(function(){if(i.status>=200&&i.status<300)try{var e=JSON.parse(i.responseText);e.imagePath?(t({percentage:100,status:"success"}),n(e.imagePath)):(t({percentage:100,status:"error",error:"No image path in response"}),a(new Error("No image path in response")))}catch(r){t({percentage:100,status:"error",error:"Failed to parse response"}),a(new Error("Failed to parse response"))}else t({percentage:100,status:"error",error:"Upload failed: ".concat(i.status)}),a(new Error("Upload failed with status ".concat(i.status)))})),i.addEventListener("error",(function(){t({percentage:0,status:"error",error:"Network error"}),a(new Error("Network error"))})),i.open("POST","/api/uploadImage"),i.send(o)}))]:[2]}))}))).apply(this,arguments)}function u(e,r){return c.apply(this,arguments)}function c(){return(c=(0,n.Z)((function(e,r){var t,n,i,s;return(0,o.__generator)(this,(function(o){switch(o.label){case 0:return(0,a.Z)(e,File)?((t=new FormData).append("image",e),t.append("fossilType",r),i={},[4,fetch("/api/uploadImage",(i.method="POST",i.body=t,i))]):[2];case 1:return[4,(n=o.sent()).json().catch((function(){return{}}))];case 2:if(s=o.sent(),!n.ok)throw new Error("string"===typeof s.error?s.error:"Upload failed (".concat(n.status,")"));if(s.imagePath)return[2,s.imagePath];throw new Error("Server did not return an image path")}}))}))).apply(this,arguments)}function l(){var e=window.location,r=e.hostname,t=e.protocol;return"localhost"===r||"127.0.0.1"===r?"".concat(t,"//").concat(r,":8000/api/uploadImage"):"/api/uploadImage"}function d(e,r){return f.apply(this,arguments)}function f(){return(f=(0,n.Z)((function(e,r){return(0,o.__generator)(this,(function(t){if(!(0,a.Z)(e,File))throw new Error("Invalid file");return[2,new Promise((function(t,n){var a=new FormData;a.append("image",e),a.append("fossilType","3D_models");var o=new XMLHttpRequest;o.withCredentials=!0,o.upload.addEventListener("progress",(function(e){if(e.lengthComputable){var t=Math.min(99,Math.round(e.loaded/e.total*100));null===r||void 0===r||r({percentage:t,status:"uploading"})}})),o.addEventListener("load",(function(){var e={};try{e=JSON.parse(o.responseText||"{}")}catch(i){}if(o.status>=200&&o.status<300&&e.imagePath)return null===r||void 0===r||r({percentage:100,status:"success"}),void t(e.imagePath);var a="string"===typeof e.error?e.error:"Upload failed (".concat(o.status||"network",")");null===r||void 0===r||r({percentage:0,status:"error",error:a}),n(new Error(a))})),o.addEventListener("error",(function(){null===r||void 0===r||r({percentage:0,status:"error",error:"Network error"}),n(new Error("Network error during model upload"))})),o.addEventListener("timeout",(function(){n(new Error("Upload timed out"))})),o.open("POST",l()),o.timeout=6e5,null===r||void 0===r||r({percentage:0,status:"uploading"}),o.send(a)}))]}))}))).apply(this,arguments)}function p(e,r){if(!(null===e||void 0===e?void 0:e.trim()))return null;var t=e.trim(),n=t.startsWith("{")||/sketchfab\.com/i.test(t);if(!n&&/\.(glb|gltf)$/i.test(t))return/^https?:\/\//i.test(t)||t.startsWith("/")?t:h(t.startsWith("/")?t.slice(1):t);if(null===r||void 0===r?void 0:r.trim()){var a=r.toLowerCase().replace(/^fossil\s+/,"").trim(),o="trifarina"===a?"trifarina_angulosa":a.replace(/ /g,"_");
1return"https://storage.googleapis.com/fossilsketch/3D_models/".concat(o,".glb")}return null}function m(e,r){return _.apply(this,arguments)}function _(){return(_=(0,n.Z)((function(e,r){var t;return(0,o.__generator)(this,(function(n){switch(n.label){case 0:return""===e?[3,2]:(t={},[4,fetch("/api/deleteImage",(t.method="POST",t.headers={"Content-Type":"application/json"},t.body=JSON.stringify({fileName:e,fossilType:r.toLowerCase()}),t)).then((function(e){return e.json()}))]);case 1:n.sent(),n.label=2;case 2:return[2]}}))}))).apply(this,arguments)}function h(e){if(e.startsWith("http"))return e;return"https://storage.googleapis.com/".concat("fossilsketch","/").concat(e.startsWith("/")?e.substring(1):e)}function g(e){var r=e.toLowerCase();return"foraminifera"===r||"forams"===r||"morphotype"===r||"morphotypes"===r?"foraminifera":"ostracoda"===r?"ostracoda":r}function v(e,r){if(!(null===e||void 0===e?void 0:e.trim()))return null;var t=e.trim();if(/^https?:\/\//i.test(t))return t;if(t.startsWith("/api/uploads/"))return t;var n=g(r),a=t.replaceAll(" ","");return a.includes("/")||(a="".concat(n,"/").concat(a)),"localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname?"/api/uploads/".concat(a):h(a)}function b(e){return w.apply(this,arguments)}function w(){return(w=(0,n.Z)((function(e){var r,t;return(0,o.__generator)(this,(function(n){switch(n.label){case 0:return""===e?[3,2]:(t={},[4,fetch("/api/fetchImageNames",(t.method="POST",t.headers={"Content-Type":"application/json"},t.body=JSON.stringify({folderName:e}),t)).then((function(e){return e.json()}))]);case 1:return(r=n.sent()).imagePaths?[2,r.imagePaths]:[2,[]];case 2:return[2]}}
1))}))).apply(this,arguments)}},4546:function(e){e.exports={sidebar:"assemblage_sidebar_sidebar__1i_Aj",sidebar_header:"assemblage_sidebar_sidebar_header___mRaT",radio_container:"assemblage_sidebar_radio_container__s0Eii",radio_container_label:"assemblage_sidebar_radio_container_label__0StJo",fossil_image:"assemblage_sidebar_fossil_image__y_SYj",fossil_name:"assemblage_sidebar_fossil_name__W1fSV",fossil_list:"assemblage_sidebar_fossil_list__3v8iO",increment_counter:"assemblage_sidebar_increment_counter__2iX2M",plus_minus:"assemblage_sidebar_plus_minus__WY4gx",fossil_container:"assemblage_sidebar_fossil_container__MiVT0",answer_count:"assemblage_sidebar_answer_count__uYySW",submit_button:"assemblage_sidebar_submit_button__fusSy",correct_number:"assemblage_sidebar_correct_number__1HMLo"}}}]);

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.