PageSourceSearch

https://platform.autods.com/ay-jADGJ.js

js autods.com collected 2026-10-01 10:24:23 UTC 17,185 bytes, 1 lines download raw bytes

1try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="10c4d677-6447-4303-8b2e-c06dead978a3",e._sentryDebugIdIdentifier="sentry-dbid-10c4d677-6447-4303-8b2e-c06dead978a3")}catch(Ze){}import{j as e,r as t}from"./CSvdPb0x.js";import{aM as r,en as o,ac as i,aY as n,B as s,m as a,q as l,al as c,b as d,z as m,fc as p,df as h,fZ as u,qj as x,rL as g,gq as f,f_ as j,er as y,aa as b,z2 as P,z3 as v,j6 as w,dl as S,mQ as D,cO as C,ar as k,aX as A,dv as I,dC as T,ao as z,K as B,bs as E,aN as R,z4 as N,z5 as _,x8 as F}from"./BGGoRUt3.js";import{b as L,C as G,u as V,F as W}from"./C8Pkfv60.js";import{t as O}from"./DoDNGv0-.js";import{E as q}from"./BzrnSLIE.js";import{S as $}from"./Efi0uF49.js";import{C as M}from"./DXYOVfkY.js";import{O as Y}from"./CjDumZn2.js";import{F as Q}from"./BRWSIaLA.js";import{R as X}from"./BK0nbREG.js";import{b as Z}from"./CFOWu1GD.js";import{T as H}from"./DuuvEwoT.js";import{S as K}from"./Cm23oNRI.js";import{O as U,N as J,S as ee}from"./BLtZca33.js";import{S as te}from"./BCTOPvH4.js";import{A as re}from"./CFMPR9wT.js";import"./D6ESIijv.js";import"./B5d--HDL.js";import"./CbJpbK-9.js";import"./Y30HNPbC.js";import"./Rzx5sAEt.js";import"./CElfnH9Z.js";import"./Cw5quIGX.js";import"./SinsYfbV.js";import"./DA6mqA6e.js";import"./B8AEyK8V.js";import"./BCLNcr-V.js";import"./D6MBaAGO.js";import"./CBTsH07P.js";import"./Drr37Gfy.js";import"./B8CUchad.js";import"./CaBKSNtg.js";const oe=({type:t})=>{const i=[{type:"noProducts",props:{icon:e.jsx(o,{}),mainText:"You don't have any products yet..."}},{type:"noResults",props:{icon:e.jsx($,{}),mainText:"We didn't find any products that matched your filter"}}],{props:n}=r(i,{type:t});return e.jsx(q,{height:"80vh",...n})},ie=i.form.withConfig({componentId:"sc-lfglux-0"})(["min-height:465px;width:750px;.inactive-step{display:none;}"]),ne=i.div.withConfig({componentId:"sc-lfglux-1"})(["display:flex;align-items:center;justify-content:",";margin-top:46px;position:relative;.assign-product{position:absolute;top:50%;right:150px;transform:translateY(-50%);}"],({currentStep:e})=>0===e?"flex-end":"space-between"),se=i.div.withConfig({componentId:"sc-lfglux-2"})(["> div:not(:last-child){max-width:365px;margin-bottom:25px;label{color:",";span{display:flex;justify-content:space-between;span{display:",";color:",";font-size:",";}}input{margin-top:10px;border-color:",";}}}> p{font-family:",";color:",";margin-bottom:10px;}"],({theme:e})=>e.colorTextPrimary,({withError:e})=>e?"block":"none",({theme:e})=>e.colorDanger,({theme:e})=>e.fontSizeSmall,({theme:e,withError:t})=>t&&e.colorDanger,({theme:e})=>e.fontInterSemiBold,({theme:e})=>e.colorTextPrimary),ae=i.div.withConfig({componentId:"sc-lfglux-3"})(["display:flex;flex-direction:column;align-items:center;padding:25px 45px;height:145px;border-radius:4px;border:1px solid ",";text-align:center;transition:",";cursor:pointer;position:relative;background:",";&:hover{border:1px solid ",";}&.selected{background:#cadff8;border:1px solid ",";&:after{content:'\\2714';position:absolute;bottom:0;right:0;border-radius:4px 0 4px 0;background:",";width:17px;height:17px;display:flex;align-items:center;justify-content:center;color:#ffffff;}}> div{display:flex;align-items:center;justify-content:center;width:40px;height:40px;margin-bottom:15px;background:",";border-radius:50%;}> p{font-family:",";color:",";margin-bottom:0;.question-mark-icn{svg{path{fill:#78ace8 !important;}}}}"],({theme:e})=>e.colorGrey100,({theme:e})=>e.transitions.fast,({theme:e})=>e.darkThemeWithBg,({theme:e})=>e.colorBlue200,({theme:e})=>e.colorBlue200,({theme:e})=>e.colorBlue200,({theme:e})=>e.colorBlue200,({theme:e})=>e.fontInterBold,({theme:e})=>e.colorBlue200),le=i.div.withConfig({componentId:"sc-lfglux-4"})(["position:relative;border-radius:4px;border:1px solid ",";padding:25px 45px;display:flex;align-items:center;justify-content:center;flex-direction:column;overflow:hidden;> span{position:absolute;top:0;left:0;width:100%;display:flex;align-items:center;justify-content:center;background:",";color:",";font-size:",";}> div{width:40px;height:40px;border-radius:50%;margin-bottom:18px;background:",";}> p{display:block;height:10px;background:",";&:first-of-type{width:80px;margin-bottom:10px;}&:last-of-type{width:60px;}}"],({theme:e})=>e.colorGrey100,({theme:e})=>
1e.colorBackgroundSecondary,({theme:e})=>e.colorTextPrimary,({theme:e})=>e.fontSizeSmall,({theme:e})=>e.colorBackgroundSecondary,({theme:e})=>e.colorBackgroundSecondary),ce=i.div.withConfig({componentId:"sc-lfglux-5"})(["> label{cursor:pointer;font-family:",";color:",";display:flex;align-items:center;.error{display:",";align-items:center;color:",";font-size:",";margin-left:10px;svg{width:20px;height:20px;}}button{margin-right:15px;}}"],({theme:e})=>e.fontInterRegular,({theme:e})=>e.colorTextPrimary,({withError:e})=>e?"inline-flex":"none",({theme:e})=>e.colorDanger,({theme:e})=>e.fontSizeSmall),de=i.div.withConfig({componentId:"sc-lfglux-6"})(["padding:15px 20px;background:",";margin-top:25px;border-radius:4px;h3{font-family:",";color:",";}> div{display:flex;align-items:center;font-size:",";color:",";font-family:",";margin-bottom:15px;.ant-input-number{margin:0 10px;width:70px;.ant-input-number-handler-wrap{opacity:1;}}.ant-select{width:85px;}> span{border-radius:4px;background:",";padding:3px 5px;margin-right:5px;}}"],({theme:e})=>e.colorBackgroundSecondary,({theme:e})=>e.fontInterSemiBold,({theme:e})=>e.colorTextPrimary,({theme:e})=>e.fontSizeLarge,({theme:e})=>e.colorTextPrimary,({theme:e})=>e.fontInterRegular,({theme:e})=>e.colorBackgroundPrimary),me=i.div.withConfig({componentId:"sc-lfglux-7"})(["min-height:400px;position:relative;h3{font-family:",";color:",";margin-bottom:10px;}"],({theme:e})=>e.fontInterSemiBold,({theme:e})=>e.colorTextPrimary),pe=i.div.withConfig({componentId:"sc-lfglux-8"})(["margin-top:10px;.ant-checkbox{margin-right:20px;}"]),he=i.div.withConfig({componentId:"sc-lfglux-9"})(["margin-top:10px;border-top:1px solid ",";border-bottom:1px solid ",";height:285px;overflow:auto;padding-bottom:10px;position:relative;.ant-spin{position:absolute;left:50%;margin:10px 0;transform:translateX(-50%);}"],({theme:e})=>e.colorGrey100,({theme:e})=>e.colorGrey100),ue=i.div.withConfig({componentId:"sc-lfglux-10"})(["display:flex;align-items:center;padding:10px 0;border-bottom:1px solid ",";width:100%;.ant-checkbox{margin-right:20px;}img{width:60px;height:60px;object-fit:contain;}> div{margin-left:15px;h4{font-size:",";font-family:",";color:",";margin-bottom:0;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;max-width:600px;}span{color:",";font-family:",";&:not(:first-of-type){position:relative;margin-left:17px;&:before{content:'';display:block;width:1px;height:12px;background:",";position:absolute;top:50%;left:-8px;transform:translateY(-50%);}}}}"],({theme:e})=>e.colorGrey100,({theme:e})=>e.fontSizeLarge,({theme:e})=>e.fontInterSemiBold,({theme:e})=>e.colorTextPrimary,({theme:e})=>e.colorTextSecondary,({theme:e})=>e.fontInterRegular,({theme:e})=>e.colorTextSecondary),xe=i(Y).withConfig({componentId:"sc-lfglux-11"})(["margin-top:10px;"]),ge=t.memo(({id:t,title:r,mainPictureUrl:o,amountOfVariations:i,itemIdOnSite:s,innerRef:a})=>e.jsxs(ue,{children:[e.jsx(M,{value:t}),e.jsx("img",{ref:a,src:o?.url,alt:"product-img",onError:n}),e.jsxs("div",{children:[e.jsx("h4",{children:r}),e.jsxs("span",{children:[i," Variations"]}),e.jsxs("span",{children:["Item ID: ",s]})]})]})),{Group:fe}=M,je=t.memo(({results:t,total:r,isLoading:o,lastProductRef:i,selected:n,setSelected:d})=>e.jsxs(e.Fragment,{children:[e.jsxs(pe,{children:[e.jsx(M,{checked:n.indeterminate||n.selectedAllProducts,indeterminate:n.indeterminate,onChange:({target:{checked:e}})=>{d({selectedProducts:e?a(t,"id"):[],selectedAllProducts:!1,indeterminate:e})},children:"Select All"}),!o&&n.selectedProducts.length===t.length&&e.jsx(xe,{children:n.selectedAllProducts?e.jsxs(s,{type:"text",onClick:()=>{d({selectedProducts:[],selectedAllProducts:!1,indeterminate:!1})},children:["Cancel all ",r," selected products"]}):e.jsxs(e.Fragment,{children:["All ",t.length," items on this page are selected",e.jsxs(s,{type:"text",onClick:()=>{d({...n,selectedAllProducts:!0,indeterminate:!1})},children:["Select all ",r," products"]})]})})]}),e.jsx(he,{children:e.jsxs(fe,{onChange:e=>{d({...n,selectedProducts:e,indeterminate:e.length})},value:n.selectedProducts,children:[a(t,({id:r,...o},s)=>e.jsx(ge,{id:r,isSelected:l(n.selectedProducts,r),innerRef:s+1===t.length?
1i:null,...o},r)),o&&e.jsx(c,{size:"large"}),!o&&!t.length&&e.jsx(oe,{type:"noResults"})]})})]})),ye=P,be=t.memo(r=>{const o=d(),{limit:i,order_by:n}=m(p,{type:S}),s=m(h),a=m(u,{type:f}),l=m(x,{type:f}),c=g(a,f),P=t.useRef(null),[D,C]=t.useState(0),[k,A]=t.useState([]),[I,T]=t.useState(0),[z,B]=t.useState(!1),E=(e=0)=>({limit:i,offset:e,condition:l,filters:c,order_by:n,product_status:2,projection:ye}),R=async(e=0,t=0)=>{B(!0);const{success:r,data:o}=await b.getProductList({storeIds:s},E(e));if(r){const r=v(o);A(e?[...k,...r.results]:r.results),0===t&&(async(e=0)=>{const{data:t}=await b.productsCount({storeIds:s},E(e)),r=w(t);T(r.total_results)})(e),C(e)}B(!1)},N=t.useCallback(e=>{P&&P.current&&P.current.disconnect(),P.current=new IntersectionObserver(e=>{e[0].isIntersecting&&k.length<I&&R(D+i,I)}),e&&P.current.observe(e)},[k,I,D]);return t.useEffect(()=>()=>{o(j("and",f)),o(y([],f))},[]),t.useEffect(()=>{R()},[a]),e.jsx(me,{children:k.length||a.length||z?e.jsxs(me,{children:[e.jsx("h3",{children:"Select products to assign"}),e.jsx(Q,{type:f}),e.jsx(je,{results:k,total:I,isLoading:z,lastProductRef:N,...r})]}):e.jsx(oe,{type:"noProducts"})})}),Pe={increase:{period:"raisePeriod",amountSales:"raiseAmountSales",amountDays:"raiseAmountDays",changeProfit:"raisePercentageProfit",profit:"maxPercentageProfit",changeProfitDollar:"raiseDollarProfit",profitDollar:"maxDollarProfit"},decrease:{period:"dropPeriod",amountSales:"dropAmountSales",amountDays:"dropAmountDays",changeProfit:"dropPercentageProfit",profit:"minPercentageProfit",changeProfitDollar:"dropDollarProfit",profitDollar:"minDollarProfit"}},ve=[{value:1,label:"Days"},{value:7,label:"Weeks"},{value:30,label:"Months"}],we={width:"95px"},Se=({pricing:t})=>{const{control:r,setValue:o,trigger:i,watch:n}=L(),{increase:s,decrease:a}=n();return e.jsxs(ce,{withError:!s&&!a,children:[e.jsxs("label",{children:[e.jsx(G,{name:t,control:r,render:({value:r,onChange:n})=>e.jsx(D,{checked:r,onChange:e=>(n(e),(e=>(A(Pe[t],t=>{o(t,e?$e[t]:null)}),i()))(e))})}),t===ke?"Raise":"Decrease"," Price by Sales Performance",!n(t)&&e.jsxs("span",{className:"error",children:[e.jsx(C,{})," Raise Price or Decrease Price must be enabled"]})]}),e.jsxs(de,{className:n(t)?"":"disabled-events",children:[e.jsx("h3",{children:"When"}),e.jsxs("div",{children:["Number of sales is ",t===ke?"higher":"lower"," than",e.jsx(G,{control:r,name:Pe[t].amountSales,render:t=>e.jsx(H,{min:1,...t})}),"Per",e.jsx(G,{control:r,name:Pe[t].amountDays,render:t=>e.jsx(H,{min:1,...t})}),e.jsx(G,{control:r,name:Pe[t].period,render:({value:t,onChange:r})=>e.jsx(k,{defaultActiveFirstOption:!0,popupMatchSelectWidth:!1,options:ve,value:t,onChange:r})})]})]}),e.jsxs(de,{className:n(t)?"":"disabled-events",children:[e.jsx("h3",{children:"Set price"}),e.jsxs("div",{children:[t===ke?"Raise":"Decrease"," the product price by",e.jsx(G,{control:r,name:Pe[t].changeProfit,render:t=>e.jsx(H,{style:we,min:.01,step:.01,formatter:e=>`${e}%`,...t})}),t===ke?"up":"down"," to a limit of",e.jsx(G,{control:r,name:Pe[t].profit,render:r=>e.jsx(H,{min:t===ke?1:.01,formatter:e=>`${e}%`,...r})})]}),e.jsxs("div",{children:[e.jsx("span",{children:"And"})," ",t===ke?"increase":"decrease"," the product price by",e.jsx(G,{control:r,name:Pe[t].changeProfitDollar,render:t=>e.jsx(H,{style:we,min:.01,max:99.99,step:.01,formatter:e=>`$ ${e}`,...t})})," up to",e.jsx(G,{control:r,name:Pe[t].profitDollar,render:r=>e.jsx(H,{style:we,min:t===ke?.01:1,max:99.99,step:.01,formatter:e=>`$ ${e}`,...r})})]})]})]})},De="name",Ce="type",ke="increase",Ae="decrease",Ie="raisePeriod",Te="raiseAmountSales",ze="raiseAmountDays",Be="raisePercentageProfit",Ee="raiseDollarProfit",Re="dropPeriod",Ne="dropAmountSales",_e="dropAmountDays",Fe="dropPercentageProfit",Le="dropDollarProfit",Ge="minDollarProfit",Ve="maxDollarProfit",We="minPercentageProfit",Oe="maxPercentageProfit",qe=U().shape({[De]:ee().required("Name is required").nullable(),[Ce]:J().positive().integer(),[ke]:Z(),[Ae]:Z(),[Ie]:J().integer().positive().when(ke,{is:!1,then:J().nullable()}),[Te]:J().integer().positive().when(ke,{is:!1,then:J().nullable()}),[ze]:J().integer().positive().when(ke,{is:!1,then:J().nullable()}),[Be]:J().min(.01).when(ke,{is:!1,then:J().nullable()}),[Ee]:J().min(.01).when(ke,{is:!1,then:J().nullable()}),[Oe]:J().min(1).when(ke,{is:!1,then:J().nullable()}),[Ve]:J().positive().min(.01).when(ke,{is:!1,then:J().nullable()}),[Re]:J().integer().positive().when(Ae,{is:!1,then:J().nullable()}),[Ne]:J().integer().positive().when(Ae,{is:!1,then:J().nullable()}),[_e]:J().integer().positive().when(Ae,{is:!1,then:J().nullable()}),[Fe]:J().min(.01).when(Ae,{is:!1,then:J().nullable()}),[Le]:J().min(.01).positive().when(Ae,{is:!1,then:J().nullable()}),[We]:J().min(.01).when(Ae,{is:!1,then:J().nullable()}),[Ge]:J().positive().min(1).when(Ae,{is:!1,then:J().nullable()})}),$e={[De]:null,[Ce]:1,[ke]:!0,[Ae]:!0,[Ie]:1,[Te]:1,[ze]:1,[Be]:.01,[Ee]:.01,[Re]:1,[Ne]:1,[_e]:1,[Fe]:.01,[Le]:.01,[We]:1,[Oe]:1,[Ge]:1,[Ve]:1},Me=[{icon:e.jsx(K,{}),title:"Sales Base Pricing",tooltipText:"Automate your products' pricing: When they sell - increase their price to profit more, when they don't - decrease it to be more competitive to gain more sales.",tooltipLink:I.autoDs.automation,selected:!0,available:!0,type:1,steps:[{title:"Pricing When Sales Increase",component:e.jsx(Se,{pricing:"increase"})},{title:"Pricing When Sales Decrease",component:e.jsx(Se,{pricing:"decrease"})}],getDefaultValues:e=>e?{...e,[ke]:!!e.raiseAmountDays,[Ae]:!!e.dropAmountDays,[Ie]:1,[Re]:1}:$e,schema:qe}],Ye=()=>{const{control:t,errors:r,trigger:o}=L();return e.jsxs(se,{withError:!!r[De],children:[e.jsx("div",{children:e.jsxs("label",{children:[e.jsxs("span",{children:["Automation Name",e.jsx("span",{children:r[De]?.message})]}),e.jsx(G,{name:De,control:t,render:({value:t,onChange:r})=>e.jsx(T,{autoFocus:!0,size:"large",onFocus:()=>
1{if(z(t))return(async()=>{await o(De)})()},placeholder:"Enter name",value:t,onChange:({target:e})=>r(e.value),maxLength:250})})]})}),e.jsx("p",{children:"Select Automation Type"}),e.jsx(G,{name:Ce,control:t,render:({value:t,onChange:r})=>e.jsx(X,{gutter:[20,20],children:a(Me,({available:o,icon:i,title:n,tooltipLink:s,tooltipText:a,type:l})=>e.jsx(B,{span:6,children:o?e.jsxs(ae,{className:l===t?"selected":"",onClick:()=>r(l),children:[e.jsx("div",{children:i}),e.jsxs("p",{children:[n,e.jsxs(E,{children:[a,e.jsx("a",{href:s,rel:"noopener noreferrer",target:"_blank",children:" More info"})]})]})]}):e.jsxs(le,{children:[e.jsx("span",{children:"Coming Soon"}),e.jsx("div",{}),e.jsx("p",{}),e.jsx("p",{})]})},l))})})]})},Qe=({steps:t,currentStep:r,setCurrentStep:o,isEditAutomation:i})=>e.jsx(re,{isEditAutomation:i,children:e.jsx(te,{labelPlacement:"vertical",current:r,items:a(t,({title:e},t)=>({title:e,onClick:()=>i&&o(t)})),className:"steps"})}),Xe=({onModalClose:o,automation:i})=>{const n=d(),[l,c]=t.useState(0),[m,p]=t.useState(Me[0]),[h,u]=t.useState({selectedProducts:[],selectedAllProducts:!1,indeterminate:!1}),{getDefaultValues:x,schema:g,steps:f}=m,j=!!i,y=h?.selectedAllProducts||h?.selectedProducts.length,b=V({mode:"onChange",resolver:O(g),defaultValues:x(i)}),{errors:P,formState:{isSubmitting:v,isValid:w},handleSubmit:D,getValues:C,watch:k}=b;t.useEffect(()=>{p(r(Me,{type:k(Ce)}))},[k(Ce)]);const A=[{title:"General Settings",component:e.jsx(Ye,{})},...f,...j?[]:[{title:"Assign Products",component:e.jsx(be,{selected:h,setSelected:u})}]];return e.jsxs(ie,{onSubmit:D(async()=>{const e=C(),{raiseAmountDays:t,raisePeriod:r,dropAmountDays:s,dropPeriod:a}=e;e.raiseAmountDays=t&&t*r,e.dropAmountDays=s&&s*a;const l=R(e,[Ie,Re,ke,Ae]);let c;j?await n(N({...i,...l})):c=await n(_({...l,withProducts:y})),y&&n(F(h.selectedProducts,S,{pricing_automation_id:c},null,h.selectedAllProducts)),o()}),children:[e.jsxs(W,{...b,children:[e.jsx(Qe,{steps:A,currentStep:l,setCurrentStep:c,isEditAutomation:j}),a(A,({title:t,component:r},o)=>e.jsx("div",{className:o===l?"":"inactive-step",children:r},t))]}),e.jsxs(ne,{currentStep:l,children:[0!==l&&e.jsx(s,{type:"text",size:"large",onClick:()=>{c(l-1)},children:"Back"}),l!==A.length-1&&e.jsx(s,{type:"primary",size:"large",disabled:!z(P[De]),onClick:()=>{c(l+1)},children:"Next"}),!j&&l===A.length-1&&e.jsx(s,{type:"text",size:"large",htmlType:"submit",className:"assign-product",disabled:!w,children:"I will assign products later"}),l===A.length-1&&e.jsx(s,{type:"primary",size:"large",htmlType:"submit",disabled:j?!w:!(w&&y),loading:v,children:j?"Save":"Finish"})]})]})};export{Xe as default};

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.