1try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},a=(new e.Error).stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="28180d03-48e6-41f0-ac0d-6c97d79da51c",e._sentryDebugIdIdentifier="sentry-dbid-28180d03-48e6-41f0-ac0d-6c97d79da51c")}catch(u){}import{r as e,j as a}from"./CSvdPb0x.js";import{ac as t,dD as r,kb as n,m as s,B as i,k7 as d,aL as o}from"./B97aNPiN.js";import"./D6ESIijv.js";const l=[{macroName:"Buyer first name",key:"buyer_first_name"},{macroName:"Buyer last name",key:"buyer_last_name"},{macroName:"Buyer username",key:"buyer_username"},{macroName:"Tracking number",key:"tracking_number"},{macroName:"Shipping carrier",key:"shipping_carrier"},{macroName:"Product title",key:"product_title"},{macroName:"Sell order ID",key:"sell_order_id"}],c=t.div.withConfig({componentId:"sc-14875nw-0"})(["width:440px;color:",";textarea{min-height:200px;resize:none}.ant-input-affix-wrapper{.ant-input-prefix{color:",";}.ant-input:not(:first-child){padding-left:20px;}}> button{display:block;margin-left:auto;}"],({theme:e})=>e.colorTextPrimary,({theme:e})=>e.colorTextPrimary),p=t.div.withConfig({componentId:"sc-14875nw-1"})(["display:flex;flex-flow:row wrap;margin-bottom:16px;> div{display:flex;margin:0 3px 0 0;&:first-child{margin-left:3px;}span{white-space:nowrap;margin:0;}}"]),m=e.memo(({onModalClose:t,id:m,...u})=>{const[h,y]=e.useState(u.snippetName),[f,x]=e.useState(u.body),[g,b]=e.useState(u.shortcode),[j,k]=e.useState({start:0,end:0}),[w,S]=e.useState(!1),v=!!m,_=(v?"Edit":"Add")+" Snippet",N=v?"Save":"Add",C=!h||!f||!g,I=({target:{selectionStart:e,selectionEnd:a}})=>{k({start:e,end:a})};return a.jsxs(c,{className:"modal-form mb-16",children:[a.jsx("h2",{children:_}),a.jsxs("label",{children:["Name",a.jsx("div",{children:a.jsx(r,{type:"text",size:"large",autoFocus:!0,value:h,placeholder:"Enter Snippet Name",onChange:({target:{value:e}})=>y(e)})})]}),a.jsxs("label",{children:["Body",a.jsx("div",{children:a.jsx(n,{value:f,placeholder:"Enter Snippet Body",onClick:I,onKeyUp:I,onChange:e=>{I(e),x(e.target.value)}})})]}),a.jsxs(p,{children:["Insert:",s(l,({macroName:e,key:t},r)=>a.jsxs("div",{children:[a.jsx("div",{className:"default ant-btn-link",children:a.jsx("span",{onClick:()=>(e=>{const{start:a,end:t}=j;x((r="")=>`${r.slice(0,a)}{{ ${e} }}${r.slice(t)}`)})(t),children:e})}),r+1===l.length?"":","]},r))]}),a.jsxs("label",{children:["Shortcode",a.jsx("div",{children:a.jsx(r,{type:"text",size:"large",value:g,prefix:"#",placeholder:"Enter Snippet Shortcode",onChange:({target:{value:e}})=>b(e.trim())})})]}),a.jsx(i,{type:"primary",size:"large",disabled:C,loading:w,onClick:async()=>{S(!0);const e=v?[{id:m},{name:h,body:f,shortcode:g}]:[{name:h,body:f,shortcode:g}],a=d[v?"updateSnippet":"createSnippet"],r=v?"updated":"created",{success:n,error:s}=await a(...e);o(...n?["success",`${h} Snippet was ${r}`]:["error",s]),S(!1),n&&t()},children:N})]})});export{m 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.