1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1457],{1457:(t,e,n)=>{n.r(e),n.d(e,{default:()=>v});var r=n(24220),a=n(55434),i=n(9090),o=n(71568),s=n(87747),u=n(43914),c=n(15081),l=n(64641),p=n(80670),d=n(28990),m=n(46593),h=n(65814),g=n(7631),f=n(19568);let v=function(){var t,e=Number((0,h.vh)().id),n=(0,h.x_)(),v=(0,d.A)(),_=(0,o.d4)(g.$0),b=_.data,x=_.status,j=(0,r._)((0,i.useState)(null),2),y=j[0],k=j[1],w=(0,r._)((0,i.useState)(!1),2),T=w[0],P=w[1],S=(0,r._)((0,i.useState)(!1),2),A=S[0],E=S[1];if((0,i.useEffect)(function(){var t=document.title.split(" - ")[0]||"Thingiverse";document.title="Report Thing:".concat(e," - ").concat(t)},[e]),(0,i.useEffect)(function(){x!==p.G.Loading&&(b||n.replace("/login?redirect=/thing:".concat(e,"/report")))},[b,x,n,e]),(0,i.useEffect)(function(){b&&e&&s.A.getCustom(e,["name","creator"]).then(k).catch(function(t){var e;return P((null==t||null==(e=t.response)?void 0:e.status)===404)})},[b,e]),T)return(0,a.jsx)(m.default,{});var N=(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(h.Ez,{to:(0,f.oN)({id:e}),children:null!=(t=null==y?void 0:y.name)?t:"this Thing"}),(null==y?void 0:y.creator)?(0,a.jsxs)(a.Fragment,{children:[" by ",y.creator.name]}):null]});return(0,a.jsx)(u.P,{children:(0,a.jsxs)("div",{className:"mx-auto box-border w-full max-w-2xl px-4 pb-16",children:[(0,a.jsx)("h1",{className:"py-6 text-content-primary",children:"Report as inappropriate"}),(0,a.jsx)(l.Z,{children:(0,a.jsx)(c.d,{entityLink:N,submitAriaLabel:"Report Thing",withReasonPicker:!0,submitting:A,onSubmit:function(t){E(!0),s.A.report(e,t).then(function(){v.success("Report submitted","Thanks for your report. We'll take a look at it as soon as possible."),n.push("/thing:".concat(e))}).catch(function(t){var e,n,r,a,i,o,s=null!=(e=null!=(n=null==t||null==(a=t.response)||null==(r=a.data)?void 0:r.detail)?n:null==t||null==(o=t.response)||null==(i=o.data)?void 0:i.error)?e:"Unable to submit your report. Please try again.";v.error("Something went wrong",s),E(!1)})}})})]})})}},87747:(t,e,n)=>{n.d(e,{A:()=>u});var r=n(18220),a=n(6946),i=n(37076),o=n(74556),s=n(24220);let u=Object.freeze(new(function(t){function e(){var t;return((0,a._)(this,e),(t=(0,r._)(this,e,["/v2/things"])).getSummary=function(e,n){var r=t.getThingParams(n);return t.get("/".concat(e,"/summary"),r)},t.getComplete=function(e,n){var r=t.getThingParams(n);return t.get("/".concat(e,"/complete"),r)},t.getCustom=function(e,n,r){var a=t.getThingParams(r);return a.append("return","custom"),a.append("fields",n.join(",")),t.get("/".concat(e,"/custom"),a)},t.report=function(e,n){return t.post("/".concat(e,"/report"),n)},e._instance)?(0,o._)(t,e._instance):(e._instance=t,t)}return(0,i._)(e,t),e.prototype.getThingParams=function(t){var e=new URLSearchParams;if(t){var n=(0,s._)(t.split("_"),2),r=n[0],a=n[1];e.append("image_type",r),e.append("image_size",a)}return e},e}(n(39400).A)))}}]);
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.