1"use strict";(self.webpackChunk_vndr_ship_client=self.webpackChunk_vndr_ship_client||[]).push([[2695],{32695(e,t,i){i.r(t),i.d(t,{default:()=>f});var n=i(71288),r=i(26600),l=i(69436),s=i(28872);const c=()=>(0,s.jsx)("div",{className:l.A.container,children:(0,s.jsx)("img",{src:r.HX,alt:"logo",style:{height:20,width:"auto"}})});var a=i(64309),o=i(67252),d=i(58072),p=i(70929),u=i(84489),m=i(98477),v=i(37643);const h=["html"];const w=function(e){let t=e.html,i=(0,v.A)(e,h);const n=(0,o.useRef)(null);return(0,o.useEffect)(()=>{if(!t||!n.current)throw new Error("html prop can't be null");n.current.innerHTML=t;Array.from(n.current.getElementsByTagName("script")).forEach(e=>{const t=document.createElement("script");t.text=e.text,e.parentNode.replaceChild(t,e)})},[t,n]),(0,s.jsx)("div",(0,m.A)((0,m.A)({},i),{},{ref:n}))},f=()=>{const e=(0,n.useDispatch)(),t=(0,n.useSelector)(e=>null===e||void 0===e?void 0:e.templatePreview);(0,o.useEffect)(()=>{window.onstorage=()=>{const t=JSON.parse(window.localStorage.getItem("persist:root")),i=JSON.parse(t.templatePreview);e((0,d.az)(i))}},[]);const i=null!==t&&void 0!==t&&t.isActive?(0,p.Bw)({products:[{title:"Preview Item 1",quantity:1},{title:"Preview Item 2",quantity:2}],trackingDetails:Object.entries((0,p.qS)(p.YG)),status:"out_for_delivery",template:{templateHtml:(0,p.fD)(null===t||void 0===t?void 0:t.html,p.wj)}}):"";return(0,o.useEffect)(()=>{document.title="Template Preview - ShipFare"},[]),(0,s.jsxs)("div",{className:a.A.container,children:[null!==t&&void 0!==t&&t.isActive?(0,s.jsx)(w,{className:a.A.templateContainer,html:i||"<div></div>"}):(0,s.jsx)("div",{className:a.A.noActive,children:(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{children:"No preview active :("}),(0,s.jsx)("p",{children:"There is no currently active template preview. Please return to the templates page to select a template."}),(0,s.jsx)(u.$n,{variant:"contained",color:"primary",onClick:()=>{const e="".concat(window.location.protocol,"//").concat(window.location.host,"/preset/tracking-templates");window.open(e,"_blank")},children:"Back to templates page"})]})}),(0,s.jsx)(c,{})]})}}}]);
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.