PageSourceSearch

https://www.sellpy.se/market/SelectItems.I9aCZn9F.bundle.js

js sellpy.se collected 2026-10-02 03:02:13 UTC 11,311 bytes, 103 lines download raw bytes

1var Z=Object.defineProperty,ee=Object.defineProperties;var te=Object.getOwnPropertyDescriptors;var k=Object.getOwnPropertySymbols;var O=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable;var w=(e,t,s)=>t in e?Z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,v=(e,t)=>{for(var s in t||(t={}))O.call(t,s)&&w(e,s,t[s]);if(k)for(var s of k(t))E.call(t,s)&&w(e,s,t[s]);return e},R=(e,t)=>ee(e,te(t));var M=e=>typeof e=="symbol"?e:e+"",_=(e,t)=>{var s={};for(var o in e)O.call(e,o)&&t.indexOf(o)<0&&(s[o]=e[o]);if(e!=null&&k)for(var o of k(e))t.indexOf(o)<0&&E.call(e,o)&&(s[o]=e[o]);return s};var j=(e,t,s)=>new Promise((o,l)=>{var a=m=>{try{u(s.next(m))}catch(g){l(g)}},c=m=>{try{u(s.throw(m))}catch(g){l(g)}},u=m=>m.done?o(m.value):Promise.resolve(m.value).then(a,c);u((s=s.apply(e,t)).next())});import{j as i,a6 as ne,h as se,b as ie,I as oe,aT as ae,M as re,c as le,P as ce,B as de}from"./npm.sellpy-design-system.DdsWMDHW.bundle.js";import{r as d}from"./npm.react-hook-form.HNw-giVQ.bundle.js";import{a as me,b as ue,l as pe}from"./npm.react-router.BDfxye5A.bundle.js";import{g as r}from"./npm.styled-components.CzYR6Qdp.bundle.js";import{u as be,a8 as ge,K as fe,b$ as Ie,c0 as ye,gI as he,m as h,gK as xe,ag as ke,ah as ve,bQ as je}from"./index.DWkcZ-_z.bundle.js";import{z as Se,i as Ce,q as Te}from"./npm.apollo-client.CXJpJPbe.bundle.js";import"./npm.lodash.DxN61Y-S.bundle.js";import{N as Ne}from"./NotFound.CkQBkqUE.bundle.js";import{g as $}from"./order.B7KQoXM2.bundle.js";import{h as we,d as Oe,f as Ee,e as Re}from"./tools.DFU8Mi0C.bundle.js";import{f as Me}from"./utils.BD-jFZsH.bundle.js";import{C as _e}from"./CopyableIdForItemTile.q0TfIcW1.bundle.js";import{B as $e,E as Fe,C as Ae,R as Be,P as Pe}from"./PageLayout.4rRYTdl8.bundle.js";import{c as De}from"./npm.sentry-react.Z7tY98T1.bundle.js";import{u as Le}from"./npm.react-i18next.BwOa93YU.bundle.js";import{a8 as ze,aM as Ge,o as Qe}from"./npm.sellpy-commons.B413ARrd.bundle.js";import"./npm.react-dom.DlIYrMBD.bundle.js";import"./npm.luxon.3NOFZn7k.bundle.js";import"./npm.zod.DEnjmUYT.bundle.js";import"./npm.parse.BcWrqAIh.bundle.js";import"./npm.swr.CiJqMJM6.bundle.js";import"./npm.algolia.BDObKZ-5.bundle.js";import"./npm.i18next.B74d65Th.bundle.js";import"./translations.B5c9TvV-.bundle.js";import"./npm.graphql.ClDiDpi3.bundle.js";import"./npm.immutable.DTQZtUT4.bundle.js";import"./MetaTagPlacer.RJbhKlsg.bundle.js";import"./utils.DutWSyoJ.bundle.js";import"./LayoutCenteredColumn.DciXWKum.bundle.js";import"./localizedMetadata.fragment.C5BEe71S.bundle.js";import"./useCopyToClipboard.DAIMN_13.bundle.js";import"./hookFormTools.EA1gch-3.bundle.js";import"./MultiLineInput.5PgptBIW.bundle.js";import"./actions.Ql4nvFLR.bundle.js";try{let e=typeof window!="undefined"?window:typeof global!="undefined"?global:typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="fd673968-1c55-4e14-9db1-2c31deaacadf",e._sentryDebugIdIdentifier="sentry-dbid-fd673968-1c55-4e14-9db1-2c31deaacadf")}catch(e){}{let e=typeof window!="undefined"?window:typeof global!="undefined"?global:typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=Object.assign({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:sellpy-market":!0})}const qe=`mutation createClaimsMutation($claims: [CreateClaimInput!]!) {
2  result: createClaims(claims: $claims) {
3    claims {
4      objectId
5      item {
6        objectId
7      }
8      order {
9        payment {
10          objectId
11        }
12      }
13    }
14    failedItemIds
15  }
16}
17`,He={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"createClaimsMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"claims"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"CreateClaimInput"}}}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:{kind:"Name",value:"result"},name:{kind:"Name",value:"createClaims"},arguments:[{kind:"Argument",name:{kind:"Name",value:"claims"},value:{kind:"Variable",name:{kind:"Name",value:"claims"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"claims"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"objectId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"item"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"objectId"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"order"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"payment"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"objectId"},arguments:[],directives:[]}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"failedItemIds"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:308,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:qe}}},We=He,Ke=e=>{const t=`claimSelections_${e}`,[s,o]=d.useState(()=>{var a;try{return JSON.parse((a=window.sessionStorage.getItem(t))!=null?a:"null")||{}}catch(c){return{}}}),l=d.useRef(!1);return d.useEffect(()=>{try{window.sessionStorage.setItem(t,JSON.stringify(s))}catch(a){l.current||(l.current=!0,De(a))}},[t,s]),d.useEffect(()=>()=>{try{window.sessionStorage.removeItem(t)}catch(a){}},[t]),[s,o]},Kt=s=>j(null,[s],function*({request:e,params:t}
17){return yield Ie({url:new URL(e.url)}),ye($,{variables:v({id:t.orderId},he())}).toPromise()}),Ue=16,Ve=16,F=32,A=24,Je=r.div`
18  min-height: 100%;
19  background-color: white;
20`,Ye=r.div`
21  box-sizing: border-box;
22  max-width: 1010px;
23  margin: 0 auto;
24  padding: 0 ${Pe}px;
25  ${h.largerThanDesktop} {
26    padding: 0;
27  }
28`,Xe=r.div`
29  display: flex;
30  flex-direction: column;
31  gap: ${F}px;
32  max-width: 600px;
33  ${h.phone} {
34    gap: ${A}px;
35  }
36`,Ze=r(le)`
37  padding-top: 16px;
38`,et=r.div`
39  display: flex;
40  flex-direction: column;
41`,tt=r.div`
42  display: flex;
43  align-items: center;
44  gap: 16px;
45  padding: ${Ue}px 0;
46  &:first-child {
47    padding-top: 0;
48  }
49  &:last-child {
50    padding-bottom: 0;
51  }
52  &:not(:last-child) {
53    border-bottom: 1px solid ${({theme:e})=>e.color.grey.shade8};
54  }
55`,nt=r.div`
56  flex: 1;
57  min-width: 0;
58`,st=r.img`
59  width: 100%;
60  height: 100%;
61  object-fit: cover;
62  display: block;
63  mix-blend-mode: multiply;
64`,it=r.div`
65  z-index: 10;
66  box-sizing: border-box;
67  display: flex;
68  justify-content: center;
69  padding: ${Ve}px;
70  background: white;
71  margin-top: ${F}px;
72  ${h.phone} {
73    margin-top: ${A}px;
74  }
75  position: sticky;
76  bottom: 0;
77  ${({$stuck:e,theme:t})=>e&&`border-top: 1px solid ${t.color.grey.shade8};`}
78`,ot=r.div`
79  height: 1px;
80`,at=r.div`
81  display: flex;
82  align-items: center;
83  justify-content: flex-end;
84  gap: 24px;
85  width: 100%;
86  max-width: 1010px;
87  ${h.tablet} {
88    flex-direction: column;
89    justify-content: center;
90    gap: 8px;
91  }
92`,rt=r.div`
93  display: flex;
94  align-items: center;
95  gap: 4px;
96`,lt=r(ce)`
97  color: ${({theme:e})=>e.color.grey.shade3};
98`,ct=r(de)`
99  ${h.tablet} {
100    width: 100%;
101  }
102`,dt=({children:e})=>{const t=d.useRef(null),[s,o]=d.useState(!1);return d.useEffect(()=>{const l=t.current;if(!l)return;const a=new IntersectionObserver(([c])=>o(!c.isIntersecting));return a.observe(l),()=>a.disconnect()},[]),i.jsxs(i.Fragment,{children:[i.jsx(it,{$stuck:s,children:e}),i.jsx(ot,{ref:t,"aria-hidden":"true"})]})},mt=({item:e,itemPayment:t,selected:s,onToggle:o})=>{const{title:l,description:a}=Re(e),c=t?ze.fromBaseUnit(t.value.payment).format():void 0;return i.jsxs(tt,{children:[i.jsx(nt,{children:i.jsx(ae,{href:e.objectId?Ge(e):null,displayComponent:i.jsx(st,{src:Qe(e.images[0].value,{width:400}),alt:`Item ${e.objectId}`}),title:l,subtitle:a,textArea:i.jsx(_e,{itemId:e.objectId}),price:c})}),i.jsx(re,{checked:s,ariaLabel:l,onChange:()=>o(e.objectId)})]})},Ut=()=>{const{orderId:e}=me(),{t}=Le("claims"),{isMobile:s,isTablet:o}=be(),[l,a]=Ke(e),[c,u]=d.useState(null),[m,g]=d.useState(!1),[B,S]=d.useState(!1),P=ue(),D=Se(),[L]=Ce(We),{onClick:z}=ge("/orders"),G=pe(),{data:C,error:Q}=Te(G);if(!C||Q)return i.jsx(Ne,{});const{order:f,itemClaims:q}=C,H=Object.fromEntries(fe(q).map(n=>[n.item.objectId,n])),W=n=>!n||n.status==="removed",x=we(f)?[]:f.items.filter(n=>W(H[n.objectId])),K=new Set(x.map(n=>n.objectId)),p=Object.fromEntries(Object.entries(l).filter(([n])=>K.has(n))),U=Oe(f),T=Object.fromEntries(f.itemPayments.map(n=>[n.value.itemId,n])),I=Object.keys(p),N=Object.values(p).some(n=>Me[n.reason]==="claim"),V=Ee(v({order:f},I.length>0&&{nItems:I.length})),J=()=>j(null,null,function*(){S(!0);try{const{data:n}=yield L({variables:{claims:Object.entries(p).map(([b,y])=>({itemId:b,orderId:e,reason:y.reason,subReason:y.subReason||void 0,motivation:y.motivation||void 0,images:y.images}))}});n.result.claims.forEach(b=>xe({itemId:b.item.objectId,paymentId:b.order.payment.objectId})),n.result.failedItemIds.length&&ke({header:t("common:errorToast.header"),body:t("selectItems.partialFailure"),type:ve.ERROR}),D.refetchQueries({include:[$]}).catch(()=>{}),n.result.claims.length&&P(`/claims/${e}`)}catch(n){je(n)}finally{S(!1)}}),Y=n=>{if(p[n]){const b=p,{[n]:y}=b,X=_(b,[M(n)]);a(X);return}u(n)};return i.jsxs(Je,{children:[i.jsx($e,{children:i.jsx(ne,{variant:s||o?"collapsed":"full",options:[{link:"/home#shopping",label:t("common:breadcrumbs.home")},{link:"/orders",label:t("common:breadcrumbs.orders")},{link:`/order/${e}`,label:t("common:breadcrumbs.order",{orderId:e})},{label:t("common:breadcrumbs.returnsAndClaims")}]})}),i.jsx(Ye,{children:i.jsxs(Xe,{children:[i.jsx(Ze,{noMargin:!0,children:t("selectItems.heading")}),x.length===0&&i.jsx(Fe,{title:t("selectItems.emptyState.title"),subtitle:t("selectItems.emptyState.subtitle"),buttonLabel:t
102("selectItems.emptyState.button"),onButtonClick:z}),i.jsx(et,{children:x.map(n=>i.jsx(mt,{item:n,itemPayment:T[n.objectId],selected:!!p[n.objectId]||c===n.objectId,onToggle:Y},n.objectId))})]})}),i.jsx(dt,{children:i.jsxs(at,{children:[i.jsxs(rt,{children:[i.jsx(lt,{design:"body3",noMargin:!0,children:I.length===0?t("selectItems.selectToContinue"):N?t("selectItems.feeAfterReview"):t("selectItems.returnLabelFee",{returnCost:V})}),I.length>0&&!N&&i.jsx(se,{type:"button",color:"grey",variant:"text","aria-label":t("returnFeeModal.openButton"),icon:i.jsx(ie,{name:oe.INFORMATION_CIRCLE,style:{fontSize:"20px"}}),onClick:()=>g(!0)})]}),i.jsx(ct,{type:"button",label:t("selectItems.continue",{count:I.length}),disabled:I.length===0,loading:B,size:s?"small":"medium",onClick:J})]})}),i.jsx(Ae,{isOpen:!!c,item:x.find(n=>n.objectId===c),itemPayment:T[c],returnWindowClosed:U,onClose:()=>u(null),onComplete:n=>{a(R(v({},p),{[c]:n})),u(null)}},c),i.jsx(Be,{isOpen:m,onClose:()=>g(!1),order:f})]})};export{Ut as SelectItems,Kt as selectItemsLoader};
103//# sourceMappingURL=SelectItems.I9aCZn9F.bundle.js.map

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.