1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5115],{13025:function(e,n,t){"use strict";t.d(n,{Z:function(){return r}});const r=(0,t(91373).Z)("download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]])},9404:function(e,n,t){"use strict";t.d(n,{Z:function(){return r}});const r=(0,t(91373).Z)("ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]])},34464:function(e,n,t){"use strict";t.d(n,{Z:function(){return r}});const r=(0,t(91373).Z)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},92509:function(e,n,t){"use strict";t.d(n,{Z:function(){return r}});const r=(0,t(91373).Z)("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]])},58998:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/password-protect-test",function(){return t(21657)}])},65356:function(e,n,t){"use strict";t.d(n,{Z:function(){return x}});var r=t(26042),o=t(69396),l=t(85893),a=t(67294),s=t(95719),i=t(83024),c=t(96076),d=t(47041),u=t(89885),f=t(66471),p=c.jA;function x(e){var n=e.title,t=e.isOpen,x=e.toggle,m=e.allowDownload,w=void 0===m?"0":m,h=e.isEncrypted,y=void 0===h?"0":h,g=e.encryptionVersion,v=void 0===g?"1":g,b=e.encryptionKey,j=void 0===b?"":b,N=e.phone,k=void 0===N?"":N,_=e.modalHeaderProps,Z=void 0===_?{}:_,P=e.modalHeaderChildren,D=void 0===P?null:P,C=(e.watermarkConfig,e.clientUrl),F=e.link,E=e.size,R=(0,a.useContext)(u.Z).currentUser,U=(0,a.useRef)(null),L=(0,a.useMemo)((function(){var e,n;try{var t=(0,d.getCookie)(c.z1);t&&(e=new URL(t))}catch(r){console.error("error while getting base url",r)}return null!==(n=null!==C&&void 0!==C?C:null===e||void 0===e?void 0:e.host)&&void 0!==n?n:""}),[C]),z=(0,a.useMemo)((function(){return k||((null===R||void 0===R?void 0:R.phone)?btoa(c.qn.VALUE+c.qn.VALUE1+R.phone):"")}),[k,R]),O=(0,a.useCallback)((function(){var e=new URLSearchParams;return new Map([["file",F],["save_flag",w],["is_encrypted",y],["encryption_version",v],["encryption_key",j],["title",n],["phone",z],["client_url",L]]).forEach((function(n,t){n&&e.append(t,n)})),e.toString()}),[F,w,y,v,j,n,z,L]);return(0,a.useEffect)((function(){return t&&(0,f.w)("file_download",{file_name:n||F,file_extension:"pdf"}),window.print=function(e){},window.onkeydown=function(e){(80===e.keyCode||83===e.keyCode||67===e.keyCode)&&(e.ctrlKey||e.metaKey)&&!e.altKey&&!e.shiftKey&&(e.preventDefault(),e.stopImmediatePropagation?e.stopImmediatePropagation():e.stopPropagation())},function(){window.onkeydown=null}}),[t,n,F]),(0,l.jsxs)(s.Z,{unmountOnClose:!0,isOpen:t,toggle:x,fullscreen:!E,size:E||void 0,children:[x&&(0,l.jsxs)(i.Z,(0,o.Z)((0,r.Z)({toggle:x},Z),{children:[(0,l.jsx)("div",{className:"flex gap-2",children:n&&!D&&(0,l.jsx)("div",{className:"font-lg font-bold",children:n})}),D||(0,l.jsx)(l.Fragment,{})]})),(0,l.jsx)("iframe",{ref:U,src:"".concat(p,"pdfjs/web/viewer-new.html?").concat(O()),sandbox:"allow-forms allow-scripts allow-same-origin allow-popups allow-modals allow-top-navigation allow-top-navigation-by-user-activation allow-orientation-lock allow-downloads",allowFullScreen:!0,height:"100%",width:"100%",className:"".concat(E?"h-[calc(45vh-3.5rem)]":"")})]})}},72685:function(e,n,t){"use strict";t.d(n,{I:function(){return i}});var r=t(26042),o=t(99534),l=t(85893),a=t(67294),s=t(62461),i=a.forwardRef((function(e,n){var t=e.className,a=e.type,i=(0,o.Z)(e,["className","type"]);return(0,l.jsx)("input",(0,r.Z)({type:a,className:(0,s.cn)("flex h-10 w-full rounded-md border border-foreground
1/50 bg-background px-3 py-2 text-base text-foreground file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:border-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-[13px]",t),ref:n},i))}));i.displayName="Input"},93223:function(e,n,t){"use strict";t.d(n,{_:function(){return u}});var r=t(26042),o=t(99534),l=t(85893),a=t(67294),s=t(49102),i=t(12003),c=t(62461),d=(0,i.j)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),u=a.forwardRef((function(e,n){var t=e.className,a=(0,o.Z)(e,["className"]);return(0,l.jsx)(s.f,(0,r.Z)({ref:n,className:(0,c.cn)(d(),t)},a))}));u.displayName=s.f.displayName},21657:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return w}});var r=t(47568),o=t(97582),l=t(85893),a=t(29061),s=t(67294),i=t(34464),c=t(65356),d=t(83609),u=t(35739),f=t(72685),p=t(93223),x=t(36316),m=t(13025);function w(){var e=(0,s.useState)(""),n=e[0],t=e[1],w=(0,s.useState)(null),h=w[0],y=w[1],g=(0,s.useState)("1234"),v=g[0],b=g[1],j=(0,s.useState)(!1),N=j[0],k=j[1],_=(0,s.useState)(!1),Z=_[0],P=_[1],D=function(){return k((function(e){return!e}))},C=function(){var e=(0,r.Z)((function(){var e,n,t,r,l,s;return(0,o.__generator)(this,(function(o){switch(o.label){case 0:if(!h)return[2];P(!0),o.label=1;case 1:return o.trys.push([1,3,4,5]),(e=new FormData).append("file",h,h.name),e.append("password",v),[4,a.Z.create({baseURL:window.location.origin}).post("/api/password-protect-pdf",e,{responseType:"arraybuffer",responseEncoding:"binary"})];case 2:return n=o.sent(),t=new Blob([n.data],{type:"application/octet-stream"}),r=window.URL.createObjectURL(t),(l=document.createElement("a")).href=r,l.download="decrypted.pdf",l.click(),window.URL.revokeObjectURL(r),[3,5];case 3:return s=o.sent(),console.error("Failed to decrypt PDF:",s),[3,5];case 4:return P(!1),[7];case 5:return[2]}}
1))}));return function(){return e.apply(this,arguments)}}();return(0,l.jsxs)("div",{className:"flex flex-col gap-6 lg:gap-12 min-h-screen px-4 max-w-7xl mx-auto w-full py-6 lg:py-12",children:[(0,l.jsx)(d.Z,{breadcrumbs:[{label:"Home",href:"/"},{label:"Password Protect Test"}],showCategoryRow:!1}),(0,l.jsxs)("div",{className:"flex flex-col gap-6 w-full max-w-3xl mx-auto",children:[(0,l.jsxs)("section",{className:"flex flex-col gap-4 rounded-2xl border border-border bg-card p-5 sm:p-6",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsx)("h2",{className:"text-base font-semibold mb-0",children:"Preview PDF"}),(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:"Enter a PDF URL to open it in the viewer."})]}),(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsx)(p._,{htmlFor:"pdf-url",children:"PDF URL"}),(0,l.jsx)(f.I,{id:"pdf-url",type:"url",placeholder:"https://example.com/document.pdf",value:n,onChange:function(e){return t(e.target.value)}})]}),(0,l.jsx)("div",{className:"flex gap-2 justify-end",children:(0,l.jsxs)(u.z,{type:"button",variant:"outline",className:"w-full sm:w-auto",disabled:!n,onClick:D,children:[(0,l.jsx)(i.Z,{className:"size-4"}),"Preview PDF"]})})]}
1),(0,l.jsxs)("section",{className:"flex flex-col gap-4 rounded-2xl border border-border bg-card p-5 sm:p-6",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsx)("h2",{className:"text-base font-semibold mb-0",children:"Decrypt PDF"}),(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:"Upload a password-protected PDF and download the decrypted file."})]}),(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsx)(p._,{htmlFor:"pdf-file",children:"PDF file"}),(0,l.jsx)(f.I,{id:"pdf-file",type:"file",accept:"application/pdf",onChange:function(e){var n,t;y(null!==(t=null===(n=e.target.files)||void 0===n?void 0:n[0])&&void 0!==t?t:null)}}),h&&(0,l.jsx)("p",{className:"text-xs text-muted-foreground",children:h.name})]}),(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsx)(p._,{htmlFor:"pdf-password",children:"Password"}),(0,l.jsx)(f.I,{id:"pdf-password",type:"password",value:v,onChange:function(e){return b(e.target.value)},placeholder:"Enter PDF password"})]}),(0,l.jsx)("div",{className:"flex gap-2 justify-end",children:(0,l.jsxs)(u.z,{type:"button",className:"w-full sm:w-auto",disabled:!h||Z,onClick:C,children:[Z?(0,l.jsx)(x.Z,{className:"size-4 animate-spin"}):(0,l.jsx)(m.Z,{className:"size-4"}),"Decrypt & Download"]})})]})]}),N&&(0,l.jsx)(c.Z,{isOpen:N,toggle:D,allowDownload:3,isEncrypted:0,link:n,phone:"12345"})]})}},66471:function(e,n,t){"use strict";function r(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"function"===typeof window.gtag&&window.gtag("event",e,n)}t.d(n,{w:function(){return r}})},49102:function(e,n,t){"use strict";t.d(n,{f:function(){return i}});var r=t(67294),o=t(75320),l=t(85893),a=Object.defineProperty,s=(e,n)=>a(e,"name",{value:n,configurable:!0}),i=r.forwardRef(s((function(e,n){return(0,l.jsx)(o.WV.label,{...e,ref:n,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}})}),"Label"))}},function(e){e.O(0,[3609,9774,2888,179],(function(){return n=58998,e(e.s=n);var n}));var n=e.O();_N_E=n}]);
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.