PageSourceSearch

https://portaly.cc/_next/static/chunks/pages/admin/support-36351faf85055972.js

js portaly.cc collected 2026-09-24 08:45:12 UTC 77,299 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[26349,46880],{93599:(e,a,t)=>{var r=t(44394);e.exports=function(e,a,t){for(var n=-1,l=e.length;++n<l;){var o=e[n],i=a(o);if(null!=i&&(void 0===s?i==i&&!r(i):t(i,s)))var s=i,d=o}return d}},3335:e=>{e.exports=function(e,a){return e>a}},54128:(e,a,t)=>{var r=t(31800),n=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(n,""):e}},49698:e=>{var a=RegExp("[\\u200d\ud800-\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return a.test(e)}},31800:e=>{var a=/\s/;e.exports=function(e){for(var t=e.length;t--&&a.test(e.charAt(t)););return t}},85015:(e,a,t)=>{var r=t(72552),n=t(56449),l=t(40346);e.exports=function(e){return"string"==typeof e||!n(e)&&l(e)&&"[object String]"==r(e)}},17400:(e,a,t)=>{var r=t(99374),n=1/0;e.exports=function(e){return e?(e=r(e))===n||e===-n?(e<0?-1:1)*17976931348623157e292:e==e?e:0:0===e?e:0}},61489:(e,a,t)=>{var r=t(17400);e.exports=function(e){var a=r(e),t=a%1;return a==a?t?a-t:a:0}},99374:(e,a,t)=>{var r=t(54128),n=t(23805),l=t(44394),o=0/0,i=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,d=/^0o[0-7]+$/i,u=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(l(e))return o;if(n(e)){var a="function"==typeof e.valueOf?e.valueOf():e;e=n(a)?a+"":a}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var t=s.test(e);return t||d.test(e)?u(e.slice(2),t?2:8):i.test(e)?o:+e}},61039:(e,a,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/support",function(){return t(82090)}])},11454:(e,a,t)=>{"use strict";t.d(a,{A:()=>l});var r=t(2445),n=t(27006);let l=function(e){let{children:a,control:t,...l}=e,{getInputProps:o,getCheckboxProps:i}=(0,n.useRadio)(l),s=o(),d=i();return(0,r.FD)(n.Box,{as:"label",children:[(0,r.Y)("input",{...s}),(0,r.Y)(n.Box,{...d,cursor:"pointer",borderWidth:"1px",borderRadius:"md",boxShadow:"sm",_checked:{bg:"custom.primary",color:"white",borderColor:"custom.primary",_readOnly:{opacity:1}},_focus:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed"},_readOnly:{opacity:.4,cursor:"default"},fontSize:"0.875em",px:4,py:2,children:a})]})}},58328:(e,a,t)=>{"use strict";t.d(a,{A:()=>o});var r=t(2445),n=t(40133);let l=(0,t(96540).forwardRef)((e,a)=>(0,r.Y)(n.E,{lineHeight:"normal",fontSize:"0.875em",color:"gray.500",ref:a,...e}));l.displayName="HelperText";let o=l},81670:(e,a,t)=>{"use strict";t.d(a,{A:()=>l});var r=t(2445),n=t(27006);t(96540);let l=e=>{let{children:a,...t}=e;return(0,r.Y)(n.Box,{borderRadius:"2xl",boxShadow:"md",overflow:"hidden",userSelect:"none",pb:"2",...t,children:a})}},5712:(e,a,t)=>{"use strict";t.d(a,{A:()=>D});var r=t(2445),n=t(27006),l=t(96540),o=t(14120),i=t(47648),s=t(46479),d=t(6442),u=t(40255),c=t(96323),m=t(78459),p=t(41012),g=t(73013),f=t(96007);let h={".swiper-slide":{position:"relative",textAlign:"start",fontSize:"18px",background:"#fff"},".swiper-pagination-bullet":{width:{base:"50px",md:"100px"},height:"7px",textAlign:"center",borderRadius:"5px",fontSize:"0px",color:"#000",opacity:1,background:"rgba(0, 0, 0, 0.2)"},".swiper-pagination-bullet-active":{background:"#11A4A1"},".swiper-pagination-horizontal":{height:"100px",top:"-10px"}},M=e=>{e&&"function"==typeof window.gtag&&window.gtag("event","click_button",{button_name:e})},b=e=>{let{onClose:a,setActivePage:t,finalPages:o,buttonName:i,onRead:s,firstPages:u,firstButtonName:m,oneSlider:p,ctaButtonProps:g}=e,f=(0,d.A)(),h=(0,c.Mn)();(0,l.useEffect)(()=>{h&&h.on("slideChange",function(){t(h.activeIndex)})},[h]);let M=null!=i?i:f.formatMessage({defaultMessage:"立即使用",id:"admin.coverModal.立即使用"}),b=(0,l.useMemo)(()=>o||p?M:u&&m?m:f.formatMessage({defaultMessage:"下一步",id:"admin.coverModal.下一步"}),[h,u,o]);return(0,r.Y)(n.Button,{borderRadius:"20px",bg:"#7C07A5",border:"none",w:"8em",_focusVisible:"none",_hover:{bg:"#51056b"},...g,onClick:()=>{(o||p)&&(s&&s(),a()),h&&h.slideNext()},children:b})},v=e=>{let{isEn:a}=e,t=(0,c.Mn)();return(0,r.Y)(r.FK,{children:(0,r.Y)(n.Button,{borderRadius:"20px",colorScheme:"ghost",color:"gray.300",border:"none",w:"3em",onClick:()=>{t.slidePrev()},_focusVisible:"none",children:a?"Prev":"上一步"})})},y=e=>{if(e&&"function"==typeof window.gtag)return window.gtag("event","button_visible",{button_name:e}),!0},x=e=>{let{isOpen:a,onClose:t,id:o,sliderContent:i,noCloseButton:x,firstButtonName:Y,buttonName:A,closeOnOverlayClick:D,onRead:w,onCTAClick:S,ctaButtonProps:C}=e,I="en"===(0,d.A)().locale,[T,F]=(0,l.useState)(0),k=0===T,R=T===(null==i?void 0:i.length)-1,N=(null==i?void 0:i.length)===1,{emit:O}=(0,s.A)(),P=(0,p.A)(()=>(O(f.Xy,{bannerId:o}),y("modal.".concat(o)))),E=(0,g.A)("admin");return(0,r.FD)(n.Modal,{isOpen:a,onClose:t,size:"xl",isCentered:!0,closeOnOverlayClick:!!D,initialFocusRef:null,closeOnEsc:E,children:[(0,r.Y)(n.ModalOverlay,{}),(0,r.FD)(n.ModalContent,{px:{base:1,md:15},py:{base:5,lg:5},ref:P,children:[(R||(null==i?void 0:i.length)===1)&&!x&&(0,r.Y)(n.ModalCloseButton,{onClick:()=>{o&&(w(),O(f.m1,{bannerId:o}),M("modal.modalCloseButton.".concat(o)))},_focusVisible:"none"}),(0,r.Y)(n.ModalBody,{p:{base:3,md:""},children:(0,r.Y)(n.Box,{w:"100%",pos:"relative",mt:"0",sx:h,children:(0,r.FD)(c.RC,{cssMode:!0,pagination:!0,mousewheel:!0,keyboard:!0,modules:[u.Vx,u.dK,u.FJ,u.s3],
1children:[null==i?void 0:i.map(e=>{var a,t;return(0,r.Y)(c.qr,{children:(0,r.FD)(n.VStack,{alignItems:"flex-start",mt:N?0:"1.5em",children:[(0,r.FD)(n.Box,{px:{base:"0",md:"1.5em"},children:[(0,r.Y)(n.Text,{fontSize:"24px",fontWeight:"900",children:null==e?void 0:e.title}),(0,r.FD)(n.Text,{fontWeight:"400",fontSize:"16px",mt:3,children:[null==e?void 0:e.subTitle,(0,r.Y)(n.Text,{as:"span",color:"red.500",fontWeight:"900",children:null==e?void 0:null===(a=e.highlight)||void 0===a?void 0:a.split(",")[0]})," ",(0,r.Y)(n.Text,{as:"span",children:null==e?void 0:null===(t=e.highlight)||void 0===t?void 0:t.split(",")[1]})]})]}),(null==e?void 0:e.content)&&(0,r.Y)(n.Box,{pt:"1em",alignSelf:"stretch",px:{base:"0",md:"1.5em"},children:e.content}),(null==e?void 0:e.image)&&(0,r.Y)(n.Box,{pt:"1em",alignSelf:"center",w:I?"85%":"full",children:(0,r.Y)(m.Ay,{ratio:2,src:"/".concat(null==e?void 0:e.image,".png"),alt:""})})]})},e)}),(0,r.FD)(n.HStack,{justifyContent:k?"end":"space-between",mt:"2em",px:I&&"10",children:[!k&&(0,r.Y)(v,{setActivePage:F,onClose:t,isEn:I,initialFocusRef:null}),(0,r.Y)(b,{onClose:t,setActivePage:F,sliderContent:i,buttonName:A,oneSlider:N,onRead:()=>{o&&(S&&S(),w(),O(f.aG,{bannerId:o}),M("modal.checkButton.".concat(o)))},firstButtonName:Y,firstPages:k,finalPages:R,ctaButtonProps:C})]})]})})})]})]})},Y=e=>{let{isOpen:a,onClose:t,onOpen:l,...o}=e;return(0,r.FD)(r.FK,{children:[(0,r.Y)(n.Button,{onClick:l,cursor:"pointer",...o,children:o.triggerName}),(0,r.Y)(x,{isOpen:a,onClose:t,...o,closeOnOverlayClick:!0})]})};class A{}A.BUTTON_NOTI="button",A.PERMANENT_NOTI="permanent",A.CENTER_NOTI="center";let D=e=>{let{subscriptionData:a,subscription:t,mode:d="center",id:u,...c}=e,{profileId:m}=(0,l.useContext)(o.A),{emit:p}=(0,s.A)(),g=(0,i.A)({profileId:m,subscriptionData:a,id:u}),f=null==g?void 0:g.tracking,h=f?"".concat(g.id,":").concat(f.event):null;(0,l.useEffect)(()=>{f&&p(f.event,f.payload)},[h]);let{onClose:M,onOpen:b,isOpen:v}=(0,n.useDisclosure)({defaultIsOpen:"button"!==d});return g&&(e=>{switch(e){case A.PERMANENT_NOTI:return(0,r.Y)(x,{isOpen:!0,onClose:M,...g});case A.CENTER_NOTI:return(0,r.Y)(x,{isOpen:v,onClose:M,...g});case A.BUTTON_NOTI:return(0,r.Y)(Y,{onClose:M,onOpen:b,isOpen:v,...c,...g})}})(d)}},53573:(e,a,t)=>{"use strict";t.d(a,{A:()=>o});var r=t(2445),n=t(27006),l=t(46838);let o=e=>{let{title:a,tutorialUrl:t,tutorialName:o,size:i,...s}=e;return(0,r.FD)(n.HStack,{alignItems:"center",spacing:4,...s,children:[(0,r.Y)(n.Heading,{size:i,children:a}),t&&o&&(0,r.Y)(l.A,{url:t,trackerName:o})]})}},61868:(e,a,t)=>{"use strict";t.d(a,{G5:()=>h,IA:()=>f,SA:()=>b,mP:()=>g,rS:()=>v,vY:()=>p});var r=t(2445),n=t(27006),l=t(91106),o=t.n(l),i=t(86715),s=t(96540);let d=(0,s.createContext)(null),u=()=>{let e=(0,s.useContext)(d);if(!e)throw Error("usePersistTabs must be used within PersistTabs");return e},c=(e,a)=>{var t;let{activeIndex:r,colorScheme:l,variant:o}=u(),i=(0,n.useTheme)(),d=r===e,c=null!==(t=i.colors[l])&&void 0!==t?t:i.colors.blue,m=(0,n.useColorModeValue)(c[500],c[200]),p=(0,n.useColorModeValue)("#E6F5F3","gray.700"),g=(0,n.useColorModeValue)("#E6F5F3","gray.600"),f=(0,n.useColorModeValue)("gray.800","gray.400"),h=(0,n.useColorModeValue)("gray.700","gray.300"),M=(0,n.useColorModeValue)("gray.200","gray.600"),b=(0,n.useColorModeValue)("white","gray.800"),v=(0,n.useColorModeValue)("gray.50","gray.700"),y=(0,n.useColorModeValue)("gray.100","gray.600"),x=(0,n.useColorModeValue)("gray.200","gray.600"),Y=(0,s.useMemo)(()=>({display:"flex",alignItems:"center",justifyContent:"center",cursor:a?"not-allowed":"pointer",opacity:a?.4:1,outline:"none !important",position:"relative",transition:"all 0.2s",userSelect:"none",whiteSpace:"nowrap"}),[a]),A=(0,s.useMemo)(()=>({line:{borderBottom:"2px solid",borderColor:d?m:"transparent",color:d?m:f,px:4,py:2,mb:"-1px",_hover:a?{}:{color:d?m:h},_focus:{boxShadow:"outline"},_active:a?{}:{bg:x}},enclosed:{border:"1px solid",borderColor:d?m:M,borderBottom:d?"1p
1x solid white":"1px solid",bg:d?b:v,color:d?m:f,borderTopRadius:"md",px:4,py:2,_hover:a?{}:{bg:d?b:y},_focus:{boxShadow:"outline"},_active:a?{}:{bg:x}},"soft-rounded":{borderRadius:"full",bg:d?m:p,color:d?"white":m,px:4,py:2,_hover:a?{}:{bg:d?m:g},_focus:{boxShadow:"outline"},_active:a?{}:{bg:x}}})[o],[o,d,m,f,M,b,v,y,p,g,h,x,a]);return(0,s.useMemo)(()=>({...Y,...A}),[Y,A])},m=(e,a)=>(0,s.useMemo)(()=>({role:"tab",id:"tab-".concat(e),"data-tab-index":e,"aria-selected":a,"aria-controls":"tabpanel-".concat(e),tabIndex:a?0:-1}),[e,a]),p=(0,s.forwardRef)((e,a)=>{let{children:t,index:l,defaultIndex:o=0,onChange:i,colorScheme:u="blue",variant:c="line",orientation:m="horizontal",...p}=e,[g,f]=(0,s.useState)(o),h=void 0!==l;return(0,r.Y)(d.Provider,{value:{activeIndex:h?l:g,onChange:e=>{h||f(e),null==i||i(e)},colorScheme:u,variant:c,orientation:m},children:(0,r.Y)(n.Box,{ref:a,...p,children:t})})}),g=(0,s.forwardRef)((e,a)=>{let{children:t,...l}=e,{orientation:o,variant:i}=u(),s=(0,n.useColorModeValue)("gray.200","gray.600");return(0,r.Y)(n.Box,{ref:a,role:"tablist","aria-orientation":o,...l,sx:{display:"flex",flexDirection:"vertical"===o?"column":"row",..."line"===i?{borderBottom:"1px solid",borderColor:s}:{},...l.sx||{}},children:t})}),f=(0,s.forwardRef)((e,a)=>{let{children:t,isDisabled:l=!1,onClick:o,onKeyDown:i,index:d,...p}=e,{activeIndex:g,onChange:f}=u(),h=g===d,M=c(d,l),b=m(d,h),v=(0,s.useCallback)(e=>{l||(f(d),null==o||o(e))},[l,f,d,o]),y=(0,s.useCallback)(e=>{if("Enter"===e.key||" "===e.key)e.preventDefault(),l||f(d);else if("ArrowRight"===e.key||"ArrowDown"===e.key){e.preventDefault();let a=document.querySelector('[data-tab-index="'.concat(d+1,'"]'));a&&(a.focus(),f(d+1))}else if("ArrowLeft"===e.key||"ArrowUp"===e.key){e.preventDefault();let a=document.querySelector('[data-tab-index="'.concat(d-1,'"]'));a&&(a.focus(),f(d-1))}null==i||i(e)},[d,l,f,i]);return(0,r.Y)(n.Box,{ref:a,...b,onMouseDown:v,onKeyDown:y,...p,sx:{...M,...p.sx||{}},children:t})}),h=(0,s.forwardRef)((e,a)=>{let{children:t,isDisabled:l=!1,onClick:d,onKeyDown:p,index:g,href:f,shallow:h=!1,scroll:M=!1,prefetch:b=!0,...v}=e,y=(0,i.useRouter)(),{activeIndex:x,onChange:Y}=u(),A=x===g,D=c(g,l),w=m(g,A),S=(0,s.useCallback)(e=>{l||(Y(g),null==d||d(e))},[l,Y,g,d]),C=(0,s.useCallback)(e=>{let a=document.querySelector('[data-tab-index="'.concat(e,'"]'));if(a){let e=a.closest("a");if(null==e?void 0:e.href)return e.href;let t=a.getAttribute("data-href");if(t)return t}return null},[]),I=(0,s.useCallback)(e=>{if("Enter"===e.key||" "===e.key)e.preventDefault(),l||y.push(f,void 0,{shallow:h,scroll:M});else if("ArrowRight"===e.key||"ArrowDown"===e.key){e.preventDefault();let a=g+1,t=document.querySelector('[data-tab-index="'.concat(a,'"]'));if(t){t.focus();let e=C(a);if(e){let a=new URL(e,window.location.origin);y.push(a.pathname,void 0,{shallow:h,scroll:M})}Y(a)}}else if("ArrowLeft"===e.key||"ArrowUp"===e.key){e.preventDefault();let a=g-1,t=document.querySelector('[data-tab-index="'.concat(a,'"]'));if(t){t.focus();let e=C(a);if(e){let a=new URL(e,window.location.origin);y.push(a.pathname,void 0,{shallow:h,scroll:M})}Y(a)}}null==p||p(e)},[g,l,Y,p,y,f,h,M,C]),T=(0,s.useMemo)(()=>({...D,textDecoration:"none"}),[D]),F=(0,r.Y)(n.Box,{as:"a",ref:a,...w,"data-href":f,onClick:S,onKeyDown:I,...v,sx:{...T,...v.sx||{}},children:t});return l?F:(0,r.Y)(o(),{href:f,shallow:h,scroll:M,prefetch:b,passHref:!0,legacyBehavior:!0,children:F})}),M=(0,s.forwardRef)((e,a)=>{let{children:t,...l}=e;return(0,r.Y)(n.Box,{ref:a,...l,children:t})}),b=(0,s.forwardRef)((e,a)=>{let{children:t,index:l,...o}=e,{activeIndex:i}=u();return(0,r.Y)(n.Box,{ref:a,role:"tabpanel",id:"tabpanel-".concat(l),"aria-labelledby":"tab-".concat(l),hidden:i!==l,...o,children:t})}),v=(0,s.forwardRef)((e,a)=>{let{children:t,...l}=e,{activeIndex:o}=u();return(0,r.Y)(n.Box,{ref:a,role:"tabpanel",id:"tabpanel-".concat(o),"aria-labelledby":"tab-".concat(o),...l,children:t})});p.displayName="PersistTabs",g.displayName="PersistTabList",f.displayName="PersistTab",h.displayName="PersistTabLink",M.displayName="PersistTabPanels",b.displayName="PersistTabPanel",v.displayName="PersistTabContent"},87100:(e,a,t)=>{"use strict";t.d(a,{A:()=>i});var r=t(2445),n=t(27006),l=t(96540),o=t(58266);let i=e=>{let{control:a,isLargeAmount:t,emailHelper:i,anonymousValue:s}=e,[d,u]=(0,l.useState)(s);return(0,r.FD)(n.FormControl,{as:n.Stack,spacing:"2",isRequired:!0,px:"2",pb:"2",children:[(0,r.Y)(n.FormLabel,{fontSize:"1em",mb:"0",children:"您願意具名捐款嗎?"}),(0,r.Y)(o.A,{control:a,name:"anonymous",children:[{value:"no",label:"具名"},{value:"yes",label:"匿名"}].slice(0,t?1:2),...!a&&{onChange:e=>{u(e)},defaultValue:"yes"}}),(0,r.Y)(n.FormHelperText,{children:(a?s:d)==="yes"?i:"具名捐款可索取紙本收據並依法扣抵個人綜合所得稅。"})]})}},56157:(e,a,t)=>{"use strict";t.d(a,{A:()=>o});var r=t(2445),n=t(27006);t(96540);
1var l=t(58266);let o=e=>{let{anonymousValue:a,invoiceValue:t,control:o,noInvoiceHelper:i}=e;return"no"===a&&(0,r.FD)(n.FormControl,{as:n.Stack,spacing:"2",isRequired:!0,px:"2",children:[(0,r.Y)(n.FormLabel,{fontSize:"1em",mb:"0",children:"是否需要收到紙本收據?"}),(0,r.Y)(l.A,{control:o,name:"invoice",children:[{value:"b2c",label:"要寄送"},{value:"donate",label:"不寄送"}]}),(0,r.Y)(n.FormHelperText,{children:"donate"===t?i:"我們會另行將紙本收據寄送到您指定的地址。"})]})}},92746:(e,a,t)=>{"use strict";t.d(a,{A:()=>s});var r=t(2445),n=t(27006),l=t(6442),o=t(42088),i=t(58328);let s=e=>{var a;let{register:t,watch:s,emailHelper:d,isReadOnly:u,errors:c}=e,m=(0,l.A)();return(0,r.FD)(n.FormControl,{as:n.Stack,spacing:"2",isRequired:!0,isInvalid:!!(null==c?void 0:c.email),children:[(0,r.Y)(n.FormLabel,{fontSize:"1em",mb:"0",children:"E-mail"}),d&&!u&&(0,r.Y)(i.A,{children:(0,r.Y)(o.A,{children:d})}),(0,r.Y)(n.Box,{pt:"1",children:u?(0,r.Y)(n.Text,{children:s("email")}):(0,r.Y)(n.Input,{colorScheme:"primary",placeholder:m.formatMessage({defaultMessage:"請輸入你的 E-mail",id:"admin.support.請輸入你的 E-mail"}),...t&&t("email",{required:!0,maxLength:{value:40,message:m.formatMessage({id:"admin.product.最多40個字",defaultMessage:"最多40個字"})}}),isReadOnly:u,type:"email"})}),(0,r.Y)(n.FormErrorMessage,{children:null==c?void 0:null===(a=c.email)||void 0===a?void 0:a.message})]})}},14031:(e,a,t)=>{"use strict";t.d(a,{A:()=>p});var r=t(2445),n=t(17437),l=t(27006),o=t(96540),i=t(49785),s=t(6442),d=t(95005),u=t(57688),c=t(59576);let m=e=>{let{type:a,label:t}=e;return"divider"===a?(0,r.Y)(l.Divider,{}):"title"===a?(0,r.Y)(l.Box,{w:"full",children:(0,r.Y)(l.Heading,{as:"h3",size:"md",textAlign:"left",children:t})}):null},p=e=>{let{control:a,enabledRewards:t,isVirtual:l,hasInvoice:p,isPreview:g,enablePayPal:f,isReadOnly:h}=e,M=(0,s.A)(),b=(0,u.A)();return(0,o.useMemo)(()=>{let e="en"===M.locale,a={value:b,label:M.formatMessage({defaultMessage:"信用卡",id:"admin.support.信用卡"})},r={value:"paypal",label:"Paypal".concat("en"===M.locale?"":" (海外)")},n={name:"paymentMethod",label:M.formatMessage({defaultMessage:"付款方式",id:"admin.support.付款方式"}),options:e?[r]:[a].concat(f?[r]:[]),type:"radio",rules:{required:!0}};return t?[...(0,c.A)(l)?[]:[{type:"divider",isDiv:!0},{type:"title",label:M.formatMessage({defaultMessage:"寄件資訊",id:"admin.support.寄件資訊"}),isDiv:!0},{name:"recipient",label:M.formatMessage({defaultMessage:"收件人姓名",id:"admin.support.收件人姓名"}),rules:{required:!0}},{name:"phone",label:M.formatMessage({defaultMessage:"手機",id:"admin.support.手機"}),helper:M.formatMessage({defaultMessage:"物流聯繫使用",id:"admin.support.物流聯繫使用"}),rules:{required:!0}},{name:"address",label:M.formatMessage({defaultMessage:"寄送地址",id:"admin.support.寄送地址"}),placeholder:M.formatMessage({defaultMessage:"請輸入寄送地址",id:"admin.support.請輸入寄送地址"}),rules:{required:!0},type:"address-mobile"}],...p?[{name:"idNumber",label:M.formatMessage({defaultMessage:"發票是否需要統一編號 (選填)",id:"admin.support.發票是否需要統一編號 (選填)"}),placeholder:M.formatMessage({defaultMessage:"請輸入公司統編",id:"admin.support.請輸入公司統編"})}]:[],n]:[n]},[t,p,l,f,b,M]).map((e,t)=>e.isDiv?(0,n.createElement)(m,{...e,key:t}):(0,r.Y)(i.xI,{name:e.name,control:a,rules:e.rules,render:t=>{let{field:n,fieldState:l}=t;return(0,r.Y)(d.A,{...e,...n,fieldState:l,control:a,isDisabled:g,isReadOnly:h})}},e.name))}},7828:(e,a,t)=>{"use strict";t.d(a,{A:()=>Y});var r=t(2445),n=t(27006),l=t(55378),o=t.n(l),i=t(40860),s=t.n(i),d=t(96540),u=t(49785),c=t(77037),m=t(6442),p=t(58328),g=t(78459),f=t(42088),h=t(95967),M=t(59576),b=t(11454),v=t(59852);let y=e=>{let{data:a}=e,t=(0,m.A)();return a?(0,r.FD)(n.Stack,{mt:"2",children:[(0,r.FD)(p.A,{color:"custom.primary",children:[a.description,a.limited?"".concat(t.formatMessage({defaultMessage:"(限量",id:"admin.support.(限量"})).concat(a.limited).concat(t.formatMessage({defaultMessage:"組",id:"admin.support.組"}),")"):""]}),(0,r.Y)(g.Ay,{ratio:2,src:a.image,alt:a.label})]}):null},x=(e,a)=>"".concat(e,"|").concat(a),Y=e=>{let{prices:a,enableCustomPrice:t,customPriceLabel:l,customPriceMessage:i,customPriceMin:g,quickValue:Y,setValue:A,control:D,isPreview:w,max:S=v.oc,name:C,isReward:I,isReadOnly:T}=e,F=(0,m.A)(),k=(0,d.useMemo)(()=>
1(0,h.a)(a).filter(Boolean),[a]),[R,N]=(0,d.useState)(()=>{var e;return w?null===(e=k[0])||void 0===e?void 0:e.price:void 0}),O=null!=Y?Y:R,P=(0,d.useMemo)(()=>s()(k,(e,a)=>(e[x(a.price,a.label)]=I?a:a.label,e),{custom:i||""}),[k,i,I]),{getRootProps:E,getRadioProps:_}=(0,n.useRadioGroup)({name:"quick",onChange:e=>{if(A){if(A("quick",e),I){var a;A("reward",{name:null===(a=P[e])||void 0===a?void 0:a.label})}}else N(e)},value:O}),B=E(),H=+(g||v.U9);return(0,r.FD)(n.FormControl,{p:"2",isRequired:!0,children:[(0,r.Y)(n.HStack,{children:(0,r.Y)(n.FormLabel,{fontSize:"1em",mb:"3",children:I?F.formatMessage({defaultMessage:"選擇方案",id:"admin.support.選擇方案"}):F.formatMessage({defaultMessage:"金額",id:"admin.support.金額"})})}),(0,r.FD)(n.Wrap,{...B,spacing:"2",children:[o()(k,(e,a)=>{if(S&&+e.price>+S)return null;let t=_({value:x(e.price,e.label)}),l=e.price?"$".concat(Number(e.price).toLocaleString()):" - ";return(0,r.Y)(n.WrapItem,{children:(0,r.Y)(b.A,{...t,isDisabled:(0,M.A)(e.soldOut),isReadOnly:T,children:I?"".concat(e.label," (").concat(l,")"):l})},a)}),t&&!I&&(0,r.Y)(n.WrapItem,{children:(0,r.Y)(b.A,{..._({value:"custom"}),isReadOnly:T,children:void 0===l?F.formatMessage({defaultMessage:"自訂支持的金額",id:"admin.support.自訂支持的金額"}):""===l?F.formatMessage({defaultMessage:"自訂",id:"admin.support.自訂"}):l})})]}),(0,r.Y)(n.Box,{w:"full",children:(0,r.Y)(n.Collapse,{in:"custom"===O,animateOpacity:!0,unmountOnExit:!0,children:D&&(0,r.Y)(u.xI,{control:D,name:C,rules:{required:{value:!0,message:F.formatMessage({defaultMessage:"請填入金額",id:"admin.support.請填入金額"})},min:{value:H,message:"".concat(F.formatMessage({defaultMessage:"金額不能小於",id:"admin.support.金額不能小於"})," ").concat(H)},max:{value:S,message:"".concat(F.formatMessage({defaultMessage:"金額不能大於",id:"admin.support.金額不能大於"})," ").concat(Number(S).toLocaleString())}},render:e=>{var a;let{field:t,fieldState:l}=e;return(0,r.FD)(n.FormControl,{isInvalid:l.error,isRequired:!0,children:[(0,r.FD)(n.InputGroup,{mt:"3",children:[(0,r.Y)(n.InputLeftElement,{pointerEvents:"none",children:(0,r.Y)(n.Icon,{as:c.Tsk,size:"1.25em"})}),(0,r.Y)(n.Input,{type:"number",min:H,max:S,placeholder:F.formatMessage({defaultMessage:"自訂金額",id:"admin.support.自訂金額"}),...t,autoComplete:"off",isReadOnly:T})]}),(0,r.Y)(n.FormErrorMessage,{children:null===(a=l.error)||void 0===a?void 0:a.message})]})}})})}),(0,r.Y)(n.Collapse,{in:!!O,animateOpacity:!0,children:I?(0,r.Y)(y,{data:null==P?void 0:P[O]}):(0,r.Y)(p.A,{mt:"2",color:"custom.primary",children:(0,r.Y)(f.A,{children:null==P?void 0:P[O]})})})]})}},64170:(e,a,t)=>{"use strict";t.d(a,{A:()=>g});var r=t(2445),n=t(27006),l=t(49785),o=t(6442),i=t(78459),s=t(59576),d=t(33898),u=t(59324);let c=async e=>{let a=await fetch(e);if(!a.ok)throw Error("Failed to fetch supporter count");return a.json()},m=e=>{var a,t;let{profileId:r,enabled:n=!0}=e,{data:l,error:o,isLoading:i}=(0,u.Ay)(n&&r?"/api/support/".concat(r,"/supporterCount"):null,c,{revalidateOnFocus:!1,revalidateOnReconnect:!1,dedupingInterval:6e4});return{recurringCount:null!==(a=null==l?void 0:l.recurringCount)&&void 0!==a?a:0,singleCount:null!==(t=null==l?void 0:l.singleCount)&&void 0!==t?t:0,isLoading:i,error:o}},p=e=>{var a;let{profileId:t,showRecurringSupporterCount:l=!1,showSingleSupporterCount:i=!1,isRecurringTab:s,isPreview:d=!1,supporterCount:u}=e,c=(0,o.A)(),p=(0,n.useTheme)(),g=(null==p?void 0:null===(a=p.blocks)||void 0===a?void 0:a.color)||"blocks.text",f=s&&l||!s&&i,h=null!=u,{recurringCount:M,singleCount:b,isLoading:v}=m({profileId:t||"",enabled:f&&!!t&&!h});if(!f)return null;let y=h?u.recurringCount:M,x=h?u.singleCount:b,Y=s?y:x;if(!h&&v||0===Y&&!d)return null;let A=s?c.formatMessage({defaultMessage:"已有 {count} 人每月定額贊助中,期待你的加入",id:"admin.support.已有 {count} 人每月定額贊助中,期待你的加入"},{count:(0,r.Y)(n.Text,{as:"span",fontWeight:"bold",children:Y})}):c.formatMessage({defaultMessage:"已有 {count} 人贊助過,期待你的加入",id:"admin.support.已有 {count} 人贊助過,期待你的加入"},{count:(0,r.Y)(n.Text,{as:"span",fontWeight:"bold",children:Y})});return(0,r.FD)(n.Text,{fontSize:"sm",color:g,textAlign:"center",py:2,children:["☕ ",A]})},g=(0,n.forwardRef)((e,a)=>{let{showImage:t=!0,image:u,description:c,isPreview:m=!1,isEditing:g,alt:f,enableRecurringDonation:h,enableSingleDonation:M=!0,showRecurringSupporterCount:b,showSingleSupporterCount:v,profileId:y,supporterCount:x}=e,Y=(0,o.A)(),{setValue:A,watch:D}=(0,l.xW)(),w=D("chooseRecurringDonationTab"),S=(0,s.A)(h),C=(0,s.A)(M,!0),I=S&&C,T=!!S&&(!I||(0,s.A)(w));return(0,r.FD)(n.Stack,{py:2,ref:a,children:[(0,r.Y)(i.Ay,{width:"100%",ratio:2,src:u,isPreview:m,isEditing:g,rounded:"lg",overflow:"hidden",isDisabled:!t,alt:f}),I&&(0,r.Y)(n.Tabs,{isFitted:!0,variant:"enclosed",index:T?0:1,onChange:e=>{A("chooseRecurringDonationTab",0===e)},colorScheme:"primary",children:(0,r.FD)(n.TabList,{children:[(0,r.Y)(n.Tab,{children:(0,r.Y)(n.Text,{children:Y.formatMessage({defaultMessage:"每月定額贊助",id:"admin.support.每月定額贊助"})})}),(0,r.Y)(n.Tab,{children:(0,r.Y)(n.Text,{children:Y.formatMessage({defaultMessage:"å–
1®ç­†è´ŠåŠ©",id:"admin.support.單筆贊助"})})})]})}),(0,r.Y)(p,{profileId:y,showRecurringSupporterCount:b,showSingleSupporterCount:v,isRecurringTab:T,isPreview:m,supporterCount:x}),c&&(0,r.Y)(d.A,{px:"2",children:c})]})})},31612:(e,a,t)=>{"use strict";t.d(a,{A:()=>M});var r=t(2445),n=t(27006),l=t(55378),o=t.n(l),i=t(50014),s=t.n(i),d=t(96540),u=t(49785),c=t(26923),m=t(78459),p=t(95967);let g=e=>{let{onChange:a,value:t,options:l,isPreview:o,isEditing:i}=e,s=(0,d.useMemo)(()=>l.find(e=>e.itemId===t),[l,t]);return(0,d.useEffect)(()=>{if(s&&s.isDisabled){var e,t;a(null!==(t=null===(e=l.find(e=>!e.isDisabled))||void 0===e?void 0:e.itemId)&&void 0!==t?t:"")}},[l,s]),(0,r.FD)(n.Stack,{children:[(0,r.FD)(n.FormControl,{children:[(0,r.Y)(n.FormLabel,{fontSize:"1em",mb:"3",children:"選擇回饋品"}),(0,r.Y)(n.RadioGroup,{onChange:a,value:t,colorScheme:"primary",children:(0,r.FD)(n.Wrap,{spacing:3,children:[(0,r.Y)(n.WrapItem,{children:(0,r.Y)(n.Radio,{value:"",children:"不需要"})}),l.map(e=>(0,r.FD)(n.HStack,{as:n.WrapItem,children:[(0,r.Y)(n.Radio,{value:e.itemId,isDisabled:e.isDisabled,children:e.name}),(0,r.Y)(n.Tooltip,{label:"贊助金額滿 $".concat(e.minAmount," 即可兌換").concat(e.limited?",限量 ".concat(e.limited," 組"):"","。"),children:(0,r.Y)("span",{children:(0,r.Y)(n.Icon,{w:"3.5",h:"3.5",as:c.kAG,color:"inherit"})})})]},e.itemId))]})})]}),(0,r.Y)(n.Collapse,{in:!!s,children:(0,r.FD)(n.Stack,{py:"2",children:[(0,r.Y)(m.Ay,{borderRadius:"md",ratio:2,src:null==s?void 0:s.image,alt:(null==s?void 0:s.alt)||(null==s?void 0:s.description),isPreview:o,isEditing:i}),(null==s?void 0:s.description)&&(0,r.Y)(n.Text,{children:s.description})]})})]})},f=e=>{let{control:a,rewards:t,setValue:n,isPreview:l,isEditing:i}=e,c=(0,u.FH)({control:a,name:"amount"}),m=(0,d.useMemo)(()=>o()(t,e=>({...e,isDisabled:!c||+c<+e.minAmount})),[t,c]),{field:p}=(0,u.as)({control:a,name:"reward"});return(0,d.useEffect)(()=>{let e=s()(m,e=>e.minAmount).reverse().find(e=>!e.isDisabled);e&&n("reward",e.itemId)},[c]),(0,r.Y)(g,{options:m,isPreview:l,isEditing:i,...p})},h=e=>{let{options:a,isPreview:t,isEditing:n}=e,[l,o]=(0,d.useState)();return(0,r.Y)(g,{options:a,value:l,onChange:o,isPreview:t,isEditing:n,Pfor:!0})},M=e=>{let{control:a,setValue:t,enabledRewards:l,rewards:o,isPreview:i,isEditing:s}=e,u=(0,d.useMemo)(()=>(0,p.a)(o).filter(Boolean),[o]);return l||s||i?(0,r.Y)(n.Box,{color:i&&"blocks.text",bg:i&&"blocks.bg",p:2,borderRadius:"md",children:a?(0,r.Y)(f,{control:a,rewards:u,setValue:t,isPreview:i,isEditing:s}):(0,r.Y)(h,{options:u,isPreview:i,isEditing:s})}):null}},43375:(e,a,t)=>{"use strict";t.d(a,{A:()=>u});var r=t(2445),n=t(27006);t(96540);
1var l=t(78459),o=t(42088),i=t(46265),s=t(33898);let d={"flex-start":"left","flex-end":"right",center:"center"},u=e=>{let{thanksAlign:a="center",thanks:t,thanksTitle:u,thanksImage:c,thanksImageType:m,isEditing:p,isPreview:g}=e,f="none"===m;return(0,r.FD)(n.VStack,{spacing:6,alignItems:a,w:"full",children:[(0,r.Y)(n.Heading,{as:"h2",fontSize:(0,i.no)("1.125em","1.375em"),fontWeight:"500",color:"custom.primary",lineHeight:"1.75",textAlign:d[a],children:(0,r.Y)(o.A,{children:u})}),(g||p||!f)&&(0,r.Y)(n.Box,{rounded:"md",overflow:"hidden",boxShadow:"md",width:"100%",children:(0,r.Y)(l.Ay,{ratio:"free",isPreview:g,isEditing:p,src:c,isDisabled:f})}),(0,r.Y)(n.Box,{w:"full",children:t?(0,r.Y)(s.A,{children:t}):(p||g)&&"感謝文字預覽"})]})}},50288:(e,a,t)=>{"use strict";t.d(a,{O:()=>c,w:()=>o});var r=t(2404),n=t.n(r),l=t(59852);let o=e=>{let a="en"===e.locale;return{description:"<p>".concat(e.formatMessage({defaultMessage:"這是我的方案,歡迎大家支持",id:"admin.support.這是我的方案歡迎大家支持"}),"</p>"),emailHelper:e.formatMessage({defaultMessage:"我們將寄送給你付款確認信件",id:"admin.support.我們將寄送給你付款確認信件"}),prices:[a?10:100,a?20:200].map((a,t)=>({price:String(a),label:[e.formatMessage({defaultMessage:"收到你的心意",id:"admin.support.收到你的心意"}),e.formatMessage({defaultMessage:"感謝你的支持",id:"admin.support.感謝你的支持"})][t]})),thanks:"<p>".concat(e.formatMessage({defaultMessage:"你的支持,提供æ
1ˆ‘創作的動力",id:"admin.support.你的支持提供我創作的動力"}),"</p>"),thanksTitle:e.formatMessage({defaultMessage:"感謝你的支持!",id:"admin.support.感謝你的支持標題"}),customPriceLabel:e.formatMessage({defaultMessage:"自訂支持的金額",id:"admin.support.自訂支持的金額"}),customPriceMin:a?l.K1:l.U9,enableSingleDonation:!0,...a?{}:{enableRecurringDonation:!1,recurringDonationDescription:"<p>".concat(e.formatMessage({defaultMessage:"每月一點小支持,是我前進的動力!",id:"admin.support.每月一點小支持,是我前進的動力!"}),"</p>"),recurringDonationEmailHelper:e.formatMessage({defaultMessage:"我們將寄送給你每月定額贊助確認信件",id:"admin.support.我們將寄送給你每月定額贊助確認信件"}),recurringDonationPrices:[100,200].map((a,t)=>({price:String(a),label:[e.formatMessage({defaultMessage:"收到你的心意",id:"admin.support.收到你的心意"}),e.formatMessage({defaultMessage:"感謝你的支持!",id:"admin.support.感謝你的支持!"})][t]})),recurringDonationCustomPriceLabel:e.formatMessage({defaultMessage:"自訂支持的金額",id:"admin.support.自訂支持的金額"}),recurringDonationCustomPriceMin:l.U9}}},i=["description","thanks","thanksTitle","recurringDonationDescription"],s=["prices","recurringDonationPrices"],d=e=>Array.isArray(e)?e:e&&"object"==typeof e?Object.values(e):[],u=e=>d(e).map(e=>{let a=null==e?void 0:e.price,t=null==e?void 0:e.label;return{price:null==a?"":String(a),label:null==t?"":String(t)}}),c=(e,a)=>{let t=d(null==e?void 0:e.projects);if(0===t.length)return!1;if(1!==t.length)return!0;let r=o(a),l=t[0]||{};return!!i.some(e=>void 0!==r[e]&&l[e]!==r[e])||s.some(e=>void 0!==r[e]&&!n()(u(l[e]),u(r[e])))}},57688:(e,a,t)=>{"use strict";t.d(a,{A:()=>n});var r=t(6442);let n=(e,a,t)=>{let{locale:n}=(0,r.A)();return"en"===n||"en"===e?"paypal":t?"tappay":a?"91app":"tappay"}},68924:(e,a,t)=>{"use strict";t.d(a,{A:()=>l});var r=t(96540),n=t(59576);function l(e){let{watch:a,setValue:t,enableRecurringDonation:l,enableSingleDonation:o=!0,enablePayPal:i,data:s}=e,d=a("chooseRecurringDonationTab"),u=(0,n.A)(d),c=(0,n.A)(l),m=(0,n.A)(o,!0),p=c&&m,g=(0,r.useRef)(c),f=(0,r.useRef)(m);(0,r.useEffect)(()=>{let e=g.current,a=f.current;if(c&&!e&&m){t("chooseRecurringDonationTab",!0),g.current=c,f.current=m;return}if(m&&!a&&c){t("chooseRecurringDonationTab",!1),g.current=c,f.current=m;return}if(c&&!m){t("chooseRecurringDonationTab",!0),g.current=c,f.current=m;return}c||t("chooseRecurringDonationTab",!1),g.current=c,f.current=m},[c,m,t]);let h=!!c&&(!p||u),M=(0,r.useMemo)(()=>({isShowRecurringDonation:h,displayDescription:h?s.recurringDonationDescription:s.description,displayPrices:h?s.recurringDonationPrices:s.prices,displayEnableCustomPrice:h?s.enableRecurringDonationCustomPrice:s.enableCustomPrice,displayCustomPriceLabel:h?s.recurringDonationCustomPriceLabel:s.customPriceLabel,displayCustomPriceMessage:h?s.recurringDonationCustomPriceMessage:s.customPriceMessage,displayCustomPriceMin:h?s.recurringDonationCustomPriceMin:s.customPriceMin,displayEmailHelper:h?s.recurringDonationEmailHelper:s.emailHelper,displayEnablePayPal:!!i&&m&&!h}),[h,s,i,m]);return{chooseRecurringDonationTab:d,isSingleDonationEnabled:m,isRecurringDonationEnabled:c,shouldShowRecurringDonationTabs:p,...M}}},41034:(e,a,t)=>{"use strict";t.d(a,{A:()=>o});var r=t(9749),n=t(96540),l=t(67836);let o=()=>{let e=(0,l.A)();return(0,n.useMemo)(()=>e||(0,r.getFunctions)(),[e])}},47419:(e,a,t)=>{"use strict";t.d(a,{A:()=>o});var r=t(39182),n=t(93503),l=t(20068);function o(e,a){(0,n.A)(2,arguments);var t=(0,l.A)(a);return(0,r.A)(e,-t)}},82090:(e,a,t)=>{"use strict";t.r(a),t.d(a,{default:()=>e$});var r=t(2445),n=t(27006),l=t(86715),o=t(96540),i=t(6442),s=t(92227),d=t(19082),u=t(68301),c=t(5712),m=t(53573),p=t(46209),g=t(22405),f=t(41195),h=t(77666),M=t(72129),b=t(50288);let v=e=>(e||[]).map(e=>({id:(0,f.Ak)(),...e})),y=e=>{let{data:a,profileId:t}=e,r=(0,o.useRef)(),n=(0,h.A)(),l=(0,M.A)(t),s=(0,i.A)(),d=async()=>{let e=(0,b.w)(s),a={"support.isActive":!0,"support.projects.0":{...e,prices:v(e.prices),...e.recurringDonationPrices?{recurringDonationPrices:v(e.recurringDonationPrices)}:{}}};await (0,g.updateDoc)((0,g.doc)(n,"profiles",t),a),await l()};return(0,o.useEffect)(()=>{(null==a?void 0:a.isActive)||r.current||(r.current=!0,d(!0))},[a]),null};var x=t(55378),Y=t.n(x),A=t(73916),D=t.n(A),w=t(70934),S=t(49785),C=t(72209),I=t(77037),T=t(11583),F=t(78885),k=t(70382),R=t(81670),N=t(50999),O=t(90390),P=t(87100),E=t(58266);let _=" (選填) ",B=e=>{let{label:a,helper:t}=e;return(0,r.FD)(n.FormControl,{px:"2",pb:"2",children:[(0,r.Y)(n.FormLabel,{fontSize:"1em",mb:"2",children:a}),(0,r.Y)(n.Input,{bg:"white",isReadOnly:!0,placeholder:" "}),t&&(0,r.Y)(n.FormHelperText,{children:t})]})},H={credit:"信用卡",cvs:"超商代碼",barcode:"超商條碼",linepay:"LINE Pay",atm:"ATM 虛擬帳號",newebpay:"信用卡",tappay:"信用卡",oen:"信用卡","91app":"信用卡","91app-atm":"ATM 虛擬帳號"},L=e=>{let{anonymousValue:a="no",paymentMethods:t,candidateNameHelper:l}=e,o="no"===a,i=(null==t?void 0:t.length)?t:["credit"];return(0,r.FD)(n.Stack,{spacing:2,children:[(0,r.Y)(B,{label:"姓名 / 公司名稱".concat(o?"":_),helper:l||"為符合監察院申報格式,請留中文真實姓名。"}),o&&(0,r.Y)(B,{label:"身分證字號 / 統一編號"}),(0,r.Y)(B,{label:"E-mail".concat(_)}),(0,r.Y)(B,{label:"手機".concat(o?"":_)}),o&&(0,r.Y)(B,{label:"地址"}),(0,r.FD)(n.FormControl,{as:n.Stack,spacing:"2",isRequired:!0,px:"2",pb:"2",children:[(0,r.Y)(n.FormLabel,{fontSize:"1em",mb:"0",children:"付款方式"}),(0,r.Y)(E.A,{children:i.map(e=>{var a;return{value:e,label:null!==(a=H[e])&&void 0!==a?a:e}}),defaultValue:i[0]})]})]})};
1var z=t(56157),V=t(92746),U=t(14031),W=t(7828),q=t(64170),G=t(68924),K=t(59576),j=t(46714),$=t(59852);let X=e=>{let{hasChatId:a}=e,t=(0,i.A)(),o=(0,l.useRouter)(),{control:s}=(0,S.xW)(),d=(0,S.FH)({name:"telegramEnabled",control:s}),u=a&&(0,K.A)(d);return(0,r.FD)(n.HStack,{spacing:1,flexWrap:"wrap",children:[(0,r.Y)("span",{children:t.formatMessage({defaultMessage:"啟用 Telegram 群組邀請",id:"admin.support.telegram.啟用 Telegram 群組邀請"})}),(0,r.FD)(n.HStack,{as:"span",spacing:"2",children:[(0,r.Y)(k.A,{width:"400px",placement:"bottom",children:(0,r.FD)(r.FK,{children:[t.formatMessage({defaultMessage:"紅點代表已設定完成,但尚未啟用。",id:"admin.support.telegram.tooltip.紅點說明"}),(0,r.Y)("br",{}),t.formatMessage({defaultMessage:"綠點代表已設定完成,且已啟用。",id:"admin.support.telegram.tooltip.綠點說明"})]})}),a&&(0,r.Y)(n.Box,{w:"8px",h:"8px",borderRadius:"full",bg:u?"green.500":"red.500",flexShrink:0}),(0,r.Y)(n.Link,{href:"/admin/support?".concat(o.query.id?"id=".concat(o.query.id,"&"):"","tab=2"),fontSize:"xs",color:"GUI.green.500",fontWeight:"bold",border:"1px solid",borderColor:"GUI.green.500",borderRadius:"md",px:"2",py:"0.5",_hover:{bg:"GUI.green.50",textDecoration:"none"},onClick:e=>e.stopPropagation(),children:t.formatMessage({defaultMessage:"前往設定",id:"admin.support.telegram.前往設定"})})]})]})};function J(e){return(0,r.Y)("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:(0,r.Y)("path",{fill:"currentColor",d:"M6.5 2.27L20 10.14L6.5 18l-1-1.73l10.53-6.13L5.5 4l1-1.73M20 20v2H5v-2h15Z"})})}let Q={default:V.A,candidate:e=>{let{control:a,watch:t}=(0,S.mN)({defaultValues:{anonymous:"no",invoice:"donate"}}),n=t("anonymous"),l=t("invoice");return(0,r.FD)(r.FK,{children:[(0,r.Y)(P.A,{...e,anonymousValue:n,control:a}),(0,r.Y)(z.A,{...e,invoiceValue:l,anonymousValue:n,control:a}),(0,r.Y)(L,{anonymousValue:n,invoiceValue:l,paymentMethods:e.paymentMethods,candidateNameHelper:e.candidateNameHelper})]})}},Z={candidate:{anonymousValue:"yes"}},ee=e=>{let{customPayment:a,template:t,maxAmount:l,isVirtual:s,hasInvoice:d,enabledRewards:u,enablePayPal:c,...m}=e,p=(0,i.A)(),g=(0,K.A)(m.enableSingleDonation,!0),f=(0,K.A)(m.enableRecurringDonation),h=!g&&!f,M=(0,S.mN)({defaultValues:{chooseRecurringDonationTab:!!m.enableRecurringDonation}}),{watch:b,control:v,setValue:y}=M,{displayDescription:x,displayPrices:Y,displayEnableCustomPrice:A,displayCustomPriceLabel:D,displayCustomPriceMessage:w,displayCustomPriceMin:C,displayEmailHelper:I,displayEnablePayPal:T}=(0,G.A)({watch:b,setValue:y,enableRecurringDonation:m.enableRecurringDonation,enableSingleDonation:m.enableSingleDonation,enablePayPal:c,data:m});return(0,r.Y)(S.Op,{...M,children:(0,r.Y)(n.Stack,{color:m.isPreview&&"blocks.text",bg:m.isPreview&&"blocks.bg",borderRadius:"md",p:m.isPreview&&2,mb:"8",children:h?(0,r.Y)(n.Stack,{py:"8",px:"2",alignItems:"center",children:(0,r.Y)(n.Text,{fontWeight:"bold",children:p.formatMessage({defaultMessage:"贊助頁面已隱藏",id:"admin.support.贊助頁面已隱藏"})})}):(0,r.FD)(r.FK,{children:[(0,r.Y)(q.A,{...m,description:x}),(0,r.Y)(W.A,{...m,prices:Y,enableCustomPrice:A,customPriceLabel:D,customPriceMessage:w,customPriceMin:C,max:a?Number.MAX_SAFE_INTEGER:l,isReward:"candidate"!==t&&u}),m.isPreview&&(0,r.FD)(n.Stack,{py:"4",borderTop:"1px solid",px:"2",spacing:4,children:[(0,o.createElement)(Q[t],Object.assign({},m,Z[t],{emailHelper:I})),"candidate"!==t&&(0,r.Y)(U.A,{control:v,enabledRewards:u,isVirtual:s,hasInvoice:d,isPreview:m.isPreview,enablePayPal:T}),f&&g&&c&&(0,r.Y)(n.Text,{textColor:"red.500",fontSize:"sm",children:p.formatMessage({defaultMessage:"僅單筆贊助能使用 Paypal 收款",id:"admin.support.僅單筆贊助能使用 Paypal 收款"})}),m.telegramEnabled&&(0,r.Y)(n.Text,{fontSize:"sm",color:"#BE1833",children:p.formatMessage({defaultMessage:"設定完成後將自動發送邀請連結,建議在方案說明中註記此權益。",id:"admin.support.telegram.設定完成後將自動發送邀請連結"})})]})]})})})};var ea=t(64833),et=t(22828),er=t(31612),en=t(26923),el=t(84961),eo=t(58328),ei=t(43375);let es=e=>{let a=(0,i.A)();return(0,r.FD)(n.Box,{color:e.isPreview&&"blocks.text",bg:e.isPreview&&"blocks.bg",p:e.isPreview&&4,borderRadius:"md",px:"2",children:[!e.isPreview&&(0,r.Y)(eo.A,{my:"2",children:a.formatMessage({defaultMessage:"*以下圖、文會於付款完成å¾
1Œï¼Œé¡¯ç¤ºæ–¼ç•«é¢ä¸Šã€ä¸¦ä»¥ e-mail 方式寄送。",id:"admin.support.*以下圖、文會於付款完成後,顯示於畫面上、並以 e-mail 方式寄送。"})}),(0,r.Y)(ei.A,{...e})]})},ed=[e=>{let a,{data:t,customPayment:s,onUpdate:d,template:u,maxAmount:c,profileId:m}=e,p=(0,i.A)(),g="en"===p.locale,h=(0,l.useRouter)(),M=(0,o.useRef)(!1),b=(0,o.useRef)(null),[v,y]=(0,o.useState)(0);(0,o.useEffect)(()=>{if("true"===h.query.autoOpenEditor){M.current=!0,b.current=h.query.scrollToField||null,y(e=>e+1);let{autoOpenEditor:e,scrollToField:a,...t}=h.query;h.replace({pathname:h.pathname,query:t},void 0,{shallow:!0})}},[h.query.autoOpenEditor]),(0,o.useEffect)(()=>{if(M.current){let e=setTimeout(()=>{M.current=!1,b.current=null},1e3);return()=>clearTimeout(e)}},[v]);let x=g?$.K1:$.U9,Y=p.formatMessage({defaultMessage:"確認要關閉嗎?",id:"admin.support.確認要關閉嗎?"}),A=p.formatMessage({defaultMessage:"關閉後,前台的贊助功能將會隱藏",id:"admin.support.關閉後,前台的贊助功能將會隱藏"}),D={name:"price",label:p.formatMessage({defaultMessage:"金額",id:"admin.support.金額"}),type:"number",leftIcon:C.cMR,rules:{required:{value:!0,message:p.formatMessage({defaultMessage:"金額必填",id:"admin.support.金額必填"})},pattern:{value:/^[0-9]*$/,message:p.formatMessage({defaultMessage:"僅能輸入數字",id:"admin.support.僅能輸入數字"})},min:{value:x,message:"".concat(p.formatMessage({defaultMessage:"最低要設定",id:"admin.support.最低要設定"})).concat(g?" ":"").concat(x).concat(g?" ":"").concat(p.formatMessage({defaultMessage:"元喔",id:"admin.support.元喔"}))},max:s?null:{value:c,message:"".concat(p.formatMessage({defaultMessage:"單筆收款上限為",id:"admin.support.單筆收款上限為"})).concat(c).concat(p.formatMessage({defaultMessage:"元",id:"admin.support.元"}))}}},w=[...g?[]:[{type:"divider"},{type:"div",children:(0,r.Y)(N.A,{title:p.formatMessage({defaultMessage:"單筆贊助",id:"admin.support.單筆贊助"}),children:p.formatMessage({defaultMessage:"獲取粉絲一次性的贊助支持,系統會自動發送感謝信給贊助者",id:"admin.support.獲取粉絲一次性的贊助支持,系統會自動發送感謝信給贊助者"})})}],{name:"enableSingleDonation",label:p.formatMessage({defaultMessage:"啟用單筆贊助",id:"admin.support.啟用單筆贊助"}),leftIcon:T.Hh9,type:"confirm-boolean",defaultValue:!0,confirmTitle:Y,confirmBody:A,confirmOnChecked:e=>!!(0,K.A)(null==e?void 0:e.enableRecurringDonation)&&null,confirmColorScheme:"red"},{name:"showSingleSupporterCount",label:p.formatMessage({defaultMessage:"顯示贊助人數",id:"admin.support.顯示單筆贊助人數"}),leftIcon:T.waN,type:"boolean",defaultValue:!1,when:["enableSingleDonation",!0],isUnderGroup:!0},{name:"description",label:p.formatMessage({defaultMessage:"方案說明",id:"admin.support.方案說明"}),type:"richtext",noAnimation:!0,when:["enableSingleDonation",!0],isUnderGroup:!0},{name:"emailHelper",label:p.formatMessage({defaultMessage:"E-mail欄位文字",id:"admin.support.E-mail欄位文字"}),leftIcon:F.SOx,type:"textarea",when:["enableSingleDonation",!0],isUnderGroup:!0},"candidate"===u&&{name:"noInvoiceHelper",label:p.formatMessage({defaultMessage:"不寄送收據說明文字",id:"admin.support.不寄送收據說明文字"}),type:"textarea",when:["enableSingleDonation",!0],isUnderGroup:!0},"candidate"===u&&{name:"candidateNameHelper",label:p.formatMessage({defaultMessage:"姓名欄位說明文字",id:"admin.support.姓名欄位說明文字"}),helper:p.formatMessage({defaultMessage:"顯示在「姓名 / 公司名稱」欄位下方。留空使用預設文案:「為符合監察院申報格式,請留中文真實姓名。」",id:"admin.support.姓名欄位說明文字.helper"}),placeholder:"為符合監察院申報格式,請留中文真實姓名。",type:"textarea",when:["enableSingleDonation",!0],isUnderGroup:!0},{name:"prices",label:p.formatMessage({defaultMessage:"金額選項",id:"admin.support.金額選項"}),type:"group",fields:[D,{name:"label",label:p.formatMessage({defaultMessage:"金額訊息",id:"admin.support.金額訊息"})}],isFixed:!0,when:["enableSingleDonation",!0],isUnderGroup:!0}
1,{name:"enableCustomPrice",label:p.formatMessage({defaultMessage:"啟用自訂金額",id:"admin.support.啟用自訂金額"}),type:"boolean",when:["enableSingleDonation",!0],isUnderGroup:!0,followUpFields:[{name:"customPriceLabel",placeholder:p.formatMessage({defaultMessage:"【自訂金額】文字",id:"admin.support.【自訂金額】文字"}),label:p.formatMessage({defaultMessage:"自訂金額",id:"admin.support.自訂金額"}),leftIcon:C.cMR},{name:"customPriceMessage",placeholder:p.formatMessage({defaultMessage:"【自訂金額】對應訊息",id:"admin.support.【自訂金額】對應訊息"}),label:p.formatMessage({defaultMessage:"自訂訊息",id:"admin.support.自訂訊息"})},{name:"customPriceMin",placeholder:"".concat(p.formatMessage({defaultMessage:"【自訂金額】金額下限,最少",id:"admin.support.【自訂金額】金額下限,最少"})," ").concat(x),label:p.formatMessage({defaultMessage:"最低金額",id:"admin.support.最低金額"}),leftIcon:J,rules:{required:p.formatMessage({defaultMessage:"金額必填",id:"admin.support.金額必填"}),pattern:{value:/^[0-9]*$/,message:p.formatMessage({defaultMessage:"僅能輸入數字",id:"admin.support.僅能輸入數字"})},min:{value:x,message:"".concat(p.formatMessage({defaultMessage:"最低要設定",id:"admin.support.最低要設定"})).concat(x).concat(p.formatMessage({defaultMessage:"元喔",id:"admin.support.元喔"}))},max:s?null:{value:c,message:"".concat(p.formatMessage({defaultMessage:"單筆收款上限為",id:"admin.support.單筆收款上限為"})).concat(c).concat(p.formatMessage({defaultMessage:"元",id:"admin.support.元"}))}}}]},g||s?null:{...O.O,when:["enableSingleDonation",!0],isUnderGroup:!0}].filter(Boolean),S=[{type:"div",children:(0,r.Y)(N.A,{title:p.formatMessage({defaultMessage:"每月定額贊助",id:"admin.support.每月定額贊助"}),children:p.formatMessage({defaultMessage:"粉絲每月固定金額贊助;每次贊助扣款後,系統會自動發信給贊助者,贊助者可以隨時取消訂閱",id:"admin.support.粉絲每月固定金額贊助;每次贊助扣款後,系統會自動發信給贊助者,贊助者可以隨時取消訂閱"})})},{name:"enableRecurringDonation",label:p.formatMessage({defaultMessage:"啟用每月定額贊助",id:"admin.support.啟用每月定額贊助"}),leftIcon:T.Hh9,type:"confirm-boolean",defaultValue:!1,confirmTitle:Y,confirmBody:A,confirmOnChecked:e=>!!(0,K.A)(null==e?void 0:e.enableSingleDonation,!0)&&null,confirmColorScheme:"red",followUpFields:[{name:"showRecurringSupporterCount",label:p.formatMessage({defaultMessage:"顯示贊助人數",id:"admin.support.顯示定期贊助人數"}),leftIcon:T.waN,type:"boolean",defaultValue:!1},{name:"recurringDonationDescription",label:p.formatMessage({defaultMessage:"方案說明",id:"admin.support.方案說明"}),type:"richtext",noAnimation:!0,defaultValue:"<p>".concat(p.formatMessage({defaultMessage:"每月一點小支持,是我前進的動力!",id:"admin.support.每月一點小支持,是我前進的動力!"}),"</p>")},{name:"recurringDonationEmailHelper",label:p.formatMessage({defaultMessage:"E-mail欄位文字",id:"admin.support.E-mail欄位文字"}),leftIcon:F.SOx,type:"textarea",defaultValue:p.formatMessage({defaultMessage:"我們將寄送給你每月定額贊助確認信件",id:"admin.support.我們將寄送給你每月定額贊助確認信件"})}]},{name:"recurringDonationPrices",label:p.formatMessage({defaultMessage:"金額選項",id:"admin.support.金額選項"}),type:"group",fields:[D,{name:"label",label:p.formatMessage({defaultMessage:"金額訊息",id:"admin.support.金額訊息"})}],defaultValue:[100,200].map((e,a)=>({id:(0,f.Ak)(),price:String(e),label:[p.formatMessage({defaultMessage:"收到你的心意",id:"admin.support.收到你的心意"}),p.formatMessage({defaultMessage:"感謝你的支持!",id:"admin.support.感謝你的支持!"})][a]})),isFixed:!0,when:["enableRecurringDonation",!0]},{name:"enableRecurringDonationCustomPrice",label:p.formatMessage({defaultMessage:"啟用自訂金額",id:"admin.support.啟用自訂金額"}),type:"boolean",followUpFields:[{name:"recurringDonationCustomPriceLabel",placeholder:p.formatMessage({defaultMessage:"【自訂金額】文字",id:"admin.support.【自訂金額】文字"}),label:p.formatMessage({defaultMessage:"自訂金額",id:"admin.support.自訂金額"}),defaultValue:p.formatMessage({defaultMessage:"自訂支持的金額",id:"admin.support.自訂支持的金額"}),leftIcon:C.cMR},{name:"recurringDonationCustomPriceMessage",placeholder:p.formatMessage({defaultMessage:"【自訂金額】對應訊息",id:"admin.support.【自訂金額】對應訊息"}),label:p.formatMessage({defaultMessage:"自訂訊息",id:"admin.support.自訂訊息"})},{name:"recurringDonationCustomPriceMin",placeholder:"".concat(p.formatMessage({defaultMessage:"【自訂金額】金額下限,最少",id:"admin.support.【自訂金額】金額下限,最少"})," ").concat(x),label:p.formatMessage({defaultMessage:"最低金額",id:"admin.support.最低金額"}),defaultValue:x,leftIcon:J,rules:{required:p.formatMessage({defaultMessage:"金額必填",id:"admin.support.金額必填"}),pattern:{value:/^[0-9]*$/,message:p.formatMessage({defaultMessage:"僅能輸入數字",id:"admin.support.僅能輸入數字"})},min:{value:x,message:"".concat(p.formatMessage({defaultMessage:"最低要設定",id:"admin.support.最低要設定"})).concat(x).concat(p.formatMessage({defaultMessage:"元喔",id:"admin.support.元喔"}))},max:s?null:{value:c,message:"".concat(p.formatMessage({defaultMessage:"å–
1®ç­†æ”¶æ¬¾ä¸Šé™ç‚º",id:"admin.support.單筆收款上限為"})).concat(c).concat(p.formatMessage({defaultMessage:"元",id:"admin.support.元"}))}}}],when:["enableRecurringDonation",!0]},{name:"telegramEnabled",label:(0,r.Y)(X,{hasChatId:!!(null==t?void 0:t.telegramChatId)}),leftIcon:I.hFS,type:"boolean",helper:p.formatMessage({defaultMessage:"設定此功能,Portaly 將自動依贊助金額管理你的私密社群成員",id:"admin.support.telegram.tooltip說明.v2"}),when:["enableRecurringDonation",!0],noAnimation:!0,isUnderGroup:!0}].filter(Boolean),k=[{type:"div",children:(0,r.Y)(N.A,{title:p.formatMessage({defaultMessage:"贊助圖片",id:"admin.support.贊助圖片"}),children:p.formatMessage({defaultMessage:"此圖片會顯示在每月定額與單筆贊助頁面",id:"admin.support.此圖片會顯示在每月定額與單筆贊助頁面"})})},{name:"showImage",label:p.formatMessage({defaultMessage:"顯示圖片",id:"admin.support.顯示圖片"}),type:"boolean",defaultValue:!0},{name:"image",label:p.formatMessage({defaultMessage:"方案圖片",id:"admin.support.方案圖片"}),type:"image",ratio:2,placeholder:p.formatMessage({defaultMessage:"建議尺寸:1200x600",id:"admin.support.建議尺寸:1200x600"}),when:["showImage",!0],isUnderGroup:!0}];return a=g||s?[...k,...w]:[...k,...S,...w],(0,r.FD)(n.Stack,{children:[(0,r.Y)(n.Text,{fontSize:"lg",mb:"-10",fontWeight:"bold",color:"gray.600",children:p.formatMessage({defaultMessage:"方案設定",id:"admin.support.方案設定"})}),(0,r.Y)(R.A,{children:(0,r.Y)(j.A,{data:M.current?{...t,enableRecurringDonation:"true"}:t,fields:a,onUpdate:d,trackerName:g?"en.admin.support.detail":"admin.support.detail",shouldConfirmClose:!0,shouldAutoOpen:M.current,scrollToField:b.current,children:(0,r.Y)(ee,{customPayment:s,template:u,maxAmount:c,profileId:m})},v)})]})},e=>{let{data:a,onUpdate:t,enableRewards:l,template:o}=e;if(!l)return null;let i=[{name:"rewards",label:"回饋品選項",type:"group",fields:[{name:"minAmount",label:"金額級距",type:"number",leftIcon:C.cMR,rules:{required:"金額必填"}},{name:"name",label:"回饋品名稱"},{name:"image",label:"圖片",type:"image",placeholder:"建議尺寸:1200 x 600",ratio:2},{name:"description",label:"回饋品說明"},{name:"limited",label:"限量",type:"number",leftIcon:et.dSh,helper:"注意:此欄位僅顯示數量,無自動倒數功能喔!"}],isFixed:!0}];return(0,r.Y)(n.Stack,{children:(0,r.Y)(R.A,{children:(0,r.Y)(j.A,{data:{...a,hidden:!(null==a?void 0:a.enabledRewards)},fields:i,onUpdate:e=>{let{hidden:a,...r}=e;return t(r)},onToggle:e=>t({enabledRewards:!e}),toggleLabel:"啟用回饋品",hiddenOverlay:"transparent",children:(0,r.Y)(er.A,{})})})})},e=>{let{data:a,onUpdate:t}=e,l=(0,i.A)(),o="en"===l.locale,s=[{name:"thanksTitle",label:l.formatMessage({defaultMessage:"感謝大標",id:"admin.support.感謝大標"})},{name:"thanksAlign",label:l.formatMessage({defaultMessage:"文字對齊",id:"admin.support.文字對齊"}),type:"radio",options:[{value:"flex-start",label:l.formatMessage({defaultMessage:"置左對齊",id:"admin.support.置左對齊"})},{value:"center",label:l.formatMessage({defaultMessage:"置中對齊",id:"admin.support.置中對齊"})},{value:"flex-end",label:l.formatMessage({defaultMessage:"置右對齊",id:"admin.support.置右對齊"})}],defaultValue:"center",leftIcon:el.eih},{name:"thanksImageType",label:l.formatMessage({defaultMessage:"圖片類型",id:"admin.support.圖片類型"}),type:"radio",options:[{label:l.formatMessage({defaultMessage:"一般圖片",id:"admin.support.一般圖片"}),value:"image"},{label:l.formatMessage({defaultMessage:"手機桌布",id:"admin.support.手機桌布"}),value:"mobileBackground"},{label:l.formatMessage({defaultMessage:"不顯示圖片",id:"admin.support.不顯示圖片"}),value:"none"}],leftIcon:en.O2I},{name:"thanksImage",label:l.formatMessage({defaultMessage:"回饋圖片",id:"admin.support.回饋圖片"}),type:"image",noResizer:!0,ratio:2},{name:"thanks",label:l.formatMessage({defaultMessage:"感謝文字",id:"admin.support.感謝文字"}),type:"richtext"}];return(0,r.FD)(n.Box,{children:[(0,r.Y)(n.Text,{fontSize:"lg",mb:a&&"-8",fontWeight:"bold",color:"gray.600",children:l.formatMessage({defaultMessage:"確認畫面設定",id:"admin.support.確認畫面設定"})}),(0,r.Y)(R.A,{children:(0,r.Y)(j.A,{data:a,fields:s,onUpdate:t,title:l.formatMessage({defaultMessage:"確認畫面設定",id:"admin.support.確認畫面設定"}),trackerName:o?"en.admin.support.thanks":"admin.support.thanks",shouldConfirmClose:!0,children:(0,r.Y)(es,{})})})]})}],eu=e=>{let{data:a,profileId:t,profileName:l,setActiveIndex:s}=e,d=(0,i.A)(),{handleUpdate:u}=(0,w.A)(t),c=(0,o.useMemo)(()=>{let e=Y()(null==a?void 0:a.projects)[0];return e?D()(e,e=>Array.isArray(e)?e.filter(e=>null!=e):e):e},[a]),m=e=>u({support:{projects:[e]}});return(0,r.Y)(n.Container,{spacing:4,maxWidth:"container.xs",mx:"auto",px:{base:0,sm:4},pos:"relative",children:(0,r.FD)(n.Stack,{spacing:4,children:[(0,r.Y)(ea.A,{value:null==a?void 0:a.notification,onUpdate:e=>u({support:{notification:e}}),profileId:t,label:d.formatMessage({defaultMessage:"當有粉絲付款成功時,系統會發一封通知信到您的聯絡信箱。",
1id:"admin.support.當有粉絲付款成功時,系統會發一封通知信到您的聯絡信箱。"})}),(0,r.Y)(n.Stack,{spacing:4,divider:(0,r.Y)(n.Divider,{}),children:ed.map((e,r)=>(0,o.createElement)(e,{data:c,customPayment:null==a?void 0:a.customPayment,template:(null==a?void 0:a.template)||"default",enableRewards:(null==a?void 0:a.enableRewards)||(null==a?void 0:a.template)==="candidate",maxAmount:(null==a?void 0:a.maxAmount)||$.oc,profileName:l,profileId:t,onUpdate:m,key:r}))})]})})};var ec=t(58323),em=t(11335);let ep=e=>{let a=(0,em.A)(),[t,r]=(0,o.useState)({accumulatedTotal:0,accumulatedCount:0}),[n,l]=(0,o.useState)({monthlyTotal:0,activeCount:0}),[i,s]=(0,o.useState)(!0),[d,u]=(0,o.useState)(null);return(0,o.useEffect)(()=>{if(!e){s(!1);return}(async()=>{s(!0),u(null);try{let[t,n]=await Promise.all([a("/api/recurringDonation/accumulatedAmount?profileId=".concat(e)),a("/api/recurringDonation/monthlyAmount?profileId=".concat(e))]);r(t),l(n)}catch(e){u(e instanceof Error?e:Error("Unknown error"))}finally{s(!1)}})()},[e]),{accumulatedTotal:t.accumulatedTotal,accumulatedCount:t.accumulatedCount,monthlyTotal:n.monthlyTotal,activeCount:n.activeCount,isLoading:i,error:d}};var eg=t(21158);let ef=(e,a,t,r)=>{let{data:n,isLoading:l,error:i}=(0,eg.PK)("/getRecurringDonations?profileId=".concat(e)),s=e=>e?e.startsWith("信用卡付款失敗")?"信用卡付款失敗":e:"-",d=(0,o.useMemo)(()=>n?n.map(e=>{let a=e.lastChargeDate||e.createdAt;return{orderId:e.originalOrderId,createdAt:e.createdAt,latestDonationDate:a,sponsorName:e.name,status:{label:e.status,cancelReason:s(e.cancelReason)},amount:e.amount,paymentsCount:e.paymentsCount,paymentsTotal:e.paymentsTotal,message:e.message,email:e.email}}):[],[n]);return{recurringDonationList:(0,o.useMemo)(()=>d?d.filter(e=>{let n=new Date(e.latestDonationDate),l=new Date(a),o=new Date(t);return o.setHours(23,59,59,999),!(n<l)&&!(n>o)&&("all"===r||e.status.label===r)}):[],[d,a,t,r]),isLoading:l,error:i}};var eh=t(77381),eM=t(47419),eb=t(85026);let ev=(0,eh.A)(new Date,"yyyy-MM-dd"),ey=(0,eh.A)((0,eM.A)(new Date,30),"yyyy-MM-dd"),ex=e=>{let{register:a,watch:t,control:l}=(0,S.mN)({defaultValues:{date:{start:ey,end:ev},status:"all"}}),{date:{start:o,end:i},status:s}=t(),d=(0,r.Y)(eb.A,{name:"date",register:a,control:l,size:"sm",fieldWidth:"8em"}),u=(0,r.FD)(n.FormControl,{w:"8em",children:[(0,r.Y)(n.FormLabel,{fontSize:"sm",children:e.formatMessage({defaultMessage:"訂閱狀態",id:"admin.support.訂閱狀態"})}),(0,r.Y)(n.Select,{size:"sm",...a("status"),maxW:"6em",children:[{value:"all",label:"全部"},{value:"active",label:"訂閱中"},{value:"canceled",label:"已取消"}].map(e=>(0,r.Y)("option",{value:e.value,children:e.label},e.value))})]});return{start:o,end:i,status:s,displayFilter:(0,r.Y)(r.FK,{children:(0,r.FD)(n.HStack,{w:"100%",justifyContent:"flex-start",children:[d,u]})})}};var eY=t(41034),eA=t(53035);let eD=function(e){let{accumulatedTotal:a,monthlyTotal:t,isLoading:l}=e,o=(0,i.A)();return l?(0,r.FD)(n.SimpleGrid,{columns:{base:1,md:2},spacing:4,mb:6,children:[(0,r.Y)(eA.A,{isLoading:!0}),(0,r.Y)(eA.A,{isLoading:!0})]}):(0,r.FD)(n.SimpleGrid,{columns:{base:1,md:2},spacing:4,mb:6,children:[(0,r.Y)(eA.A,{title:o.formatMessage({defaultMessage:"目前訂閱金額",id:"admin.support.目前訂閱金額"}),value:t,isLoading:l,prefix:"NT$ ",format:e=>e.toLocaleString()}),(0,r.Y)(eA.A,{title:o.formatMessage({defaultMessage:"累積訂閱總額",id:"admin.support.累積訂閱總額"}),value:a,isLoading:l,prefix:"NT$ ",format:e=>e.toLocaleString()})]})};var ew=t(89571),eS=t(90777);let eC=e=>[{Header:e.formatMessage({defaultMessage:"最新贊助日期",id:"admin.support.最新贊助日期"}),accessor:"latestDonationDate"},{Header:e.formatMessage({defaultMessage:"贊助者",id:"admin.support.贊助者"}),accessor:"sponsorName"},{Header:e.formatMessage({defaultMessage:"E-mail",id:"admin.support.E-mail"}),accessor:"email"},{Header:e.formatMessage({defaultMessage:"狀態",id:"admin.support.狀態"}),accessor:"status"},{Header:e.formatMessage({defaultMessage:"取消原因",id:"admin.support.取消原因"}),accessor:"cancelReason"},{Header:e.formatMessage({defaultMessage:"金額",id:"admin.support.金額"}),accessor:"amount"},{Header:e.formatMessage({defaultMessage:"贊助次數",id:"admin.support.贊助次數"}),accessor:"paymentsCount"},{Header:e.formatMessage({defaultMessage:"贊助累計金額",id:"admin.support.贊助累計金額"}),accessor:"paymentsTotal"},{Header:e.formatMessage({defaultMessage:"留言",id:"admin.support.留言"}),accessor:"message"}],eI=e=>{let{recurringDonationList:a,isDisabled:t}=e,n=(0,i.A)(),l=(0,o.useMemo)(()=>a.map(e=>({...e,cancelReason:e.status.cancelReason,status:"active"===e.status.label?n.formatMessage({defaultMessage:"訂閱中",id:"admin.support.訂閱中"}):n.formatMessage({defaultMessage:"已取消",id:"admin.support.已取消"})})),[a,n]);return(0,r.Y)(eS.A,{isDisabled:t,data:l,columns:eC(n),filename:n.formatMessage({defaultMessage:"每月定額名單",id:"admin.support.每月定額名單"}),variant:"outline",leftIcon:(0,r.Y)(ew.cIQ,{})})};var eT=t(12801),eF=t(32083),ek=t(9749),eR=t(78846),eN=t(8519);let eO=e=>{let{orderId:a,intl:t,functions:n}=e,[l,i]=(0,o.useState)(!1);(0,o.useEffect)(()=>{var e;(null===(e=(0,eN.A)("session"))||void 0===e?void 0:e.getItem("cancelRecurringDonation-".concat(a)))&&i(!0)},[a]);let s=async()=>{try{let e=(0,ek.httpsCallable)(n,"cancelRecurringDonationByOrderId");await e({orderId:a,reason:t.formatMessage({defaultMessage:"創作者取消贊助",id:"admin.support.創作者取消贊助"})}),i(!0),(0,eN.F)("cancelRecurringDonation-".concat(a),"true","session")}catch(t){var e;return null===(e=(0,eN.A)("session"))||void 0===e||e.removeItem("cancelRecurringDonation-".concat(a)),i(!1),t}};return(0,r.Y)(eR.A,{isDisabled:l,title:t.formatMessage({defaultMessage:"確認取消訂閱?",id:"admin.support.確認取消訂閱?"}),body:t.formatMessage({defaultMessage:"執行後將取消此用戶下一期的每月定額贊助。",id:"admin.support.執行後將取消此用戶下一期的每月定額贊助。"}),confirm:t.formatMessage({defaultMessage:"確認取消",id:"admin.support.確認取消"}),cancel:t.formatMessage({defaultMessage:"保留贊助",id:"admin.support.保留贊助"}),onClick:()=>s(),colorScheme:"red",variant:"outline",borderRadius:"xl",px:"4",py:"1",h:"auto",children:l?t.formatMessage({defaultMessage:"正在取消",id:"admin.support.正在取消"}):t.formatMessage({defaultMessage:"取消訂閱",id:"admin.support.取消訂閱"})})},eP=(e,a)=>[{Header:e.formatMessage({defaultMessage:"最新贊助日期",id:"admin.support.最新贊助日期"}),accessor:"latestDonationDate",Cell:e=>{let{value:a}=e;return(0,r.Y)(n.Stack,{w:"9em",children:(0,r.Y)(eT.A,{format:"yyyy-MM-dd HH:mm",twoRow:!1,ellipsis:!1,w:"100%",children:a})})}},{Header:e.formatMessage({defaultMessage:"贊助者",id:"admin.support.贊助者"}),accessor:"sponsorName",Cell:e=>{let{value:a}=e;return(0,r.Y)(n.Stack,{w:"3em",children:(0,r.Y)(n.Text,{children:a})})}},{Header:e.formatMessage({defaultMessage:"狀態",id:"admin.support.狀態"}),accessor:"status",Cell:a=>{let{value:t}=a;return(0,r.FD)(n.HStack,{minW:"5em",children:[(0,r.Y)(n.Text,{children:"active"===t.label?e.formatMessage({defaultMessage:"訂閱中",id:"admin.support.訂閱中"}):e.formatMessage({defaultMessage:"已取消",id:"admin.support.已取消"})}),"active"!==t.label&&t.cancelReason&&(0,r.Y)(k.A,{label:null,width:"auto",bg:"custom.bgGray",color:"custom.textGray",size:5,placement:"bottom",children:t.cancelReason})]})}},{Header:e.formatMessage({defaultMessage:"金額",id:"admin.support.金額"}),accessor:"amount",Cell:e=>{let{value:a}=e;return(0,r.Y)(n.Stack,{w:"5.5em",children:(0,r.Y)(eF.A,{prefix:"NT$",w:"5em",children:a})})}},{Header:e.formatMessage({defaultMessage:"次數",id:"admin.support.次數"}),accessor:"paymentsCount",Cell:e=>{let{value:a}=e;return(0,r.Y)(n.Stack,{w:"3em",children:(0,r.Y)(n.Text,{children:a})})}},{Header:e.formatMessage({defaultMessage:"贊助累計金額",id:"admin.support.贊助累計金額"}),accessor:"paymentsTotal",Cell:e=>{let{value:a}=e;return(0,r.Y)(n.Stack,{w:"5.5em",children:(0,r.Y)(eF.A,{prefix:"NT$",w:"5.5em",children:a})})},sum:!0},{Header:e.formatMessage({defaultMessage:"留言",id:"admin.support.留言"}),accessor:"message",Cell:e=>{let{value:a}=e;return(0,r.Y)(n.Stack,{w:"20em",children:(0,r.Y)(n.Text,{children:a})})}},{Header:e.formatMessage({defaultMessage:"E-mail",id:"admin.support.E-mail"}),accessor:"email",Cell:e=>{let{value:a}=e;return(0,r.Y)(n.Stack,{w:"12em",children:(0,r.Y)(n.Text,{children:a})})}},{Header:e.formatMessage({defaultMessage:"動作",id:"admin.support.動作"}),accessor:"action",Cell:t=>{let{row:l}=t;return(0,r.Y)(n.Stack,{w:"6em",children:"active"===l.original.status.label?(0,r.Y)(eO,{orderId:l.original.orderId,intl:e,functions:a}):(0,r.Y)(n.Text,{children:e.formatMessage({defaultMessage:"已取消訂閱",id:"admin.support.已取消訂閱"})})})}}],eE=function(e){let{profileId:a}=e,t=(0,i.A)(),l=(0,eY.A)(),{start:o,end:s,status:d,displayFilter:u}=ex(t),{recurringDonationList:c,isLoading:m}
1=ef(a,o,s,d),{accumulatedTotal:p,monthlyTotal:g,isLoading:f}=ep(a),h=eP(t,l);return(0,r.FD)(r.FK,{children:[(0,r.Y)(n.Text,{fontSize:"24px",fontWeight:700,mt:"2",mb:"4",children:t.formatMessage({defaultMessage:"每月定額名單",id:"admin.support.每月定額名單"})}),(0,r.Y)(eD,{accumulatedTotal:p,monthlyTotal:g,isLoading:f}),(0,r.FD)(n.HStack,{justifyContent:"space-between",children:[u,(0,r.Y)(eI,{recurringDonationList:c,isDisabled:m})]}),m?(0,r.Y)(n.Center,{py:"4",children:(0,r.Y)(n.Spinner,{})}):(0,r.Y)(r.FK,{children:(0,r.Y)(ec.A,{columns:h,data:c,variant:"minimal",storageKey:"recurringDonationList-".concat(a),isFixedPaginator:!0,textAlign:"end",placeholder:(0,r.Y)(n.Text,{mt:"1em",fontSize:"14px",pb:"5",textAlign:"center",children:t.formatMessage({defaultMessage:"無資料",id:"admin.support.無資料"})}),sx:{tbody:{tr:{height:"3.5em"},td:{paddingLeft:4,paddingRight:4}}}})})]})};var e_=t(9743),eB=t(92892);let eH={BOT_NOT_ADMIN:"BOT_NOT_ADMIN",BOT_NO_INVITE_PERMISSION:"BOT_NO_INVITE_PERMISSION",BOT_NO_BAN_PERMISSION:"BOT_NO_BAN_PERMISSION",CHAT_NOT_FOUND:"CHAT_NOT_FOUND",BOT_KICKED:"BOT_KICKED",BOT_INFO_FAILED:"BOT_INFO_FAILED",SAVE_FAILED:"SAVE_FAILED",UNKNOWN:"UNKNOWN"},eL={[eH.BOT_NOT_ADMIN]:{defaultMessage:"PortalyBot 沒有管理員權限",id:"admin.support.telegram.error.BOT_NOT_ADMIN"},[eH.BOT_NO_INVITE_PERMISSION]:{defaultMessage:"PortalyBot 缺少「邀請使用者」權限,請在群組管理員設定中開啟",id:"admin.support.telegram.error.BOT_NO_INVITE_PERMISSION"},[eH.BOT_NO_BAN_PERMISSION]:{defaultMessage:"PortalyBot 缺少「封鎖成員」權限,請在群組管理員設定中開啟",id:"admin.support.telegram.error.BOT_NO_BAN_PERMISSION"},[eH.CHAT_NOT_FOUND]:{defaultMessage:"Chat ID 錯誤或 PortalyBot 未加入群組,請確認後重試",id:"admin.support.telegram.error.CHAT_NOT_FOUND"},[eH.BOT_KICKED]:{defaultMessage:"PortalyBot 已被移出群組,請重新將 Bot 加入群組",id:"admin.support.telegram.error.BOT_KICKED"},[eH.BOT_INFO_FAILED]:{defaultMessage:"Bot 資訊取得失敗,請稍後再試",id:"admin.support.telegram.error.BOT_INFO_FAILED"},[eH.SAVE_FAILED]:{defaultMessage:"儲存失敗,請稍後再試",id:"admin.support.telegram.error.SAVE_FAILED"},[eH.UNKNOWN]:{defaultMessage:"發生未知錯誤,請稍後再試",id:"admin.support.telegram.error.UNKNOWN"}},ez=e=>{let{isOpen:a,onClose:t,status:l,errorMessage:o}=e,s=(0,i.A)(),d=o?eL[o]:void 0,u=s.formatMessage(d||eL[eH.UNKNOWN]);return(0,r.FD)(n.Modal,{isOpen:a,onClose:t,isCentered:!0,closeOnOverlayClick:"checking"!==l,closeOnEsc:"checking"!==l,children:[(0,r.Y)(n.ModalOverlay,{}),(0,r.Y)(n.ModalContent,{borderRadius:"2xl",py:"10",px:"6",maxW:"400px",children:(0,r.Y)(n.Center,{children:(0,r.FD)(n.Stack,{alignItems:"center",spacing:"4",children:["checking"===l&&(0,r.FD)(r.FK,{children:[(0,r.Y)(n.Text,{fontSize:"lg",fontWeight:"bold",color:"gray.700",children:s.formatMessage({defaultMessage:"檢查中",id:"admin.support.telegram.modal.檢查中"})}),(0,r.Y)(n.Spinner,{size:"md",color:"gray.500"})]}),"success"===l&&(0,r.FD)(r.FK,{children:[(0,r.Y)(n.Text,{fontSize:"lg",fontWeight:"bold",color:"GUI.green.500",children:s.formatMessage({defaultMessage:"綁定成功",id:"admin.support.telegram.modal.綁定成功"})}),(0,r.Y)(n.Icon,{as:F.G3G,boxSize:"8",color:"GUI.green.500"})]}),"error"===l&&(0,r.FD)(r.FK,{children:[(0,r.Y)(n.Text,{fontSize:"lg",fontWeight:"bold",color:"red.500",children:s.formatMessage({defaultMessage:"綁定失敗",id:"admin.support.telegram.modal.綁定失敗"})}),(0,r.Y)(n.Text,{fontSize:"sm",color:"red.500",textAlign:"center",children:u})]})]})})})]})},eV=()=>{let e=(0,i.A)(),a=(0,l.useRouter)(),{isOpen:t,onOpen:o,onClose:s}=(0,n.useDisclosure)();return(0,r.FD)(r.FK,{children:[(0,r.Y)(n.Button,{variant:"link",color:"GUI.green.500",fontWeight:"bold",fontSize:"sm",onClick:o,minW:"auto",h:"auto",p:"0",children:e.formatMessage({defaultMessage:"如何打開?",id:"admin.support.telegram.如何打開"})}),(0,r.FD)(n.Modal,{isOpen:t,onClose:s,isCentered:!0,size:"2xl",children:[(0,r.Y)(n.ModalOverlay,{}),(0,r.FD)(n.ModalContent,{borderRadius:"2xl",p:"6",w:"600px",children:[(0,r.Y)(n.ModalCloseButton,{}),(0,r.FD)(n.ModalBody,{px:"2",pt:"2",pb:"0",children:[(0,r.Y)(n.Text,{fontSize:"2xl",fontWeight:"bold",color:"custom.textGray",mb:"1",children:e.formatMessage({defaultMessage:"訂閱群組管理: Telegram",id:"admin.support.telegram.modal.title"})}),(0,r.Y)(n.Text,{fontSize:"md",color:"gray.500",mb:"6",children:e.formatMessage({defaultMessage:"在贊助管理編輯器中,點擊開關打開「啟用 Telegram 群組邀請」",id:"admin.support.telegram.modal.description"})}),(0,r.Y)(n.Box,{borderRadius:"lg",overflow:"hidden",children:(0,r.Y)(n.Image,{src:"/images/zh/admin/open-telegram-invite-instruction.png",alt:"Telegram setup guide",w:"full",objectFit:"cover"})})]}),(0,r.Y)(n.ModalFooter,{px:"2",pt:"6",pb:"0",children:(0,r.Y)(n.Button,{colorScheme:"green",borderRadius:"full",px:"8",onClick:()=>{s(),a.push({pathname:a.pathname,query:{...a.query,tab:0,autoOpenEditor:!0,scrollToField:"telegramEnabled"}},void 0,{shallow:!0})},children:e.formatMessage({defaultMessage:"立即打開",id:"admin.support.telegram.modal.立即打開"})})})]})]})]})},eU={display:"inline-flex",px:"1",borderRadius:"md",color:"GUI.green.500",bg:"#D7F9F0",fontWeight:"bold",buttonProps:{display:"none"}},eW=e=>{let{text:a}=e;return(0,r.Y)(eB.A,{...eU,text:a,children:(0,r.FD)(n.HStack,{as:"span",spacing:"1",alignItems:"center",whiteSpace:"nowrap",children:[(0,r.Y)(n.Box,{as:"span",children:a}),(0,r.Y)(n.Box,{as:"span",display:"inline-flex",children:(0,r.Y)(F.SD3,{size:"12px"})})]})})},eq=e=>{var a;let{profileId:t,data:l}=e,s=(0,i.A)(),d=(0,n.useToast)(),{handleUpdate:u}=(0,w.A)(t),c=(0,em.A)(),m=null==l?void 0:null===(a=l.projects)||void 0===a?void 0:a[0],[p,g]=(0,o.useState)((null==m?void 0:m.telegramChatId)||""),[f,h]=(0,o.useState)((null==m?void 0:m.telegramMinAmount)?String(m.telegramMinAmount):""),{isOpen:M,onOpen:b,onClose:v}=(0,n.useDisclosure)(),[y,x]=(0,o.useState)("checking"),Y=(0,o.useRef)(""),A=(0,o.useRef)(null),S=()=>{A.current&&clearTimeout(A.current),v()},C=/^-?\d{1,13}$/,I=async()=>
1{if(!p){d({title:s.formatMessage({defaultMessage:"請輸入群組 Chat ID",id:"admin.support.telegram.請輸入群組ChatID"}),status:"warning",duration:3e3});return}if(!C.test(p)){d({title:s.formatMessage({defaultMessage:"請輸入正確的 Chat ID 格式(如 -1001234567890)",id:"admin.support.telegram.chatId格式錯誤"}),status:"warning",duration:3e3});return}if(f&&1>Number(f)){d({title:s.formatMessage({defaultMessage:"最低金額需設定為 1 元以上",id:"admin.support.telegram.minAmount最低金額錯誤"}),status:"warning",duration:3e3});return}x("checking"),Y.current="",b();try{let e=await c("/api/telegram/check-binding?profileId=".concat(t,"&chatId=").concat(encodeURIComponent(p)));if(!(null==e?void 0:e.success)){Y.current=(null==e?void 0:e.errorCode)||(null==e?void 0:e.error)||eH.UNKNOWN,x("error");return}await u({support:{projects:[{...D()(m,e=>Array.isArray(e)?e.filter(e=>null!=e):e),telegramChatId:p,telegramMinAmount:f?Number(f):null,telegramGroupName:e.groupTitle||null}]}}),x("success"),A.current=setTimeout(S,2e3)}catch(e){Y.current=eH.SAVE_FAILED,x("error")}};return(0,r.FD)(n.Stack,{spacing:"7",px:{base:0,sm:4},children:[(0,r.FD)(n.Stack,{spacing:"3",children:[(0,r.Y)(n.Text,{fontSize:"lg",fontWeight:"bold",children:s.formatMessage({defaultMessage:"Telegram 管理",id:"admin.support.telegram.Telegram 管理"})}),(0,r.Y)(n.Text,{fontSize:"16px",children:s.formatMessage({defaultMessage:"每月定額贊助限定功能,適合用於經營付費私密社群。讓 Portaly 自動幫你管理私密社群的用戶",id:"admin.support.telegram.group.description"})}),(0,r.FD)(n.UnorderedList,{spacing:"2",fontSize:"16px",pl:"6",children:[(0,r.Y)(n.ListItem,{children:(0,r.FD)(n.HStack,{spacing:"3",alignItems:"center",children:[(0,r.Y)(n.Text,{children:s.formatMessage({defaultMessage:"設定並連接 Telegram 群組後,系統將自動管理成員",id:"admin.support.telegram.group.bullet1"})}),(0,r.Y)(n.Link,{href:"https://portaly.notion.site/Telegram-31bcd6b219248038baa0effeaa99ff66",isExternal:!0,fontSize:"sm",color:"GUI.green.500",fontWeight:"bold",border:"1px solid",borderColor:"GUI.green.500",borderRadius:"md",px:"2",py:"0.5",whiteSpace:"nowrap",_hover:{bg:"GUI.green.50"},children:s.formatMessage({defaultMessage:"設定教學",id:"admin.support.telegram.設定教學"})})]})}),(0,r.Y)(n.ListItem,{children:s.formatMessage({defaultMessage:"符合贊助條件的用戶會收到專屬的加入邀請連結",id:"admin.support.telegram.group.bullet2"})}),(0,r.Y)(n.ListItem,{children:s.formatMessage({defaultMessage:"取消贊助或退款後,將自動移除群組資格",id:"admin.support.telegram.group.bullet3"})})]})]}),(0,r.Y)(n.Divider,{}),(0,r.FD)(n.Stack,{spacing:"5",children:[(0,r.Y)(n.Text,{fontSize:"lg",fontWeight:"bold",children:s.formatMessage({defaultMessage:"詳細設定",id:"admin.support.telegram.詳細設定"})}),(0,r.FD)(n.Stack,{spacing:"3",fontSize:"16px",children:[(0,r.Y)(n.Text,{children:s.formatMessage({defaultMessage:"步驟 1:將 {bot} 加入群組並設為管理員,讓 Portaly 為你自動管理用戶。{link}",id:"admin.support.telegram.group.step1"},{bot:(0,r.Y)(eW,{text:"@PortalyBot"}),link:(0,r.Y)(n.Link,{href:"https://web.telegram.org",isExternal:!0,color:"GUI.green.500",fontWeight:"bold",children:s.formatMessage({defaultMessage:"前往 Telegram 設定",id:"admin.support.telegram.前往Telegram設定"})})})}),(0,r.Y)(n.Text,{children:s.formatMessage({defaultMessage:"步驟 2:加入後於對話框輸入 {command} 以獲得群組的 Chat ID",id:"admin.support.telegram.group.step2"},{command:(0,r.Y)(eW,{text:"/chatid@PortalyBot"})})}),(0,r.Y)(n.Text,{children:s.formatMessage({defaultMessage:"步驟 3:輸入群組 Chat ID、設定加入金額,並在編輯器中打開「啟用 Telegram 群組邀請」{howToOpen}",id:"admin.support.telegram.group.step3"},{howToOpen:(0,r.Y)(eV,{})})})]}),(0,r.FD)(n.Stack,{spacing:"3",w:{base:"100%",md:"640px"},children:[(0,r.Y)(n.Text,{fontSize:"sm",fontWeight:"normal",children:s.formatMessage({defaultMessage:"群組 ChatID",id:"admin.support.telegram.群組ChatID.label"})}),(0,r.Y)(n.Input,{size:"sm",borderRadius:"full",placeholder:s.formatMessage({defaultMessage:"群組 ChatId,範例:-1001234567890",id:"admin.support.telegram.例:-1001234567890"}),value:p,onChange:e=>g(e.target.value),borderColor:"gray.400",_placeholder:{color:"gray.400"}})]}),(0,r.FD)(n.Stack,{spacing:"3",w:{base:"100%",md:"640px"},children:[(0,r.Y)(n.Text,{fontSize:"sm",fontWeight:"normal",children:s.formatMessage({defaultMessage:"金額設定",id:"admin.support.telegram.金額設定.label"})}),(0,r.Y)(n.Input,{size:"sm",borderRadius:"full",placeholder:s.formatMessage({defaultMessage:"輸入最低贊助金額,未填寫則所有定期贊助者皆可加入",id:"admin.support.telegram.minAmount placeholder"}),value:f,onChange:e=>h(e.target.value),type:"number",min:1,borderColor:"gray.400",_placeholder:{color:"gray.400"}})]}),(0,r.Y)(n.Button,{variant:"outline",colorScheme:"green",borderRadius:"full",leftIcon:(0,r.Y)(e_.IqR,{}),onClick:I,w:{base:"100%",md:"640px"},children:s.formatMessage({defaultMessage:"儲存並檢查綁定結果",id:"admin.support.telegram.儲存並檢查綁定結果"})})]}),(0,r.Y)(ez,{isOpen:M,onClose:S,status:y,errorMessage:Y.current})]})};var eG=t(647),eK=t(14120),ej=t(61868);let e$=function(){let e=(0,i.A)(),a="en"===e.locale,{profileId:t,data:g,customPayment:f,betaTester:h}=(0,o.useContext)(eK.A),M=(0,l.useRouter)(),{data:b}=(0,eG.A)(t),v=(0,p.A)(b),x=!!(null==h?void 0:h["support-webhook"]),[Y,A]=(0,o.useState)(0);(0,o.useEffect)(()=>
1{if(M.query.tab){let e=parseInt(M.query.tab,10);[0,1,2].includes(e)&&A(e)}},[M.query.tab]);let D=(0,r.Y)(n.Flex,{alignItems:"center",flexDir:"column",flex:"1",pos:"relative",children:(0,r.Y)(n.VStack,{spacing:4,w:"full",flex:"1",bg:"white",pos:"relative",children:void 0===g.id?(0,r.Y)(n.Spinner,{}):(0,r.FD)(r.FK,{children:[(0,r.Y)(y,{data:g.support,profileId:t}),(0,r.Y)(eu,{data:g.support,profileId:t,profileName:g.name})]})})});return(0,r.FD)(r.FK,{children:[(0,r.Y)(s.A,{title:e.formatMessage({defaultMessage:"贊助設定",id:"admin.shared.贊助設定"})}),(0,r.FD)(d.A,{link:"/support",maxW:"lg",noShare:!0,children:[(0,r.Y)(m.A,{title:e.formatMessage({defaultMessage:"贊助設定",id:"admin.shared.贊助設定"}),tutorialUrl:!a&&"https://portaly.cc/blog/how-to-plan-a-donation-project",tutorialName:"admin.tutorial.贊助設定"}),!f&&(0,r.Y)(n.Box,{py:"4",children:(0,r.Y)(u.A,{isAdmin:M.query.id,verifyStatus:v,showSupportWebhook:x,profileId:t})}),a||f?(0,r.FD)(r.FK,{children:[(0,r.Y)(n.Divider,{mb:"4"}),D]}):(0,r.FD)(ej.vY,{mt:2,colorScheme:"green",index:Y,onChange:e=>{A(e),M.push({pathname:M.pathname,query:{...M.query,tab:e}},void 0,{shallow:!0})},children:[(0,r.FD)(ej.mP,{overflowX:"auto",sx:{"&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"},children:[(0,r.Y)(ej.IA,{index:0,whiteSpace:"nowrap",children:e.formatMessage({defaultMessage:"贊助方案管理",id:"admin.support.贊助方案管理"})}),(0,r.Y)(ej.IA,{index:1,whiteSpace:"nowrap",children:e.formatMessage({defaultMessage:"每月定額名單",id:"admin.support.每月定額名單"})}),(0,r.Y)(ej.IA,{index:2,whiteSpace:"nowrap",children:e.formatMessage({defaultMessage:"Telegram 管理",id:"admin.support.Telegram 管理"})})]}),(0,r.FD)(ej.rS,{pt:4,children:[(0,r.Y)(ej.SA,{index:0,children:D}),(0,r.Y)(ej.SA,{index:1,children:(0,r.Y)(eE,{profileId:t})}),(0,r.Y)(ej.SA,{index:2,children:(0,r.Y)(eq,{profileId:t,data:g.support})})]})]}),(0,r.Y)(c.A,{mode:"center"})]})]})}},40133:(e,a,t)=>{"use strict";t.d(a,{E:()=>u});var r=t(15284),n=t(54443),l=t(34906),o=t(81943),i=t(29857),s=t(41748),d=t(74848),u=(0,r.R)(function(e,a){let t=(0,n.Vl)("Text",e),{className:r,align:u,decoration:c,casing:m,...p}=(0,l.MN)(e),g=(0,s.o)({textAlign:e.align,textDecoration:e.decoration,textTransform:e.casing});return(0,d.jsx)(o.B.p,{ref:a,className:(0,i.cx)("chakra-text",e.className),...g,...p,__css:t})});u.displayName="Text"}},e=>{var a=a=>e(e.s=a);e.O(0,[19883,28505,58247,67690,17057,43465,87551,69735,81544,75687,38563,53958,75377,92535,28035,75945,78758,63596,65354,42419,92893,80971,97042,45310,37500,46661,87627,20821,31833,38808,64065,99624,13404,49785,96323,77381,90585,34005,47533,5244,85701,4589,57716,71511,10900,87583,66428,10907,94708,82122,46438,71086,24005,95413,18839,51573,95005,87260,64190,70481,43184,70789,92556,65581,62919,72982,60120,67988,69455,74703,35533,90636,46593,38792],()=>a(61039)),_N_E=e.O()}]);

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.