1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[51897,74278],{42529:(e,t,s)=>{s.d(t,{A:()=>r});let r=(0,s(71847).A)("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]])},51897:(e,t,s)=>{s.r(t),s.d(t,{InstagramBurnedModal:()=>u});var r=s(95155),a=s(12115),l=s(67161),n=s(65229),i=s(6132),d=s(42529),c=s(93499),o=s(35299),x=s(18085),f=s(89419),m=s(28445);function u(e){let{burnedVideoUrl:t,initialCaption:s,defaultDmLink:u,product:h,productTitle:p,coverOffsetMs:b,onClose:g,onPosted:y}=e,[j,k]=(0,a.useState)((s||"").slice(0,2200)),[v,N]=(0,a.useState)(!1),[w,C]=(0,a.useState)(null),[A,S]=(0,a.useState)(!1),I=(0,m.$6)(),[z,D]=(0,a.useState)(I&&!!(u&&u.trim())),[E,P]=(0,a.useState)("LINK"),[L,K]=(0,a.useState)((u||"").trim()),M=(0,a.useCallback)(async()=>{if(v||A)return;let e=z&&/^https?:\/\//i.test(L.trim());N(!0),C(null);try{let s=await fetch("/api/instagram/publish-burned",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({videoUrl:t,caption:j,...h&&h.trim()?{product:h.trim(),productTitle:(p||"").trim()}:{},..."number"==typeof b&&b>=0?{thumbOffsetMs:Math.round(b)}:{},...e?{autoDm:{link:L.trim(),keyword:E.trim()||"LINK"}}:{}})}),r=await s.json();if(!s.ok||!r.ok)return void C(r.error||"Instagram publish failed.");S(!0),y&&y()}catch(e){C(e instanceof Error?e.message:"Posting failed.")}finally{N(!1)}},[v,A,t,j,h,p,b,z,E,L,y]),T=!v,R=(0,a.useRef)(null),_=(0,f.f)(!0,R,()=>{T&&g()});return(0,r.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm p-4",onClick:()=>T&&g(),onKeyDown:_,role:"presentation",children:(0,r.jsxs)("div",{ref:R,className:"bg-white dark:bg-[#1c1c1e] rounded-2xl shadow-2xl max-w-lg w-full max-h-[92vh] flex flex-col outline-none",onClick:e=>e.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":"Post Short to Instagram",tabIndex:-1,children:[(0,r.jsxs)("div",{className:"flex items-start justify-between p-5 border-b border-gray-100 dark:border-white/10",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,r.jsx)("span",{className:"inline-flex items-center justify-center w-8 h-8 rounded-lg flex-shrink-0",style:{background:"linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%)"},children:(0,r.jsx)(l.A,{size:16,className:"text-white"})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-base font-semibold text-[#1d1d1f] dark:text-[#f5f5f7]",children:"Post Short to Instagram"}),(0,r.jsx)("p",{className:"text-[11px] text-[#6e6e73] dark:text-[#ebebf0] mt-0.5",children:"Review your caption, then post as a Reel"})]})]}),(0,r.jsx)("button",{onClick:g,disabled:!T,className:"text-[#86868b] hover:text-[#1d1d1f] dark:hover:text-[#f5f5f7] disabled:opacity-40 flex-shrink-0",children:(0,r.jsx)(n.A,{size:18})})]}),(0,r.jsx)("div",{className:"overflow-y-auto flex-1 p-5",children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)("div",{className:"flex justify-center",children:(0,r.jsx)("div",{className:"rounded-xl overflow-hidden bg-[#000] aspect-[9/16] max-w-[200px]",children:(0,r.jsx)("video",{src:t,controls:!0,playsInline:!0,className:"w-full h-full"})})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-[10px] font-semibold text-[#3a3a3c] dark:text-[#d2d2d7] uppercase tracking-wide mb-1.5",children:"Caption (edit freely)"}),(0,r.jsx)("textarea",{value:j,onChange:e=>k(e.target.value),maxLength:2200,rows:7,className:"w-full text-sm px-3 py-2 rounded-md border border-gray-200 dark:border-white/10 bg-white dark:bg-[#2c2c2e] text-[#1d1d1f] dark:text-[#f5f5f7]"}),(0,r.jsxs)("p",{className:"text-[10px] text-[#86868b] mt-1",children:[j.length," / 2200 \xb7 Hashtags + disclaimer included."]})]}),I&&(0,r.jsxs)("div",{className:"rounded-lg border border-gray-200 dark:border-white/10 p-3",children:[(0,r.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[(0,r.jsx)("input",{type:"checkbox",checked:z,onChange:e=>D(e.target.checked),className:"accent-[#7C3AED]"}),(0,r.jsx)("span",{className:"text-[13px] font-medium text-[#1d1d1f] dark:text-[#f5f5f7]",children:"Auto-DM the link when someone comments"})]}),z&&(0,r.jsxs)("div",{className:"mt-2.5 flex flex-col gap-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"text-[11px] text-[#86868b] shrink-0",children:"When they comment"}),(0,r.jsx)("input",{value:E,onChange:e=>P(e.target.value.replace(/\s+/g," ").trimStart().slice(0,30)),placeholder:"LINK",className:"flex-1 text-sm px-2.5 py-1.5 rounded-md border border-gray-200 dark:border-white/10 bg-white dark:bg-[#2c2c2e] text-[#1d1d1f] dark:text-[#f5f5f7]"})]}),(0,r.jsx)("input",{value:L,onChange:e=>K(e.target.value),placeholder:"Link to DM them (https://â¦)",className:"w-full text-sm px-2.5 py-1.5 rounded-md border border-gray-200 dark:border-white/10 bg-white dark:bg-[#2c2c2e] text-[#1d1d1f] dark:text-[#f5f5f7]"}),(0,r.jsxs)("p",{className:"text-[10px] text-[#86868b]",children:["Anyone who comments ",(0,r.jsx)("span",{className:"font-semibold",children:(E||"LINK").toUpperCase()}),' on this Reel gets your link in their DMs automatically. Tip: add "Comment ',(E||"LINK").toUpperCase(),' for the link" to the caption or the video.']})]})]}),w&&(0,r.jsx)("div",{className:"rounded-lg border-[#ff3b30]/20 bg-[#ff3b30]/5 p-3",children:(0,r.jsxs)("p",{className:"text-xs text-[#ff3b30] flex items-center gap-1.5",children:[(0,r.jsx)(i.A,{size:12})," ",w]})}),A&&(0,r.jsxs)("div",{className:"rounded-lg border-[#34c759]/20 bg-[#34c759]/5 p-3 flex flex-col gap-1",children:[(0,r.jsxs)("p",{className:"text-xs text-[#34c759] flex items-center gap-1.5",children:[(0,r.jsx)(d.A,{size:12})," Reel live on Instagram."]}),(0,r.jsxs)("a",{href:"https://www.instagram.com/",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-[11px] text-[#7C3AED] hover:underline self-start",children:["Open Instagram ",(0,r.jsx)(c.A,{size:10})]})]})]})}),(0,r.jsxs)("div",{className:"flex items-center justify-end gap-2 p-5 border-t border-gray-100 dark:border-white/10",children:[(0,r.jsx)("button",{onClick:g,disabled:!T,className:"btn-secondary text-sm",children:"Cancel"}),(0,r.jsx)("button",{onClick:()=>void M(),disabled:v||A,className:"inline-flex items-center gap-1.5 px-4 py-2 rounded-lg text-sm font-semibold text-white disabled:opacity-50",style:{background:A?"#34c759":"linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%)"},children:v?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(o.A,{size:14,className:"animate-spin"})," Postingâ¦"]}):A?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(d.A,{size:14})," Posted"]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(x.A,{size:14})," Post to Instagram"]})})]})]})})}},89419:(e,t,s)=>{s.d(t,{f:()=>l});var r=s(12115);
1let a='a[href],button:not([disabled]),input:not([disabled]):not([type="hidden"]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"]),[contenteditable="true"],[role="button"]:not([disabled])';function l(e,t,s){return(0,r.useEffect)(()=>{if(!e)return;let s=document.activeElement||null,r=document.body.style.overflow;document.body.style.overflow="hidden";let l=window.setTimeout(()=>{let e=t.current;if(!e)return;let s=e.querySelector(a);if(s)try{s.focus({preventScroll:!0})}catch(e){}else try{var r;null==(r=e.focus)||r.call(e,{preventScroll:!0})}catch(e){}},0);return()=>{if(window.clearTimeout(l),document.body.style.overflow=r,s&&document.body.contains(s))try{s.focus({preventScroll:!0})}catch(e){}}},[e,t]),(0,r.useCallback)(r=>{if(!e)return;if("Escape"===r.key){r.stopPropagation(),s();return}if("Tab"!==r.key)return;let l=t.current;if(!l)return;let n=Array.from(l.querySelectorAll(a)).filter(e=>e.offsetWidth>0||e.offsetHeight>0||e===document.activeElement);if(0===n.length)return void r.preventDefault();let i=n[0],d=n[n.length-1],c=document.activeElement;r.shiftKey?c!==i&&l.contains(c)||(r.preventDefault(),d.focus()):c===d&&(r.preventDefault(),i.focus())},[e,t,s])}}}]);
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.