1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2286],{97609:function(e,t,n){n.d(t,{ZP:function(){return en}});var l=n(57437),r=n(2265),a=n(96362),i=n(33245),s=n(32489),o=n(53113),c=n(99397),d=n(82431),u=n(82023),f=n(40875),h=n(14064),x=n(84121),p=n(67136),m=n(43792),v=n(66848),g=n(77543),b=n(39334),y=n(49232),N=n(58633),j=n(7778),w=n(32379),S=n(66280);let k="reference-panel",_="reference-image-influence-badge";function R(e){return"string"==typeof e&&e.includes(S.lI.VISION)}let E="reference_panel_opened",I="reference_toggled",C="reference_url_added",L="regenerate_with_references",Z=Object.freeze({INCLUDE:"include",EXCLUDE:"exclude"}),A=Object.freeze({RESOLVED:"resolved",NOT_FOUND:"not_found",INVALID:"invalid"});function P(e){return(null==e?void 0:e.added)?A.RESOLVED:(null==e?void 0:e.error)===S.FS.LISTING_NOT_IN_INDEX?A.NOT_FOUND:A.INVALID}let T=new Set([S.jz.GROUNDED,S.jz.CANDIDATES_ONLY]),Q=e=>{var t;return String(null!==(t=null==e?void 0:e.listingId)&&void 0!==t?t:"")};function U(e){return"number"!=typeof e||!Number.isFinite(e)||e<0?null:e.toLocaleString()}function D(e){let t=Number(e);return!Number.isFinite(t)||t<0?null:t<12?"".concat(Math.round(t)," ").concat(S.QZ.ageMonthsSuffix):"".concat(Math.floor(t/12)," ").concat(S.QZ.ageYearsSuffix)}var z=n(15127);function O(e){var t,n;let{reference:r,pinned:a,excluded:i,position:s,onToggle:o}=e,c=Q(r),d=null!==(t=null==r?void 0:r.title)&&void 0!==t?t:"",u=null!==(n=null==r?void 0:r.shopName)&&void 0!==n?n:"",f=U(null==r?void 0:r.estMoSales);return(0,l.jsxs)("li",{className:"flex items-start gap-2 border-b border-lv-border-subtle py-1.5 last:border-b-0","data-testid":"reference-row","data-listing-id":c,children:[(0,l.jsx)("label",{className:"flex min-h-[44px] min-w-[44px] shrink-0 cursor-pointer items-center justify-center",children:(0,l.jsx)(N.Z,{checked:!i,onChange:()=>o(c,s,i),inputProps:{"aria-label":"".concat(S.QZ.includeReferencePrefix," ").concat(d)}})}),(0,l.jsx)("span",{className:"mt-0.5 h-10 w-10 shrink-0 overflow-hidden rounded-lg bg-lv-elevated",children:(null==r?void 0:r.primaryImage)?(0,l.jsx)("img",{src:r.primaryImage,alt:"",loading:"lazy",className:"h-full w-full object-cover"}):null}),(0,l.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,l.jsx)("p",{className:"truncate text-[13px] font-medium leading-5 text-lv-text-primary",children:d}),(0,l.jsx)("p",{className:"truncate text-[12px] leading-4 text-lv-text-secondary",children:u?"".concat(S.QZ.shopPrefix," ").concat(u):null}),(0,l.jsxs)("p",{className:"text-[12px] leading-4 text-lv-text-tertiary",children:[f?(0,l.jsxs)("span",{children:[(0,l.jsxs)("span",{"aria-hidden":"true",children:[S.QZ.estimatedPrefix," ",f,S.QZ.monthlySalesSuffix]}),(0,l.jsxs)("span",{className:"sr-only",children:[S.QZ.estimatedSrLabel," ",f," ",S.QZ.monthlySalesSrSuffix]})]}):null,a?(0,l.jsx)("span",{className:"ml-2 rounded-full bg-lv-selected-light px-1.5 py-0.5 text-[11px] leading-4 text-lv-selected",children:S.QZ.pinnedRowLabel}):null]})]})]})}function M(){return(0,l.jsx)("ul",{className:"list-none","aria-label":S.QZ.loadingRowsLabel,"aria-busy":"true","data-testid":"reference-skeleton",children:Array.from({length:3},(e,t)=>(0,l.jsxs)("li",{className:"flex items-center gap-2 border-b border-lv-border-subtle py-1.5 last:border-b-0",children:[(0,l.jsx)("span",{className:"h-[18px] w-[18px] shrink-0 animate-pulse rounded bg-lv-elevated"}),(0,l.jsx)("span",{className:"h-10 w-10 shrink-0 animate-pulse rounded-lg bg-lv-elevated"}),(0,l.jsxs)("span",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,l.jsx)("span",{className:"h-3 w-2/3 animate-pulse rounded bg-lv-elevated"}),(0,l.jsx)("span",{className:"h-3 w-1/3 animate-pulse rounded bg-lv-elevated"})]})]},t))})}function F(){return(0,l.jsxs)("span",{"data-testid":_,className:"inline-flex shrink-0 items-center gap-1 rounded-lv-full border px-2 py-0.5 text-lv-caption",style:{color:g.oR.accent,backgroundColor:g.oR.accentBg,borderColor:g.oR.accentBorder},children:[(0,l.jsx)(o.Z,{size:16,"aria-hidden":"true",className:"shrink-0"}),S.QZ.imageInfluenceBadge]})}function G(e){var t,n,a;let{grounding:i,surface:s,defaultExpanded:o=!1,tokenCost:c,testId:h=k}=e,x=(0,r.useId)(),p="grounding-disclosure-".concat(x),m="grounding-region-".concat(x),g="grounding-url-".concat(x),N="grounding-url-hint-".concat(x),_="grounding-url-error-".concat(x),[A,U]=(0,r.useState)(o),[D,G]=(0,r.useState)(""),[K,V]=(0,r.useState)(!1),[B,q]=(0,r.useState)(!1),H=(0,r.useRef)(!0);(0,r.useEffect)(()=>(H.current=!0,()=>{H.current=!1}),[]);let X=null!==(t=null==i?void 0:i.status)&&void 0!==t?t:S.jz.IDLE,W=null!==(n=null==i?void 0:i.reason)&&void 0!==n?n:null,J=(0,S.j6)(X,W),Y=R(null==i?void 0:i.seedSource),$=(0,r.useMemo)(()=>Array.isArray(null==i?void 0:i.references)?i.references:[],[null==i?void 0:i.references]),ee=(0,r.useMemo)(()=>Array.isArray(null==i?void 0:i.pinnedReferences)?i.pinnedReferences:[],[null==i?void 0:i.pinnedReferences]),et=(0,r.useMemo)(()=>new Set(Array.isArray(null==i?void 0:i.excludedIds)?i.excludedIds:[]),[null==i?void 0:i.excludedIds]),en=(0,r.useMemo)(()=>[...$.map(e=>({reference:e,pinned:!1}
1)),...ee.map(e=>({reference:e,pinned:!0}))],[$,ee]),el=(Number(null==i?void 0:i.generationSeq)||0)>0,er=(0,r.useMemo)(()=>{let e=en.filter(e=>{let{reference:t}=e;return et.has(Q(t))}).length;return{selectedCount:en.length-e,excludedCount:e,pinnedCount:ee.length}},[et,ee,en]),ea=!!(null==i?void 0:i.loading)||X===S.jz.LOADING,ei=!!(null==i?void 0:i.regenerating),es=Number(null==i?void 0:i.retryAfterSeconds)||0,eo=es>0,ec=null!==(a=null==i?void 0:i.urlError)&&void 0!==a?a:null,ed=ee.length>=w.GROUNDING_LIMITS.references.maxPinned,eu=(0,w.FL)(D),ef=D.trim();(0,r.useEffect)(()=>{if(!ef||eu){V(!1);return}let e=setTimeout(()=>V(!0),350);return()=>clearTimeout(e)},[ef,eu]);let[eh,ex]=(0,r.useState)(o),ep=(0,r.useRef)(null),em=(0,r.useCallback)(()=>{var e;A||(U(!0),null==i||null===(e=i.fetchPreview)||void 0===e||e.call(i),(0,z.L)(E,{...s?{surface:s}:{},referenceCount:en.length,status:X}))},[A,i,en.length,X,s]),ev=(0,r.useCallback)(()=>{if(!A){ex(!0),em();return}if(!eh){ex(!0);return}ex(!1),U(!1)},[A,em,eh]),eg=(0,r.useCallback)(()=>{var e;!eh&&(null!==(e=ep.current)&&void 0!==e&&e.contains(document.activeElement)||U(!1))},[eh]),eb=(0,r.useCallback)((e,t,n)=>{if("function"==typeof(null==i?void 0:i.toggleReference))return(0,z.L)(I,{direction:n?Z.INCLUDE:Z.EXCLUDE,position:t}),i.toggleReference(e)},[i]),ey=(0,r.useCallback)(e=>{var t;G(e.target.value),(null==i?void 0:i.urlError)&&(null==i||null===(t=i.clearUrlError)||void 0===t||t.call(i))},[i]),eN=(0,r.useCallback)(async()=>{if(!eu||B||ed)return;let e=null==i?void 0:i.addReferenceUrl;q(!0);try{let t=await (null==e?void 0:e(ef));"function"==typeof e&&(0,z.L)(C,{outcome:P(t)}),H.current&&(null==t?void 0:t.added)&&G("")}finally{H.current&&q(!1)}},[B,i,ed,ef,eu]),ej=(0,r.useCallback)(e=>{"Enter"===e.key&&(e.preventDefault(),eN())},[eN]),ew=(0,r.useCallback)(()=>{var e;return null==i?void 0:null===(e=i.fetchPreview)||void 0===e?void 0:e.call(i,{force:!0})},[i]),eS=(0,r.useCallback)(()=>{if("function"==typeof(null==i?void 0:i.regenerateWithSelected))return(0,z.L)(L,er),i.regenerateWithSelected()},[er,i]),ek=!!(null==i?void 0:i.referencesRefreshed),e_=(0,r.useCallback)(()=>{var e;return null==i?void 0:null===(e=i.acknowledgeRefresh)||void 0===e?void 0:e.call(i)},[i]),eR=T.has(X)&&en.length>0,eE=T.has(X)&&0===en.length,eI=X===S.jz.ERROR,eC=!!(null==i?void 0:i.canRegenerate)&&!eo,eL=eu&&!B&&!ed,eZ=ec?(0,S.KJ)(ec):K?(0,S.KJ)("INVALID_ETSY_URL"):null,eA=Number(null==i?void 0:i.generationSeq)||0,eP=(0,r.useRef)(0);if((0,r.useEffect)(()=>{var e;0!==eA&&T.has(X)&&!(en.length>0)&&eP.current!==eA&&(eP.current=eA,null==i||null===(e=i.fetchPreview)||void 0===e||e.call(i,{force:!0}))},[eA,X,en.length]),!i||J.hidden||!el||0===en.length)return null;let eT="".concat(en.length," ").concat(1===en.length?S.QZ.summaryUnit:"".concat(S.QZ.summaryUnit,"s"));return(0,l.jsxs)("section",{ref:ep,"data-testid":h,"data-surface":s,"data-grounding-status":X,"data-grounding-reason":null!=W?W:void 0,"data-variant":"compact-row",onMouseEnter:em,onMouseLeave:eg,className:["w-full",A?"rounded-xl border border-lv-border bg-lv-card px-2.5 py-2":""].join(" "),children:[(0,l.jsx)("h3",{className:"m-0",children:(0,l.jsxs)("button",{type:"button",id:p,"aria-expanded":A,"aria-controls":m,onClick:ev,className:["flex w-full items-center gap-1.5 rounded-lg bg-transparent px-1 text-left outline-none transition-colors hover:bg-lv-hover focus-visible:ring-2 focus-visible:ring-lv-selected",A?"min-h-[44px]":"min-h-[28px] py-0.5"].join(" "),children:[(0,l.jsx)(u.Z,{size:12,"aria-hidden":"true",className:"shrink-0 text-lv-selected"}),(0,l.jsx)("span",{className:["min-w-0 flex-1 truncate",A?"text-[13px] font-semibold leading-5 text-lv-text-primary":"text-[12px] leading-4 text-lv-text-secondary"].join(" "),children:A?S.QZ.panelLabel:eT}),(0,l.jsx)(f.Z,{size:14,"aria-hidden":"true",className:["shrink-0 text-lv-text-tertiary transition-transform",A?"rotate-180":""].join(" ")})]})}),(0,l.jsxs)("div",{id:m,role:"region","aria-labelledby":p,hidden:!A,children:[Y?(0,l.jsx)("div",{className:"mt-1 px-1",children:(0,l.jsx)(F,{})}):null,(0,l.jsx)("p",{className:"mt-0.5 px-1 text-[12px] leading-4 text-lv-text-tertiary",children:S.QZ.panelMicrocopy}),ek?(0,l.jsxs)("div",{role:"status",className:"mt-2 flex items-center justify-between gap-2 rounded-lg bg-lv-elevated px-2 py-1.5 text-[12px] leading-4 text-lv-text-secondary",children:[(0,l.jsx)("span",{children:S.QZ.referencesRefreshed}),(0,l.jsx)("button",{type:"button",onClick:e_,className:"flex min-h-[44px] min-w-[44px] items-center justify-center rounded px-2 text-[12px] leading-4 text-lv-text-tertiary outline-none hover:text-lv-text-primary focus-visible:ring-2 focus-visible:ring-lv-selected",children:S.QZ.dism
1iss})]}):null,(0,l.jsxs)("div",{className:"mt-2",children:[ea?(0,l.jsx)(M,{}):null,!ea&&eR?(0,l.jsx)("ul",{className:"list-none",children:en.map((e,t)=>{let{reference:n,pinned:r}=e;return(0,l.jsx)(O,{reference:n,pinned:r,excluded:et.has(Q(n)),position:t,onToggle:eb},Q(n))})}):null,!ea&&eE?(0,l.jsx)(j.Z,{size:"sm",icon:(0,l.jsx)(b.Z,{}),title:J.panelTitle,description:J.panelBody,primaryAction:{label:S.QZ.retryReferences,onClick:ew}}):null,ea||eR||eE?null:(0,l.jsxs)("div",{role:eI?"alert":void 0,className:"px-1 py-2 text-[12px] leading-4 text-lv-text-secondary","data-testid":"reference-status-block",children:[(0,l.jsx)("p",{className:"text-[13px] font-medium leading-5 text-lv-text-primary",children:J.panelTitle}),(0,l.jsx)("p",{className:"mt-0.5",children:eo?(0,S.qO)(es):J.panelBody}),eI?(0,l.jsx)("div",{className:"mt-2 flex min-h-[44px] items-center",children:(0,l.jsx)(v.f,{text:S.QZ.retry,onClick:ew,disabled:eo,width:"auto"})}):null]})]}),(0,l.jsxs)("div",{className:"mt-3 border-t border-lv-border-subtle pt-3",children:[(0,l.jsx)("label",{htmlFor:g,className:"block text-[13px] font-medium leading-5 text-lv-text-primary",children:S.QZ.addUrlLabel}),(0,l.jsxs)("div",{className:"mt-1 flex flex-col gap-2 md:flex-row md:items-start",children:[(0,l.jsx)("input",{id:g,type:"url",inputMode:"url",value:D,onChange:ey,onKeyDown:ej,placeholder:S.QZ.addUrlPlaceholder,maxLength:w.GROUNDING_LIMITS.url.maxChars,disabled:ed,"aria-invalid":!!eZ||void 0,"aria-describedby":eZ?_:N,className:["min-h-[44px] w-full flex-1 rounded-xl border bg-lv-card px-3 py-[7px] text-[13px] leading-5 text-lv-text-primary outline-none transition-[border-color,box-shadow]",eZ?"border-lv-error":"border-lv-border","focus-visible:border-lv-border-strong focus-visible:ring-2 focus-visible:ring-lv-selected",ed?"opacity-60":""].join(" ")}),(0,l.jsx)("div",{className:"flex min-h-[44px] shrink-0 items-center",children:(0,l.jsx)(v.f,{text:S.QZ.addUrlSubmit,onClick:eN,disabled:!eL,loading:B,width:"auto"})})]}),eZ?(0,l.jsx)("p",{id:_,role:"alert",className:"mt-1 text-[12px] leading-4 text-lv-error",children:eZ}):(0,l.jsx)("p",{id:N,className:"mt-1 text-[12px] leading-4 text-lv-text-tertiary",children:S.QZ.addUrlHint})]}),(0,l.jsxs)("div",{className:"mt-3 flex min-h-[44px] flex-wrap items-center gap-2",children:[(0,l.jsx)(v.f,{text:S.QZ.regenerateWithSelected,onClick:eS,disabled:!eC||ea||ei,loading:ei,icon:(0,l.jsx)(d.Z,{size:14,"aria-hidden":"true"}),width:"auto"}),(0,l.jsxs)("span",{"data-testid":"regenerate-token-cost",className:"inline-flex items-center gap-1 rounded-full bg-lv-elevated px-2 py-1 text-[12px] leading-4 text-lv-text-secondary",children:[(0,l.jsx)(y.Z,{size:14,"aria-hidden":"true"}),(0,l.jsx)("span",{"aria-hidden":"true",children:Number.isFinite(Number(c))?Number(c):"â"}),(0,l.jsx)("span",{className:"sr-only",children:Number.isFinite(Number(c))?"".concat(Number(c)," ").concat(S.QZ.tokenCostUnit):S.QZ.tokenCostUnavailable})]}),eo?(0,l.jsx)("span",{role:"status",className:"text-[12px] leading-4 text-lv-text-tertiary",children:(0,S.qO)(es)}):null]})]})]})}var K=n(36362);function V(e){var t;return Array.isArray(e)&&null!==(t=e.find(e=>"string"==typeof e&&e.trim()))&&void 0!==t?t:null}let B="trending",q=e=>String(null!=e?e:"").trim().toLowerCase()===B;function H(e){let{slug:t,chipClassName:n,size:r="sm"}=e,a=function(e){if("string"!=typeof e||!e.trim())return null;let t=e.trim().replace(/[_-]+/g," ").toLowerCase();return t.charAt(0).toUpperCase()+t.slice(1)}(t);return a?q(t)?(0,l.jsx)("span",{className:"inline-flex shrink-0 items-center",children:(0,l.jsx)(x.ZP,{badge:B,size:r})}):(0,l.jsx)("span",{className:n,children:a}):null}function X(e){let{rows:t}=e,n=t.slice(0,5);return 0===n.length?null:(0,l.jsx)("span",{className:"flex shrink-0 items-center","aria-hidden":"true","data-testid":"reference-thumb-stack",children:n.map((e,t)=>{let{reference:n}=e;return(0,l.jsx)("span",{className:["block h-6 w-6 overflow-hidden rounded-lv-full bg-lv-elevated ring-2 ring-lv-card",t>0?"-ml-2":""].join(" "),children:(null==n?void 0:n.primaryImage)?(0,l.jsx)("img",{src:n.primaryImage,alt:"",loading:"lazy",className:"h-full w-full object-cover"}):null},Q(n))})})}function W(e){let{reference:t}=e;return(0,l.jsx)("span",{className:"flex h-[26px] w-[26px] shrink-0 items-center justify-center overflow-hidden rounded-lv-sm border border-lv-border-media bg-lv-card",children:(null==t?void 0:t.primaryImage)?(0,l.jsx)("img",{src:t.primaryImage,alt:"",loading:"lazy",className:"h-full w-full object-cover"}):null})}function J(e){var t,n,r,i;let{reference:s,id:o}=e,c=null!==(t=null==s?void 0:s.title)&&void 0!==t?t:"",d=null!==(n=null==s?void 0:s.shopName)&&void 0!==n?n:"",u=D(null==s?void 0:s.ageMonths),f=U(null==s?void 0:s.estMoSales),h=(r=null==s?void 0:s.estMoSales,i=null==s?void 0:s.price,"number"!=typeof r||!Number.isFinite(r)||"number"!=typeof i||!Number.isFinite(i)||r<0||i<=0?null:"$".concat(Math.round(r*i).toLocaleStr
1ing())),x=V(null==s?void 0:s.badges),p=function(e){let t=Q(e);return/^\d+$/.test(t)?"https://www.etsy.com/listing/".concat(t):null}(s),m=[d?"".concat(S.QZ.shopPrefix," ").concat(d):null,u].filter(Boolean).join(" \xb7 ");return(0,l.jsxs)("div",{id:o,role:"group","aria-label":c,"data-testid":"reference-detail",className:"absolute left-0 top-full z-lv-dropdown mt-1 flex w-[min(300px,100%)] flex-col gap-1.5 rounded-lv-lg bg-lv-card p-3 shadow-lv-pop",children:[(0,l.jsx)("span",{className:"text-lv-strong text-lv-text-primary",children:c}),m?(0,l.jsx)("span",{className:"text-lv-caption text-lv-text-secondary",children:m}):null,(0,l.jsxs)("span",{className:"flex gap-4",children:[(0,l.jsxs)("span",{className:"flex flex-col",children:[(0,l.jsx)("span",{className:"text-lv-caption text-lv-text-tertiary",children:S.QZ.detailSalesLabel}),(0,l.jsx)("span",{className:"text-lv-strong tabular-nums text-lv-text-primary",children:null!=f?f:S.QZ.revenueUnavailable})]}),(0,l.jsxs)("span",{className:"flex flex-col",children:[(0,l.jsx)("span",{className:"text-lv-caption text-lv-text-tertiary",children:S.QZ.detailRevenueLabel}),(0,l.jsx)("span",{className:"text-lv-strong tabular-nums text-lv-text-primary",children:null!=h?h:S.QZ.revenueUnavailable})]})]}),(0,l.jsxs)("span",{className:"flex items-center justify-between gap-2",children:[x?(0,l.jsx)(H,{slug:x,size:"md",chipClassName:"inline-flex h-5 items-center rounded-lv-full bg-lv-premium-pill px-2 text-lv-micro uppercase text-lv-premium-pill-text"}):(0,l.jsx)("span",{}),p?(0,l.jsx)(v.f,{size:"xs",color:"no-background",text:S.QZ.viewOnEtsy,href:p,target:"_blank",icon:(0,l.jsx)(a.Z,{size:12}),iconPosition:"after"}):null]})]})}function Y(e){var t,n;let{reference:r,pinned:a,excluded:o,position:c,detailOpen:d,detailId:u,onToggleDetail:f,onExclude:h,onRestore:x}=e,p=Q(r),g=null!==(t=null==r?void 0:r.title)&&void 0!==t?t:"",b=null!==(n=null==r?void 0:r.shopName)&&void 0!==n?n:"",y=U(null==r?void 0:r.estMoSales),N=D(null==r?void 0:r.ageMonths),j=V(null==r?void 0:r.badges),w=[b?"".concat(S.QZ.shopPrefix," ").concat(b):null,N].filter(Boolean).join(" \xb7 ");return(0,l.jsxs)("li",{className:["relative flex min-h-[44px] items-center gap-2.5 border-b border-lv-border-divider-subtle px-1 py-1 last:border-b-0","motion-safe:transition-opacity motion-safe:duration-lv motion-safe:ease-lv",o?"opacity-50":"",a?"bg-lv-selected-tint":""].join(" "),"data-testid":"reference-row","data-listing-id":p,"data-excluded":o?"true":"false","data-pinned":a?"true":"false",children:[(0,l.jsx)(W,{reference:r}),(0,l.jsxs)("span",{className:"flex min-w-0 flex-1 flex-col",children:[(0,l.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,l.jsx)(m.Z,{title:g,children:(0,l.jsx)("span",{className:"truncate text-lv-caption text-lv-text-primary",children:g})}),a?(0,l.jsx)("span",{className:"shrink-0 rounded-lv-full bg-lv-selected-light px-1.5 py-0.5 text-lv-micro uppercase text-lv-selected-strong",children:S.QZ.pinnedRowLabel}):null,j?(0,l.jsx)(H,{slug:j,size:"sm",chipClassName:"shrink-0 rounded-lv-full bg-lv-premium-pill px-1.5 py-0.5 text-lv-micro uppercase text-lv-premium-pill-text"}):null]}),w?(0,l.jsx)("span",{className:"truncate text-lv-caption text-lv-text-tertiary",children:w}):null]}),(0,l.jsx)("span",{className:"shrink-0 tabular-nums text-lv-btn text-lv-text-secondary",children:y?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("span",{"aria-hidden":"true",children:[y,(0,l.jsx)("span",{className:"text-lv-text-tertiary",children:S.QZ.monthlySalesSuffix})]}),(0,l.jsxs)("span",{className:"sr-only",children:[S.QZ.estimatedSrLabel," ",y," ",S.QZ.monthlySalesSrSuffix]})]}):S.QZ.revenueUnavailable}),(0,l.jsx)("span",{className:"flex shrink-0 items-center gap-0.5","data-row-action":p,children:o?(0,l.jsx)(v.f,{size:"xs",color:"no-background",text:S.QZ.restoreLabel,ariaLabel:"".concat(S.QZ.includeReferencePrefix," ").concat(g),onClick:()=>x(p,c),"data-row-focus":"true"}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(v.f,{size:"xs",color:"no-background",icon:(0,l.jsx)(i.Z,{size:14}),ariaLabel:"".concat(S.QZ.viewDetailsPrefix," ").concat(g),"aria-expanded":d,"aria-controls":d?u:void 0,onClick:()=>f(p),"data-row-detail-trigger":"true"}),(0,l.jsx)(v.f,{size:"xs",color:"no-background",icon:(0,l.jsx)(s.Z,{size:14}),ariaLabel:"".concat(S.QZ.excludeReferencePrefix," ").concat(g),onClick:()=>h(p,c,g),"data-row-focus":"true"})]})}),d?(0,l.jsx)(J,{reference:r,id:u}):null]})}function $(){return(0,l.jsx)("ul",{className:"m-0 list-none p-0","aria-label":S.QZ.loadingRowsLabel,"aria-busy":"true","data-testid":"reference-skeleton",children:Array.from({length:3},(e,t)=>(0,l.jsxs)("li",{className:"flex items-center gap-2.5 border-b border-lv-border-divider-subtle py-2 last:border-b-0",children:[(0,l.jsx)("span",{className:"h-[26px] w-[26px] shrink-0 rounded-lv-sm bg-lv-elevated motion-safe:animate-pulse"}),(0,l.jsxs)("span",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,l.jsx)("span",{className:"h-3 w-2/3 rounded-lv-xs bg-lv-elevated motion-safe:animate-pulse"}),(0,l.jsx)("span",{className:"h-3 w-1/3 rounded-lv-xs bg-lv-elevated motion-safe:animate-pulse"})]})]},t))})}function ee(){return(0,l.jsxs)("span",{"data-testid":_,className:"inline-flex shrink-0 items-center gap-1 rounded-lv-full border px-2 py-0.5 text-lv-caption",style:{color:g.oR.accent,backgroundColor:g.oR.accentBg,borderColor:g.oR.accentBorder},children:[(0,l.jsx)(o.Z,{size:16,"aria-hidden":"true",className:"shrink-0"}),S.QZ.imageInfluenceBadge]})}function et(e){var t,n,a;let{grounding:i,surface:s,variant:o="default",defaultExpanded:x=!1,tokenCost:m,testId:g=k}=e,b=(0,r.useId)(),y="grounding-disclosure-".concat(b),N="grounding-region-".concat(b),j="grounding-url-form-".concat(b),_="grounding-url-".concat(b),A="grounding-url-hint-".concat(b),U="grounding-url-error-".concat(b),D="grounding-detail-".concat(b),[O,M]=(0,r.useState)(x),[F,G]=(0,r.useState)(!1),[K,V]=(0,r.useState)(!1),[B,q]=(0,r.useState)(""),[H,W]=(0,r.useState)(!1),[J,et]=(0,r.useState)(!1),[en,el]=(0,r.useState)(!1),[er,ea]=(0,r.useState)(null),[ei,es]=(0,r.useState)(null),eo=(0,r.useRef)(null),ec=(0,r.useRef)(!0);(0,r.useEffect)(()=>(ec.current=!0,()=>{ec.current=!1}),[]);let ed=null!==(t=null==i?void 0:i.status)&&void 0!==t?t:S.jz.IDLE,eu=null!==(n=null==i?void 0:i.reason)&&void 0!==n?n:null,ef=(0,S.j6)(ed,eu),eh=R(null==i?void 0:i.seedSource),ex=(0,r.useMemo)(()=>Array.isArray(null==i?void 0:i.references)?i.references:[],[null==i?void 0:i.references]),ep=(0,r.useMemo)(()=>Array.isArray(null==i?void 0:i.pinnedReferences)?i.pinnedReferences:[],[null==i?void 0:i.pinnedReferences]),em=(0,r.useMemo)(()=>new Set(Array.isArray(null==i?void 0:i.excludedIds)?i.excludedIds:[]),[null==i?void 0:i.excludedIds]),ev=(0,r.useMemo)(()=>[...ex.map(e=>({reference:e,pinned:!1}
1)),...ep.map(e=>({reference:e,pinned:!0}))],[ex,ep]),eg=(0,r.useMemo)(()=>ev.filter(e=>{let{reference:t}=e;return!em.has(Q(t))}),[em,ev]),eb=Number(null==i?void 0:i.generationSeq)||0,ey=eb>0,eN=(0,r.useMemo)(()=>({selectedCount:eg.length,excludedCount:ev.length-eg.length,pinnedCount:ep.length}),[eg.length,ep.length,ev.length]),ej=!!(null==i?void 0:i.loading)||ed===S.jz.LOADING,ew=!!(null==i?void 0:i.regenerating),eS=Number(null==i?void 0:i.retryAfterSeconds)||0,ek=eS>0,e_=null!==(a=null==i?void 0:i.urlError)&&void 0!==a?a:null,eR=ep.length>=w.GROUNDING_LIMITS.references.maxPinned,eE=(0,r.useMemo)(()=>JSON.stringify([[...em].sort(),ep.map(Q).sort()]),[em,ep]),[eI,eC]=(0,r.useState)(!1),eL=(0,r.useRef)(eE),eZ=(0,r.useRef)(eE);(0,r.useEffect)(()=>{eZ.current=eE},[eE]);let eA=(0,r.useRef)(eb),eP=(0,r.useRef)(!1);(0,r.useEffect)(()=>{if(eb<eA.current){eA.current=eb,eP.current=!1,eL.current=eE,eC(!1);return}eA.current=eb,eP.current&&(eP.current=!1,eC(eE!==eL.current))},[eE,eb]),(0,r.useEffect)(()=>{ei&&!em.has(ei.id)&&es(null)},[em,ei]);let eT=(0,r.useRef)(eb);(0,r.useEffect)(()=>{eT.current!==eb&&(eT.current=eb,es(null))},[eb]);let eQ=(0,w.FL)(B),eU=B.trim();(0,r.useEffect)(()=>{if(!eU||eQ){W(!1);return}let e=setTimeout(()=>W(!0),350);return()=>clearTimeout(e)},[eU,eQ]);let eD=(0,r.useRef)(null);(0,r.useEffect)(()=>{var e,t;let n=eD.current;if(!n)return;eD.current=null;let l=eo.current;if(l){if("undo"===n.kind){null===(e=l.querySelector("[data-undo-action] button"))||void 0===e||e.focus();return}for(let e of l.querySelectorAll("[data-row-action]")){if(e.dataset.rowAction!==n.id)continue;let l="detail"===n.control?"[data-row-detail-trigger]":"[data-row-focus]";null===(t=e.querySelector(l)||e.querySelector("button"))||void 0===t||t.focus();return}}});let ez=(0,r.useCallback)(()=>{var e;M(!0),null==i||null===(e=i.fetchPreview)||void 0===e||e.call(i),(0,z.L)(E,{...s?{surface:s}:{},referenceCount:ev.length,status:ed})},[i,ev.length,ed,s]),eO=(0,r.useCallback)(()=>{M(!1),ea(null),(0,z.L)("reference_panel_collapsed",{...s?{surface:s}:{},referenceCount:ev.length,status:ed})},[ev.length,ed,s]),eM=(0,r.useCallback)(()=>{O?eO():ez()},[eO,O,ez]),eF=(0,r.useCallback)((e,t,n)=>{if("function"==typeof(null==i?void 0:i.toggleReference))return(0,z.L)(I,{direction:n?Z.INCLUDE:Z.EXCLUDE,position:t}),eP.current=!0,i.toggleReference(e)},[i]),eG=(0,r.useCallback)((e,t,n)=>{"function"==typeof(null==i?void 0:i.toggleReference)&&(eF(e,t,!1),es({id:e,position:t,title:n}),ea(null),eD.current={kind:"undo"})},[i,eF]),eK=(0,r.useCallback)((e,t)=>{eF(e,t,!0),eD.current={kind:"row",id:e}},[eF]),eV=(0,r.useCallback)(()=>{ei&&(eF(ei.id,ei.position,!0),(0,z.L)("reference_undo",{position:ei.position}),eD.current={kind:"row",id:ei.id},es(null))},[ei,eF]),eB=(0,r.useCallback)(e=>{ea(t=>t===e?null:e)},[]);(0,r.useEffect)(()=>{if(!er)return;let e=e=>{"Escape"===e.key&&(e.stopPropagation(),eD.current={kind:"row",id:er,control:"detail"},ea(null))},t=e=>{var t,n,l;let r=e.target,a=r&&1===r.nodeType?r:null!==(l=null==r?void 0:r.parentElement)&&void 0!==l?l:null;(null==a||null===(t=a.closest)||void 0===t||!t.call(a,'[data-testid="reference-detail"]'))&&(null!=a&&null!==(n=a.closest)&&void 0!==n&&n.call(a,"[data-row-detail-trigger]")||ea(null))};return document.addEventListener("keydown",e),document.addEventListener("mousedown",t),()=>{document.removeEventListener("keydown",e),document.removeEventListener("mousedown",t)}},[er]);let eq=(0,r.useCallback)(e=>{var t;q(e),el(!1),(null==i?void 0:i.urlError)&&(null==i||null===(t=i.clearUrlError)||void 0===t||t.call(i))},[i]),eH=(0,r.useCallback)(async()=>{if(!eQ||J||eR)return;let e=null==i?void 0:i.addReferenceUrl;et(!0);try{let t=await (null==e?void 0:e(eU));"function"==typeof e&&(0,z.L)(C,{outcome:P(t)}),(null==t?void 0:t.added)&&(eP.current=!0),ec.current&&(null==t?void 0:t.added)&&(q(""),el(!0),G(!0))}finally{ec.current&&et(!1)}},[J,i,eR,eU,eQ]),eX=(0,r.useCallback)(e=>{"Enter"===e.key&&(e.preventDefault(),eH())},[eH]),eW=(0,r.useCallback)(()=>{V(e=>!e),el(!1)},[]),eJ=(0,r.useCallback)(()=>{var e;return null==i?void 0:null===(e=i.fetchPreview)||void 0===e?void 0:e.call(i,{force:!0})},[i]),eY=(0,r.useCallback)(async()=>
1{if("function"!=typeof(null==i?void 0:i.regenerateWithSelected))return;(0,z.L)(L,eN);let e=await i.regenerateWithSelected();return e&&!1!==e.regenerated&&ec.current&&(eL.current=eE,eP.current=!1,eC(eZ.current!==eE)),e},[eN,eE,i]),e$=!!(null==i?void 0:i.referencesRefreshed),e0=(0,r.useCallback)(()=>{var e;return null==i?void 0:null===(e=i.acknowledgeRefresh)||void 0===e?void 0:e.call(i)},[i]),e1=(0,r.useRef)(0);(0,r.useEffect)(()=>{var e;0!==eb&&T.has(ed)&&!(ev.length>0)&&e1.current!==eb&&(e1.current=eb,null==i||null===(e=i.fetchPreview)||void 0===e||e.call(i,{force:!0}))},[eb,ed,ev.length]);let e2=!!(null==i?void 0:i.canRegenerate)&&!ek,e4=eQ&&!J&&!eR,e3=e_?(0,S.KJ)(e_):H?(0,S.KJ)(S.FS.INVALID_ETSY_URL):null,e5=eR?(0,S.KJ)(S.FS.PIN_LIMIT):en?S.QZ.addUrlAddedHint:S.QZ.addUrlHint,e6=(0,S.rp)(eg.length,function(e){let t=e.map(e=>{let{reference:t}=e;return function(e){let t=null==e?void 0:e.estMoSales;return"number"!=typeof t||!Number.isFinite(t)||t<0?null:t}(t)}).filter(e=>null!==e);return 0===t.length?null:t.reduce((e,t)=>e+t,0)/t.length}(eg)),e8=F?ev.length:4,e7=ev.length>4,e9=F||!e7;(0,r.useEffect)(()=>{K&&!e9&&G(!0)},[K,e9]);let te=(0,r.useCallback)(()=>{F&&V(!1),G(e=>!e)},[F]),tt={ref:eo,"data-testid":g,"data-surface":s,"data-grounding-status":ed,"data-grounding-reason":null!=eu?eu:void 0,"data-variant":o,"data-dirty":eI?"true":"false",className:"w-full"},tn=()=>(0,l.jsxs)("div",{id:j,className:"mt-2 flex max-w-[420px] flex-col gap-1","data-testid":"reference-url-form",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-start",children:[(0,l.jsx)("div",{className:"min-w-0 flex-1",children:(0,l.jsx)(p.Z,{id:_,fullWidth:!0,type:"url",value:B,onChange:eq,placeholder:S.QZ.addUrlPlaceholder,disabled:eR,error:!!e3,inputProps:{"aria-label":S.QZ.addUrlLabel,"aria-invalid":!!e3||void 0,"aria-describedby":e3?U:A,maxLength:w.GROUNDING_LIMITS.url.maxChars,inputMode:"url",onKeyDown:eX}})}),(0,l.jsx)(v.f,{text:S.QZ.addUrlSubmit,onClick:eH,disabled:!e4,loading:J})]}),e3?(0,l.jsx)("p",{id:U,role:"alert",className:"text-lv-caption text-lv-error-strong",children:e3}):(0,l.jsx)("p",{id:A,className:"text-lv-caption text-lv-text-tertiary",children:e5})]}),tl=()=>(0,l.jsx)(v.f,{size:"xs",color:"no-background",icon:(0,l.jsx)(c.Z,{size:12}),text:S.QZ.addCompetitorLabel,onClick:eW,"aria-expanded":K,"aria-controls":K?j:void 0}),tr=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"md",t=Number(m),n=Number.isFinite(t)&&t>0;return(0,l.jsx)(v.f,{size:e,color:eI?"black":"white",text:(0,l.jsxs)(l.Fragment,{children:[S.QZ.regenerateWithSelected,(0,l.jsx)("span",{"data-testid":"regenerate-token-cost",className:"ml-1",children:n?"\xb7 ".concat(t," ").concat(S.QZ.tokenCostUnit):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("span",{"aria-hidden":"true",children:["\xb7 ",S.QZ.revenueUnavailable]}),(0,l.jsx)("span",{className:"sr-only",children:S.QZ.tokenCostUnavailable})]})})]}),onClick:eY,disabled:!e2||ej||ew,loading:ew,icon:(0,l.jsx)(d.Z,{size:"xs"===e?12:14})})};return i&&!ef.hidden&&ey?0===ev.length?ej?(0,l.jsx)("section",{...tt,children:(0,l.jsxs)("div",{role:"status",className:"flex min-h-[28px] items-center gap-2","data-testid":"reference-loading-line",children:[(0,l.jsx)(u.Z,{size:12,"aria-hidden":"true",className:"shrink-0 text-lv-accent motion-safe:animate-pulse"}),(0,l.jsx)("span",{className:"text-lv-caption text-lv-text-secondary",children:S.QZ.findingReferences})]})}):T.has(ed)?(0,l.jsxs)("section",{...tt,children:[(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5","data-testid":"reference-empty-line",children:[(0,l.jsx)("span",{className:"text-lv-caption text-lv-text-secondary",children:S.QZ.noStrongReferences}),tl()]}),K?tn():null]}):null:(0,l.jsxs)("section",{...tt,children:[(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,l.jsx)("h3",{className:"m-0 min-w-[200px] flex-1",children:(0,l.jsxs)("button",{type:"button",id:y,"aria-expanded":O,"aria-controls":N,onClick:eM,className:"flex min-h-[36px] w-full items-center gap-2.5 rounded-lv-md bg-transparent px-1 py-1 text-left outline-none motion-safe:transition-colors motion-safe:duration-lv motion-safe:ease-lv hover:bg-lv-hover focus-visible:ring-2 focus-visible:ring-lv-focus",children:[(0,l.jsx)(X,{rows:eg.length?eg:ev}),(0,l.jsxs)("span",{className:"flex min-w-0 flex-1 flex-col",children:[(0,l.jsx)("span",{className:"truncate text-lv-btn text-lv-text-primary",children:e6}),(0,l.jsx)("span",{className:"truncate text-lv-caption text-lv-text-tertiary",children:S.QZ.panelTrustline})]}),eI?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("span",{"aria-hidden":"true","data-testid":"reference-dirty-dot",className:"h-1.5 w-1.5 shrink-0 rounded-lv-full bg-lv-selected"}),(0,l.jsx)("span",{className:"sr-only",children:S.QZ.dirtyIndicatorLabel})]}):null,(0,l.jsx)(f.Z,{size:14,"aria-hidden":"true",className:["shrink-0 text-lv-text-tertiary motion-safe:transition-transform motion-safe:duration-lv motion-safe:ease-lv",O?"rotate-180":""].join(" ")})]})}),eh?(0,l.jsx)(ee,{}):null,!O&&eI?(0,l.jsx)("span",{className:"shrink-0",children:tr()}):null]}),(0,l.jsxs)("div",{id:N,role:"region","aria-labelledby":y,hidden:!O,children:[e$?(0,l.jsxs)("div",{role:"status",className:"mt-2 flex items-center justify-between gap-2 rounded-lv-md bg-lv-elevated px-2.5 py-1.5 text-lv-caption text-lv-text-secondary",children:[(0,l.jsx)("span",{children:S.QZ.referencesRefreshed}
1),(0,l.jsx)(v.f,{size:"xs",color:"no-background",text:S.QZ.dismiss,onClick:e0})]}):null,(0,l.jsx)("div",{className:"mt-1",children:ej?(0,l.jsx)($,{}):(0,l.jsx)("ul",{className:"m-0 list-none p-0",children:ev.map((e,t)=>{let{reference:n,pinned:r}=e;if(t>=e8)return null;let a=Q(n);return(0,l.jsx)(Y,{reference:n,pinned:r,excluded:em.has(a),position:t,detailOpen:er===a,detailId:D,onToggleDetail:eB,onExclude:eG,onRestore:eK},a)})})}),ed===S.jz.ERROR?(0,l.jsxs)("div",{role:"alert",className:"mt-2 flex flex-wrap items-center gap-2","data-testid":"reference-status-block",children:[(0,l.jsx)("span",{className:"text-lv-caption text-lv-text-secondary",children:ek?(0,S.qO)(eS):ef.panelBody}),(0,l.jsx)(v.f,{size:"xs",color:"no-background",text:S.QZ.retry,onClick:eJ,disabled:ek})]}):null,(0,l.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-3",children:[e7?(0,l.jsx)(v.f,{size:"xs",color:"no-background",text:(0,S.mw)(F,ev.length),onClick:te}):null,e9?tl():null,(0,l.jsx)("span",{className:"ml-auto shrink-0",children:tr("xs")})]}),eI||ek?(0,l.jsxs)("div",{className:"mt-1.5 flex flex-wrap items-center gap-2",children:[eI?(0,l.jsx)("span",{className:"text-lv-caption text-lv-text-secondary",children:S.QZ.dirtyNotice}):null,ek?(0,l.jsx)("span",{role:"status",className:"text-lv-caption text-lv-text-tertiary",children:(0,S.qO)(eS)}):null]}):null,K?tn():null,ei?(0,l.jsxs)("div",{role:"status","data-testid":"reference-undo-bar",className:"mt-2 flex items-center justify-between gap-2 rounded-lv-md bg-lv-elevated py-1 pl-2.5 pr-1",children:[(0,l.jsx)("span",{className:"min-w-0 truncate text-lv-caption text-lv-text-secondary",children:(0,S.N2)(ei.title)}),(0,l.jsx)("span",{className:"shrink-0","data-undo-action":"true",children:(0,l.jsx)(v.f,{size:"xs",color:"no-background",icon:(0,l.jsx)(h.Z,{size:12}),text:S.QZ.undoLabel,onClick:eV})})]}):null]})]}):null}function en(e){let{variant:t="default",...n}=e;return K.sZ?"compact-row"===t?(0,l.jsx)(G,{...n}):(0,l.jsx)(et,{variant:t,...n}):null}},36841:function(e,t,n){n.d(t,{w:function(){return r}});var l=n(2265);function r(){let[e,t]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{if(!window.matchMedia)return;let e=window.matchMedia("(hover: none), (pointer: coarse)"),n=()=>t(e.matches);return(n(),e.addEventListener)?(e.addEventListener("change",n),()=>e.removeEventListener("change",n)):(e.addListener(n),()=>e.removeListener(n))},[]),e}t.Z=r},59380:function(e,t,n){n.d(t,{$A:function(){return h},B9:function(){return r},FX:function(){return u},Ov:function(){return g},c9:function(){return v},iq:function(){return i},mE:function(){return a},mz:function(){return m},tN:function(){return x}});let l=Object.freeze({RECOVERS:"recovers",RECHECKS_EXISTING:"rechecks_existing",NEEDS_CHANGE_FIRST:"needs_change_first"}),r=e=>e===l.NEEDS_CHANGE_FIRST||e===l.RECHECKS_EXISTING,a=(e,t)=>r(t)||"secondary"===e?"secondary":"primary",i="UNMAPPABLE_VARIANTS";function s(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){if("string"!=typeof n&&"number"!=typeof n)continue;let e=String(n).trim();e&&!t.includes(e)&&t.push(e)}return t}function o(e){let t=Number(e);return Number.isFinite(t)&&t>0?Math.floor(t):0}function c(e,t){let n=s(e);if(!n.length)return"";let l=Math.max(o(t),n.length),r=n.slice(0,5),a=l-r.length;return a>0?"".concat(r.join(", ")," and ").concat(a," more"):1===r.length?r[0]:"".concat(r.slice(0,-1).join(", ")," and ").concat(r[r.length-1])}let d=Object.freeze(["unmanaged_echo_coverage_gap","print_area_coverage_gap"]);function u(e){let t=e&&"object"==typeof e?e:null;if(!t)return null;if(o(t.unbound_targets)>0)return{flavor:"unbound",sentence:"Some design placements on this listing point at a product that's no longer on it, so those variations have nothing to print.",hint:"This needs ListingView support to repair â contact support with the code below."};if(d.includes(t.reason))return{flavor:"internal",sentence:"ListingView couldn't rebuild this listing's Printify draft with every variation covered.",hint:"This needs ListingView support â contact support with the code below."};let n=o(t.unplaced_designs);if(n>0){let e=s(t.unplaced_design_file_names),l=1===n,r=e.length?c(e.map(e=>'"'.concat(e,'"')),n):l?"A design":"".concat(n," designs");return{flavor:"unplaced",sentence:l?"".concat(r," is switched on but isn't attached to any product or colors, so it covers nothing."):"".concat(r," are switched on but aren't attached to any product or colors, so they cover nothing."),hint:l?"Attach it to a product and its colors (or switch it off), save, then click Retry.":"Attach each one to a product and its colors (or switch it off), save, then click Retry."}}let l=s(t.uncovered_color_labels);if(l.length){let e=o(t.uncovered_color_option_ids_total)||s(t.uncovered_color_option_ids).length||l.length,n=1===Math.max(e,l.length);return{flavor:"colors",sentence:n?"".concat(c(l,e)," has no design assigned, so orders for it can't be sent to Printify."):"".concat(c(l,e)," have no design assigned, so orders for them can't be sent to Printify."),hint:n?"Assign it to a design (or turn it off), save, then click Retry â fixing the design doesn't restart the draft on its own.":"Assign them to a design (or turn them off), save, then click Retry â fixing the design doesn't restart the draft on its own."}}let r=o(t.uncovered_count);return r>0?{flavor:"count",sentence:1===r?"1 enabled variation has no design assigned for its color, so its orders can't be sent to Printify.":"".concat(r," enabled variations have no design assigned for their color, so their orders can't be sent to Printify."),hint:"Assign a design to every enabled color (or turn those off), save, then click Retry â fixing the design doesn't restart the draft on its own."}:null}let f="Set a price (or turn them off), save, then click Retry.";function h(e){let t=e&&"object"==typeof e?e:null;if(!t)return null;let n=s(t.affected_variant_labels),l=o(t.zero_price_count);if(n.length){let e=1===Math.max(l,n.length);return{sentence:"".concat(c(n,l)," ").concat(e?"has":"have"," no price, and Printify won't create a product with an unpriced variation."),hint:f}}if(l>0){let e=o(t.enabled_count),n=e?"".concat(l," of ").concat(e," enabled variations"):"".concat(l," enabled variation").concat(1===l?"":"s");return{sentence:"".concat(n," ").concat(1!==l||e?"have":"has"," no price, and Printify won't create a product with an unpriced variation."),hint:f}}return null}function x(e){let t=e&&"object"==typeof e?e:null;if(!t)return null;let n=o(t.missing_sku_count);if(!(n>0||null!=t.fields_diverged||null!=t.verification_failures))return null;let l="Printify stored this listing's routing draft differently from what we sent, so orders can't route to it yet.";return n>0&&(l+=" Printify is missing ".concat(n," of the SKUs we sent.")),{sentence:l,hint:"Retry re-checks the draft Printify already has â it doesn't rebuild it. If it keeps failing, contact support."}}let p=Object.freeze(["duplicate_identity","duplicate_printify_variant_id"]);function m(e){var t;let n=e&&"object"==typeof e?e:null;if(!n)return null;if(p.includes(n.reason)){let e=o(n.colliding_variant_count);return{sentence:"".concat(e>0?"".concat(e," enabled variations"):"Some enabled variations"," of this product point at the same Printify variant, so orders for all but one of them couldn't be routed."),hint:"Turn off the duplicates, save, then click Retry."}}let l=s(null!==(t=n.unsupported_axes)&&void 0!==t?t:n.unsupported_option_names),r=l.length?c(l):"an option other than color and size";return{sentence:"This product varies by ".concat(r," as well as color and size, and ListingView sends only color and size to Printify, so its ").concat(l.length?r:"extra"," choices would all reach the same Printify variant."),hint:"Use a product that varies only by color and size (remove this one and add a matching product), then click Retry."}}let v=Object.freeze({WRONG_PROVIDER:"This product isn't a Printify product, so no Printify draft can fulfill it. Contact support if you expected it to route to Printify.",MISSING_PROVIDER_REFS:"This product is missing its Printify blueprint or print provider, so the draft can't be built. Re-
1add the product from the POD catalog, then retry.",POD_PRODUCT_MISSING_PRINT_AREAS:"This product has no print areas, so the draft can't be built. Re-add the product from the POD catalog, then retry.",INVALID_PRINT_AREA_REF:"A design is assigned to a print area that doesn't exist on this product. Re-assign it to a valid print area, then retry.",INVALID_VARIANT_EXTERNAL_IDS:"Some enabled variations aren't offered by this print provider. Turn them off or switch provider, then retry.",NO_FILE_ASSIGNMENTS:"No enabled design is assigned to this product, so the draft has nothing to print. Assign a design, then retry.",NO_PRINT_AREAS_BUILT:"None of this product's designs could be placed on a print area, so the draft has nothing to print. Check the product's design assignments, then retry.",DESIGN_FILE_MISSING:"A design file on this product is missing. Re-upload or re-assign it, then retry.",ASSET_FILE_MISSING_URL:"A design file on this product isn't ready yet â it may still be processing. Retry once it has finished; if this keeps showing, re-upload it.",SKU_EMPTY_VARIANT:"An enabled variation has no routing SKU, so its orders can't be matched. A retry builds the same SKUs â contact support.",SKU_DUPLICATE_IN_LISTING:"Two enabled variations got the same routing SKU, so an order would be ambiguous. A retry builds the same SKUs â contact support.",SKU_TOO_LONG:"A routing SKU is longer than the 32-character limit. A retry builds the same SKUs â contact support.",SKU_INVALID_CHARSET:"A routing SKU has characters Printify can't take. A retry builds the same SKUs â contact support.",PRINTIFY_SHOP_WRONG_CHANNEL:"The Printify store linked to this Etsy shop is connected to a different sales channel, so Etsy orders can't reach it. Link an Etsy-connected store in Settings â affected listings retry on their own.",PRINT_PROVIDER_UNAVAILABLE:"This print provider no longer offers this product on Printify. Choose another provider for this product, then retry.",DRAFT_UNEXPECTED_ERROR:"Something went wrong on ListingView's side while building this draft, and a draft may already exist. If it still shows in a few minutes, contact support with the details below.",DRAFT_UPDATE_REJECTED:"Printify refused the latest design update, so this draft still prints the previous design. Change the design, then retry â or contact support with the details below.",DRAFT_SPLIT_RETIRED:"This Printify routing product was retired when the listing's variations changed; the listing's other routing products carry its orders. There's nothing to retry."});function g(e){return e===l.NEEDS_CHANGE_FIRST?"Retry won't clear this until something changes â contact support if it isn't clear what.":e===l.RECHECKS_EXISTING?"Retry re-checks the existing draft; it doesn't rebuild it.":null}}}]);
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.