{"version":3,"sources":["webpack://@lemon8/web-sharing/./client/components/cta-modal/atom.ts","webpack://@lemon8/web-sharing/./client/components/cta-modal/index.tsx","webpack://@lemon8/web-sharing/./client/utils/active/active-to-article.ts","webpack://@lemon8/web-sharing/./client/utils/active/active-to-current-page.ts","webpack://@lemon8/web-sharing/./client/utils/active/active-to-feed.ts","webpack://@lemon8/web-sharing/./client/utils/active/active-to-user.ts","webpack://@lemon8/web-sharing/./client/utils/libra/schema-call-app.ts","webpack://@lemon8/web-sharing/./client/utils/active/active.ts","webpack://@lemon8/web-sharing/./client/utils/active/constant.ts","webpack://@lemon8/web-sharing/./client/utils/active/deeplink.ts","webpack://@lemon8/web-sharing/./client/utils/active/schema.ts","webpack://@lemon8/web-sharing/./client/utils/cta/use-cta-directly.ts","webpack://@lemon8/web-sharing/./client/utils/cta/use-cta-by-modal.ts","webpack://@lemon8/web-sharing/./client/utils/cta/use-cta-by-modal-callback.ts","webpack://@lemon8/web-sharing/./client/utils/event.ts","webpack://@lemon8/web-sharing/./client/utils/sharing-loader.ts","webpack://@lemon8/web-sharing/./shared/constant/click-position.ts","webpack://@lemon8/web-sharing/./shared/constant/loaders.ts","webpack://@lemon8/web-sharing/./shared/constant/page-type.ts","webpack://@lemon8/web-sharing/./shared/models/article/article-detail.ts","webpack://@lemon8/web-sharing/./shared/models/common/user-type.ts","webpack://@lemon8/web-sharing/./shared/utils/page-traffic-util.ts","webpack://@lemon8/web-sharing/./shared/utils/root-traffic-util.ts"],"names":["$CTAModal","atomWithReset","CTAModal","modelStatus","useAtomValue","close","useResetAtom","t","useTranslation","useEffect","window","Tea","current_position","clickPosition","page_click_id","clickId","handleClickConfirm","useCallback","click_result","onConfirm","handleClickCancel","onCancel","visibleCls","useMemo","shown","Boolean","hidden","modalContent","variant","React","createElement","className","Button","size","ButtonSize","title","onClick","titleColor","Colors","cls","activeToArticle","article","active","schemaOption","pid","SHARING_DEFAULT_PID","pageType","articleClass","EArticleClass","groupId","authorId","author","userId","ampExtraOption","activeToArticleByRelatedUserPost","user","VIDEO","activeToArticleByMeta","meta","activeToCurrentPage","traffic","store","get","$SharingPageLevelTraffic","EPageType","poiId","hashtagId","mediaId","activeToFeed","categoryId","activeToUser","activeToArticleAuthor","activeToCommentAuthor","comment","$UseSchemaDirectCall","atom","parameters","$ABTest","_get","props","href","URL","location","userAgent","navigator","versions","isiOS","isMacOS","$UserAgent","rootTraffic","$RootTraffic","pageTraffic","useSchemaDirectCall","hasApp","includes","$InstalledRelatedApp","fromScene","searchParams","schema","buildSchema","_objectSpread","oneLink","set","trafficPid","match","JSON","stringify","traffic_type","is_from_wap","_t","sharerToken","share_platform","sharePlatform","RootTrafficUtil","PageTrafficUtil","enter_position","enter_page_click_id","from_scene","deepLink","buildDeepLink","open","toString","SHARING_FB_PID","useDeepLink","useStore","isArticleSchemaBuildingProps","input","isVideoSchemaBuildingProps","isUserSchemaBuildingProps","isCategorySchemaBuildingProps","isHashtagSchemaBuildingProps","isPOISchemaBuildingProps","isSearchSchemaBuildingProps","buildSearchSchema","query","baseUrl","data","tab","inputClickType","logExtra","search_page_from","search_from","previous_page_name","concat","encodeURIComponent","protocol","host","params","URLSearchParams","group_id","user_id","channel_id","String","hashtag_id","poi_id","Error","append","useCTADirectly","e","preventDefault","sendClickEvent","useCTADirectlyCallback","setCTAModal","useSetAtom","useCTAByModal","NoOperation","useCTAByModalCallback","sendCTAShowEvent","pageModule","currentPosition","current_page_module","sendRelatedPostShowEvent","rank","media_id","article_class","toLowerCase","buildSharingLoader","name","args","context","loaders","setRemixParams","EClickPosition","Loaders","User","UserPostsLoadmore","UserRelatedUserLoadmore","Article","ArticleRelatedLoadmore","ArticleCommentsLoadmore","ArticleCommentRepliesLoadmore","POI","POIPostsLoadmore","Hashtag","HashtagPostsLoadmore","PageTypeUtils","fromUrl","url","pathname","startsWith","segmentCount","split","filter","length","ECommentPermission","EWarningLabelType","EArticleUnavailableReason","ArticleDetailUtil","isAvailable","getCoverImage","imageList","largeImage","getArticlePath","prefix","UserTypeUtil","userType","linkName","getAuthorPath","EUserType","getLinkNamePrefix","type","getLinkNamePrefixByBelongTT","belongTT","getPageIdFromTraffic","getEnterPageExtra","enter_page_type","enter_page_id","getShareContentExtra","share_content_type","enterPageName","share_content_id","enterPageId"],"mappings":"8JAaO,MAAMA,G,EAAYC,iBAAyB,EAAK,E,yBCDhD,MAAMC,EAAeA,IAAM,CAChC,MAAMC,G,EAAcC,gBAAaJ,CAAS,EACpCK,G,EAAQC,gBAAaN,CAAS,EAC9B,CAAEO,GAAE,G,EAAIC,KAAe,G,EAE7BC,aAAU,IAAM,CACV,CAACN,GAILO,OAAOC,IAAI,sBAAuB,CAChCC,iBAAkBT,EAAYU,cAC9BC,cAAeX,EAAYY,OAC7B,CAAC,CACH,EAAG,CAACZ,CAAW,CAAC,EAEhB,MAAMa,G,EAAqBC,eAAY,IAAM,CACvC,CAACd,IAGLO,OAAOC,IAAI,uBAAwB,CACjCC,iBAAkBT,EAAYU,cAC9BC,cAAeX,EAAYY,QAC3BG,aAAc,SAChB,CAAC,EAEDf,EAAYgB,UAAU,EACtBd,EAAM,EACR,EAAG,CAACF,EAAaE,CAAK,CAAC,EAEjBe,G,EAAoBH,eAAY,IAAM,CACtC,CAACd,IAILO,OAAOC,IAAI,uBAAwB,CACjCC,iBAAkBT,EAAYU,cAC9BC,cAAeX,EAAYY,QAC3BG,aAAc,QAChB,CAAC,EAEDf,EAAYkB,SAAS,EACrBhB,EAAM,EACR,EAAG,CAACF,EAAaE,CAAK,CAAC,EAEjBiB,G,EAAaC,WACjB,KAAO,CACLC,MAAOC,QAAQtB,CAAW,EAC1BuB,OAAQ,CAACvB,CACX,GACA,CAACA,CAAW,CACd,EAEMwB,G,EAAeJ,WAAQ,IACtBpB,EAIDA,EAAYyB,UAAY,UAExBC,EAAAC,cAAC,OAAIC,UAAU,6BACbF,EAAAC,cAAC,OAAIC,UAAU,aAAa,EAC5BF,EAAAC,cAAC,OAAIC,UAAU,QAAQxB,EAAE,oBA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9e9e06f2a4f60feeb188aa81a59add1c58d634b7.js","sourcesContent":["import { atomWithReset } from 'jotai/utils';\nimport { EClickPosition } from 'shared/constant';\n\ntype TCTAModel =\n | false\n | {\n variant: 'primary' | 'v2';\n clickPosition: EClickPosition;\n clickId?: string;\n onConfirm: () => void;\n onCancel: () => void;\n };\n\nexport const $CTAModal = atomWithReset(false);\n","import { FC, useCallback, useEffect, useMemo } from 'react';\nimport cls from 'classnames';\nimport { Button, ButtonSize, Colors } from '@lemon8/design';\nimport { useAtomValue } from 'jotai';\nimport { $CTAModal } from './atom';\nimport { useResetAtom } from 'jotai/utils';\nimport { useTranslation } from 'react-i18next';\n\nimport './style.scss';\n\nexport * from './atom';\n\nexport const CTAModal: FC = () => {\n const modelStatus = useAtomValue($CTAModal);\n const close = useResetAtom($CTAModal);\n const { t } = useTranslation();\n\n useEffect(() => {\n if (!modelStatus) {\n return;\n }\n\n window.Tea('wap_pop_window_show', {\n current_position: modelStatus.clickPosition,\n page_click_id: modelStatus.clickId,\n });\n }, [modelStatus]);\n\n const handleClickConfirm = useCallback(() => {\n if (!modelStatus) {\n return;\n }\n window.Tea('wap_pop_window_click', {\n current_position: modelStatus.clickPosition,\n page_click_id: modelStatus.clickId,\n click_result: 'install',\n });\n\n modelStatus.onConfirm();\n close();\n }, [modelStatus, close]);\n\n const handleClickCancel = useCallback(() => {\n if (!modelStatus) {\n return;\n }\n\n window.Tea('wap_pop_window_click', {\n current_position: modelStatus.clickPosition,\n page_click_id: modelStatus.clickId,\n click_result: 'cancel',\n });\n\n modelStatus.onCancel();\n close();\n }, [modelStatus, close]);\n\n const visibleCls = useMemo(\n () => ({\n shown: Boolean(modelStatus),\n hidden: !modelStatus,\n }),\n [modelStatus],\n );\n\n const modalContent = useMemo(() => {\n if (!modelStatus) {\n return null;\n }\n\n if (modelStatus.variant === 'primary') {\n return (\n
\n
\n
{t('sharing_popup_text')}
\n \n \n
\n );\n } else {\n return (\n
\n

{t('landing_postDetail_fullCaption_modal_title')}

\n

{t('landing_postDetail_fullCaption_modal_desc')}

\n \n \n
\n );\n }\n }, [modelStatus]);\n\n return (\n
\n
\n
\n
{modalContent}
\n
\n
\n );\n};\n","import { EArticleClass, TArticleDetail } from 'shared/models/article';\nimport { EClickPosition } from 'shared/constant';\nimport { active } from '~/utils/active/active';\nimport { IRelatedUserDetail, IRelatedUserPost } from 'shared/models';\nimport { SHARING_DEFAULT_PID } from './constant';\n\nexport const activeToArticle = (article: TArticleDetail, clickPosition: EClickPosition, clickId?: string): void => {\n active({\n schemaOption: {\n pid: SHARING_DEFAULT_PID,\n pageType: article.articleClass === EArticleClass.VIDEO ? 'video' : 'article',\n groupId: article.groupId,\n authorId: article.author.userId,\n },\n ampExtraOption: {\n clickPosition,\n clickId,\n },\n });\n};\n\nexport const activeToArticleByRelatedUserPost = (\n article: IRelatedUserPost,\n user: IRelatedUserDetail,\n clickPosition: EClickPosition,\n clickId?: string,\n): void => {\n active({\n schemaOption: {\n pid: SHARING_DEFAULT_PID,\n pageType: article.articleClass === EArticleClass.VIDEO ? 'video' : 'article',\n groupId: article.groupId,\n authorId: user.userId,\n },\n ampExtraOption: {\n clickPosition,\n clickId,\n },\n });\n};\n\nexport const activeToArticleByMeta = (\n meta: {\n pageType: 'video' | 'article';\n groupId: string;\n },\n clickPosition: EClickPosition,\n clickId?: string,\n): void => {\n active({\n schemaOption: {\n pid: SHARING_DEFAULT_PID,\n pageType: meta.pageType,\n groupId: meta.groupId,\n },\n ampExtraOption: {\n clickPosition,\n clickId,\n },\n });\n};\n","import { EClickPosition, EPageType } from 'shared/constant';\nimport { $SharingPageLevelTraffic } from 'shared/atoms';\nimport { active } from '~/utils/active/active';\nimport { DeepLinkBuildingProps } from '~/utils/active/schema';\nimport { SHARING_DEFAULT_PID } from '~/utils/active';\n\nexport const activeToCurrentPage = (clickPosition: EClickPosition, clickId?: string): void => {\n const store = window.store;\n const traffic = store.get($SharingPageLevelTraffic);\n let schemaOption: DeepLinkBuildingProps;\n\n switch (traffic.pageType) {\n case EPageType.USER:\n schemaOption = {\n pid: SHARING_DEFAULT_PID,\n pageType: 'user',\n userId: traffic.userId,\n };\n break;\n case EPageType.POI:\n schemaOption = {\n pid: SHARING_DEFAULT_PID,\n pageType: 'poi',\n poiId: traffic.poiId,\n };\n break;\n case EPageType.HASHTAG:\n schemaOption = {\n pid: SHARING_DEFAULT_PID,\n pageType: 'hashtag',\n hashtagId: traffic.hashtagId,\n };\n break;\n case EPageType.Gallery:\n schemaOption = {\n pid: SHARING_DEFAULT_PID,\n pageType: 'article',\n groupId: traffic.groupId,\n authorId: traffic.mediaId,\n };\n break;\n case EPageType.VIDEO:\n default:\n schemaOption = {\n pid: SHARING_DEFAULT_PID,\n pageType: 'video',\n groupId: traffic.groupId,\n authorId: traffic.mediaId,\n };\n break;\n }\n\n active({\n schemaOption,\n ampExtraOption: {\n clickPosition,\n clickId,\n },\n });\n};\n","import { EClickPosition } from 'shared/constant';\nimport { active } from '~/utils/active/active';\nimport { SHARING_DEFAULT_PID } from '~/utils/active';\n\nexport const activeToFeed = (clickPosition: EClickPosition, clickId?: string): void => {\n active({\n schemaOption: {\n pid: SHARING_DEFAULT_PID,\n pageType: 'feed',\n categoryId: 0,\n },\n ampExtraOption: {\n clickPosition,\n clickId,\n },\n });\n};\n","import { active } from './active';\nimport { IUserDetail } from 'shared/models/user';\nimport { EClickPosition } from 'shared/constant';\nimport { TComment } from 'shared/models/comment';\nimport { TArticleDetail } from 'shared/models/article';\nimport { SHARING_DEFAULT_PID } from '~/utils/active';\n\nexport const activeToUser = (user: IUserDetail, clickPosition: EClickPosition, clickId?: string): void => {\n active({\n schemaOption: {\n pid: SHARING_DEFAULT_PID,\n pageType: 'user',\n userId: user.userId,\n },\n ampExtraOption: {\n clickPosition,\n clickId,\n },\n });\n};\n\nexport const activeToArticleAuthor = (\n article: TArticleDetail,\n clickPosition: EClickPosition,\n clickId?: string,\n): void => {\n active({\n schemaOption: {\n pid: SHARING_DEFAULT_PID,\n pageType: 'user',\n userId: article.author.userId,\n },\n ampExtraOption: {\n clickPosition,\n clickId,\n },\n });\n};\n\nexport const activeToCommentAuthor = (comment: TComment, clickPosition: EClickPosition, clickId?: string): void => {\n active({\n schemaOption: {\n pid: SHARING_DEFAULT_PID,\n pageType: 'user',\n userId: comment.author.userId,\n },\n ampExtraOption: {\n clickPosition,\n clickId,\n },\n });\n};\n","import { $ABTest } from '@lemon8/web-app-shared/atom';\nimport { atom } from 'jotai';\nimport _get from 'lodash/get';\n\nexport const $UseSchemaDirectCall = atom((get) => {\n const { parameters } = get($ABTest);\n\n if ((__BUILD_TYPE__ as any) === 'local_dev') {\n return true;\n }\n\n return Boolean(_get(parameters, ['web', 'schema_direct_call'], false));\n});\n","import { $ABTest, $InstalledRelatedApp, $UserAgent } from '@lemon8/web-app-shared/atom';\nimport { DeepLinkBuildingProps, buildSchema } from './schema';\nimport { PageTrafficUtil } from 'shared/utils';\nimport { $SharingPageLevelTraffic, $RootTraffic } from 'shared/atoms';\nimport { EClickPosition } from 'shared/constant/click-position';\nimport { RootTrafficUtil } from 'shared/utils/root-traffic-util';\nimport { ExtractAtomValue } from 'jotai';\nimport { buildDeepLink } from './deeplink';\nimport { $UseSchemaDirectCall } from '../libra/schema-call-app';\n\nexport interface ActiveProps {\n schemaOption: DeepLinkBuildingProps;\n ampExtraOption: {\n clickPosition: EClickPosition;\n clickId?: string;\n };\n}\n\nexport const active = (props: ActiveProps): void => {\n const { schemaOption, ampExtraOption } = props;\n const store = window.store;\n const href = new URL(location.href);\n\n const { userAgent } = navigator;\n\n const { versions } = store.get($ABTest);\n\n const { isiOS, isMacOS } = store.get($UserAgent);\n const rootTraffic = store.get($RootTraffic);\n const pageTraffic = store.get($SharingPageLevelTraffic);\n const useSchemaDirectCall = store.get($UseSchemaDirectCall);\n const hasApp = !(['pending', null] as ExtractAtomValue[]).includes(\n store.get($InstalledRelatedApp),\n );\n\n const fromScene = href.searchParams.get('from_scene');\n\n const schema = buildSchema({\n ...schemaOption,\n });\n\n const oneLink = new URL('https://lemon8.onelink.me/FMQw');\n oneLink.searchParams.set('pid', rootTraffic.trafficPid);\n\n if (\n (userAgent.includes('Instagram') && userAgent.includes('AppleWebKit')) ||\n userAgent.includes('Messenger') ||\n userAgent.match(/FBAN|FBAV/i) ||\n (userAgent.includes('Snapchat') && userAgent.includes('AppleWebKit')) ||\n userAgent.includes('Lark')\n ) {\n oneLink.searchParams.set('af_force_deeplink', 'true');\n }\n\n oneLink.searchParams.set('af_dp', schema);\n oneLink.searchParams.set('retargeting', 'true');\n oneLink.searchParams.set('ab_version', versions);\n oneLink.searchParams.set(\n 'af_web_dp',\n isiOS || isMacOS\n ? 'https://itunes.apple.com/app/apple-store/id1498607143?pt=1613620&ct=interstitialdownload&mt=8'\n : 'https://play.google.com/store/apps/details?id=com.bd.nproject',\n );\n oneLink.searchParams.set(\n 'amp_extra',\n JSON.stringify({\n traffic_type: rootTraffic.trafficPid,\n is_from_wap: 1,\n\n // share_user_id: rootTraffic.sharerUid,\n // share_device_id: rootTraffic.sharerDid,\n // share_time: rootTraffic.shareTime,\n\n _t: rootTraffic.sharerToken,\n\n share_platform: rootTraffic.sharePlatform || null,\n\n // share content extra\n ...RootTrafficUtil.getShareContentExtra(rootTraffic),\n\n // enter page extra\n ...PageTrafficUtil.getEnterPageExtra(pageTraffic),\n\n // cta extra\n enter_position: ampExtraOption.clickPosition,\n enter_page_click_id: ampExtraOption.clickId || null,\n\n // TikTok profile bind\n from_scene: fromScene,\n }),\n );\n\n if (useSchemaDirectCall && hasApp) {\n const deepLink = buildDeepLink(props);\n location.href = deepLink;\n } else {\n window.open(oneLink.toString());\n }\n};\n","export const SHARING_FB_PID = 'share_al_fb';\n\nexport const SHARING_DEFAULT_PID = 'sharing_install';\n","import { buildSchema, DeepLinkBuildingProps } from '~/utils/active/schema';\nimport { EClickPosition } from 'shared/constant';\nimport { createStore, useStore } from 'jotai';\nimport { $RootTraffic, $SharingPageLevelTraffic } from 'shared/atoms';\nimport { $ABTest } from '@lemon8/web-app-shared/atom';\nimport { RootTrafficUtil } from 'shared/utils/root-traffic-util';\nimport { PageTrafficUtil } from 'shared/utils';\nimport { useMemo } from 'react';\n\nexport interface IDeepLinkProps {\n store?: ReturnType;\n\n schemaOption: DeepLinkBuildingProps;\n ampExtraOption?: {\n clickPosition?: EClickPosition;\n clickId?: string;\n };\n}\n\nexport const buildDeepLink = (props: IDeepLinkProps): string => {\n const { store = window.store, schemaOption, ampExtraOption } = props;\n\n const { versions } = store.get($ABTest);\n const rootTraffic = store.get($RootTraffic);\n const pageTraffic = store.get($SharingPageLevelTraffic);\n\n const schema = new URL(buildSchema(schemaOption));\n\n schema.searchParams.set('ab_version', versions);\n\n schema.searchParams.set(\n 'amp_extra',\n JSON.stringify({\n traffic_type: rootTraffic.trafficPid,\n is_from_wap: 0,\n\n // debug\n // share_user_id: rootTraffic.sharerUid,\n // share_device_id: rootTraffic.sharerDid,\n // share_time: rootTraffic.shareTime,\n\n _t: rootTraffic.sharerToken,\n share_platform: rootTraffic.sharePlatform || null,\n\n // share content extra\n ...RootTrafficUtil.getShareContentExtra(rootTraffic),\n\n // enter page extra\n ...PageTrafficUtil.getEnterPageExtra(pageTraffic),\n\n // cta extra\n enter_position: ampExtraOption?.clickPosition || null,\n enter_page_click_id: ampExtraOption?.clickId || null,\n }),\n );\n\n return schema.toString();\n};\n\nexport const useDeepLink = (schemaOption: DeepLinkBuildingProps): string => {\n const store = useStore();\n\n return useMemo(\n () =>\n buildDeepLink({\n store,\n schemaOption,\n }),\n [],\n );\n};\n","interface CommonSchemaBuildingProps {\n pageType: string;\n pid: string;\n}\n\ninterface DetailSchemaBuildingProps extends CommonSchemaBuildingProps {\n groupId: string;\n authorId?: string;\n}\n\ninterface ArticleSchemaBuildingProps extends DetailSchemaBuildingProps {\n pageType: 'article';\n}\n\nconst isArticleSchemaBuildingProps = (input: CommonSchemaBuildingProps): input is ArticleSchemaBuildingProps =>\n input.pageType === 'article';\n\ninterface VideoSchemaBuildingProps extends DetailSchemaBuildingProps {\n pageType: 'video';\n}\n\nconst isVideoSchemaBuildingProps = (input: CommonSchemaBuildingProps): input is VideoSchemaBuildingProps =>\n input.pageType === 'video';\n\nexport interface UserSchemaBuildingProps extends CommonSchemaBuildingProps {\n pageType: 'user';\n userId: string;\n}\n\nconst isUserSchemaBuildingProps = (input: CommonSchemaBuildingProps): input is UserSchemaBuildingProps =>\n input.pageType === 'user';\n\ninterface CategorySchemaBuildingProps extends CommonSchemaBuildingProps {\n pageType: 'feed';\n categoryId: number;\n}\n\nconst isCategorySchemaBuildingProps = (input: CommonSchemaBuildingProps): input is CategorySchemaBuildingProps =>\n input.pageType === 'feed';\n\nexport interface HashtagSchemaBuildingProps extends CommonSchemaBuildingProps {\n pageType: 'hashtag';\n hashtagId: string;\n}\n\nconst isHashtagSchemaBuildingProps = (input: CommonSchemaBuildingProps): input is HashtagSchemaBuildingProps =>\n input.pageType === 'hashtag';\n\nexport interface POISchemaBuildingProps extends CommonSchemaBuildingProps {\n pageType: 'poi';\n poiId: string;\n}\n\nconst isPOISchemaBuildingProps = (input: CommonSchemaBuildingProps): input is POISchemaBuildingProps =>\n input.pageType === 'poi';\n\nexport interface SearchSchemaBuildingProps extends CommonSchemaBuildingProps {\n pageType: 'search';\n query: string;\n}\n\nconst isSearchSchemaBuildingProps = (input: CommonSchemaBuildingProps): input is SearchSchemaBuildingProps =>\n input.pageType === 'search';\n\nconst buildSearchSchema = (props: SearchSchemaBuildingProps): string => {\n const { query } = props;\n\n const baseUrl =\n 'sslocal://lynxview?channel=search_v2&trans_status_bar=1&enter_anim=search_alpha&exit_anim=search_alpha&business_type=search&bundle=result_page%2Ftemplate.js';\n\n const data = {\n query,\n tab: 0,\n inputClickType: 'open',\n logExtra: {\n query,\n search_page_from: 'search_page_general',\n search_from: 'seo_click',\n previous_page_name: 'seo',\n },\n };\n\n return `${baseUrl}&business_data=${encodeURIComponent(JSON.stringify(data))}`;\n};\n\nexport type DeepLinkBuildingProps =\n | ArticleSchemaBuildingProps\n | VideoSchemaBuildingProps\n | UserSchemaBuildingProps\n | CategorySchemaBuildingProps\n | HashtagSchemaBuildingProps\n | POISchemaBuildingProps\n | SearchSchemaBuildingProps;\n\nexport const buildSchema = (props: DeepLinkBuildingProps): string => {\n // 唤活到搜索\n if (isSearchSchemaBuildingProps(props)) {\n return buildSearchSchema(props);\n }\n\n let protocol = 'snssdk2657:';\n let host = 'unknown';\n let params: URLSearchParams;\n\n // if (__BUILD_TYPE__ !== 'online') {\n // protocol = 'snssdk2657test:';\n // }\n\n if (isArticleSchemaBuildingProps(props)) {\n host = 'article_detail_page';\n params = new URLSearchParams({\n group_id: props.groupId,\n });\n if (props.authorId) {\n params.set('media_id', props.authorId);\n }\n } else if (isVideoSchemaBuildingProps(props)) {\n host = 'video_detail';\n params = new URLSearchParams({\n group_id: props.groupId,\n });\n if (props.authorId) {\n params.set('media_id', props.authorId);\n }\n } else if (isUserSchemaBuildingProps(props)) {\n host = 'user_profile';\n params = new URLSearchParams({\n user_id: props.userId,\n });\n } else if (isCategorySchemaBuildingProps(props)) {\n host = 'main';\n params = new URLSearchParams({\n tab: 'home',\n channel_id: String(props.categoryId),\n });\n } else if (isHashtagSchemaBuildingProps(props)) {\n host = 'hashtag';\n params = new URLSearchParams({\n hashtag_id: props.hashtagId,\n });\n } else if (isPOISchemaBuildingProps(props)) {\n host = 'poi_landing_page';\n params = new URLSearchParams({\n poi_id: props.poiId,\n });\n } else {\n throw new Error('unexcepted schema target');\n }\n\n // append common params\n params.append('pid', props.pid);\n\n return `${protocol}//${host}?${params.toString()}`;\n};\n","import { EClickPosition } from 'shared/constant';\nimport { SyntheticEvent, useCallback } from 'react';\nimport { sendClickEvent } from '~/utils/event';\nimport { useSetAtom } from 'jotai';\nimport { $CTAModal } from '~/components/cta-modal';\n\ninterface IUseCTADirectlyProps {\n clickPosition: EClickPosition;\n clickId?: string;\n onClick: () => void;\n}\n\ntype TCTADirectly = (e?: SyntheticEvent) => void;\n\nexport const useCTADirectly = (props: IUseCTADirectlyProps): TCTADirectly => {\n const { clickPosition, clickId, onClick } = props;\n\n return useCallback(\n (e?: SyntheticEvent) => {\n // 1. prevent default event behaviour\n e?.preventDefault();\n\n // 2. click position\n sendClickEvent({\n clickPosition,\n clickId,\n });\n\n // 3. call click\n onClick();\n },\n [clickPosition, clickId, onClick],\n );\n};\n\ninterface IUseCTADirectlyCallbackProps

{\n clickPosition: (params: P) => EClickPosition;\n clickId?: (params: P) => string;\n onClick: (params: P) => void;\n}\n\ntype TCTADirectlyCallback

= (params: P) => (e?: SyntheticEvent) => void;\n\nexport const useCTADirectlyCallback =

(props: IUseCTADirectlyCallbackProps

): TCTADirectlyCallback

=> {\n const { clickPosition, clickId, onClick } = props;\n\n const setCTAModal = useSetAtom($CTAModal);\n\n return useCallback(\n (params: P) => (e?: SyntheticEvent) => {\n // 1. prevent default event behaviour\n e?.preventDefault();\n\n // 2. click position\n sendClickEvent({\n clickPosition: clickPosition(params),\n clickId: clickId?.(params),\n });\n\n // 3. call on click\n onClick(params);\n },\n [clickPosition, clickId, onClick, setCTAModal],\n );\n};\n","import { EClickPosition } from 'shared/constant';\nimport { useSetAtom } from 'jotai';\nimport { $CTAModal } from '~/components/cta-modal';\nimport { SyntheticEvent, useCallback } from 'react';\nimport { sendClickEvent } from '~/utils/event';\nimport { NoOperation } from '@lemon8/web-app-shared/util';\n\ninterface IUseCTAByModalProps {\n variant?: 'primary' | 'v2';\n clickPosition: EClickPosition;\n clickId?: string;\n onConfirm: () => void;\n onCancel?: () => void;\n}\n\ntype TCTAByModal = (e?: SyntheticEvent) => void;\n\nexport const useCTAByModal = (props: IUseCTAByModalProps): TCTAByModal => {\n const { variant = 'primary', clickPosition, clickId, onCancel = NoOperation, onConfirm } = props;\n\n const setCTAModal = useSetAtom($CTAModal);\n\n return useCallback(\n (e?: SyntheticEvent) => {\n // 1. prevent default event behaviour\n e?.preventDefault();\n\n // 2. click position\n sendClickEvent({\n clickPosition,\n clickId,\n });\n\n // 3. show cta model\n setCTAModal({\n variant,\n clickPosition,\n clickId,\n onConfirm,\n onCancel,\n });\n },\n [clickPosition, clickId, onConfirm, onCancel, setCTAModal],\n );\n};\n","import { EClickPosition } from 'shared/constant';\nimport { useSetAtom } from 'jotai';\nimport { $CTAModal } from '~/components/cta-modal';\nimport { SyntheticEvent, useCallback } from 'react';\nimport { sendClickEvent } from '~/utils/event';\n\ninterface IUseCTAByModalCallbackProps

{\n variant: 'primary' | 'v2';\n clickPosition: (params: P) => EClickPosition;\n clickId?: (params: P) => string;\n onConfirm: (params: P) => void;\n onCancel?: (params: P) => void;\n}\n\ntype TCTAByModalCallback

= (params: P) => (e?: SyntheticEvent) => void;\n\nexport const useCTAByModalCallback =

(props: IUseCTAByModalCallbackProps

): TCTAByModalCallback

=> {\n const { variant, clickPosition, clickId, onCancel, onConfirm } = props;\n\n const setCTAModal = useSetAtom($CTAModal);\n\n return useCallback(\n (params: P) => (e?: SyntheticEvent) => {\n // 1. prevent default event behaviour\n e?.preventDefault();\n\n // 2. click position\n sendClickEvent({\n clickPosition: clickPosition(params),\n clickId: clickId?.(params),\n });\n\n // 3. show cta model\n setCTAModal({\n variant,\n clickPosition: clickPosition(params),\n clickId: clickId?.(params),\n onConfirm: () => onConfirm(params),\n onCancel: () => onCancel?.(params),\n });\n },\n [clickPosition, clickId, onConfirm, onCancel, setCTAModal],\n );\n};\n","import { EClickPosition } from 'shared/constant';\nimport { EPageModule } from 'shared/constant/page-module';\nimport { EArticleClass } from 'shared/models/article';\n\nexport const sendClickEvent = (props: { clickPosition: EClickPosition; clickId?: string }): void => {\n const { clickPosition, clickId } = props;\n window.Tea('wap_click', {\n current_position: clickPosition,\n page_click_id: clickId || null,\n });\n};\n\nexport const sendCTAShowEvent = (props: { pageModule: EPageModule; currentPosition: EClickPosition }): void => {\n const { pageModule, currentPosition } = props;\n\n window.Tea('wap_cta_show', {\n current_page_module: pageModule,\n current_position: currentPosition,\n });\n};\n\nexport const sendRelatedPostShowEvent = (props: {\n pageModule: EPageModule;\n clickPosition: EClickPosition;\n groupId: string;\n mediaId: string;\n articleClass: EArticleClass;\n rank: number;\n}): void => {\n const { pageModule, clickPosition, groupId, mediaId, articleClass, rank } = props;\n window.Tea('wap_related_post_show', {\n current_page_module: pageModule,\n current_position: clickPosition,\n group_id: groupId,\n media_id: mediaId,\n article_class: articleClass.toLowerCase(),\n rank,\n });\n};\n","import { LoaderFunction } from '@remix-run/node';\n\nexport const buildSharingLoader = (name: string): LoaderFunction => {\n return (args: any) => {\n const {\n context: { loaders, setRemixParams },\n params,\n } = args;\n\n setRemixParams(params);\n return loaders[name]();\n };\n};\n","export enum EClickPosition {\n /** Landing Modal */\n LandingModal = 'landing_modal',\n /** Auto silent awaken */\n SilentAwaken = 'silent_awaken',\n /** Common begins */\n TopBarLogo = 'top_bar_logo',\n TopBarDownload = 'top_bar_download',\n BottomButton = 'bottom_button',\n\n RelatedPostTitle = 'related_post_title',\n RelatedPost = 'related_post',\n RelatedPostSeeMore = 'related_post_see_more',\n /** Common ends */\n\n /** Article begins */\n MainHashtag = 'main_hashtag',\n MainContentPOI = 'main_content_poi',\n MainContentMentionedUser = 'main_content_mentioned_user',\n MainContentReadmore = 'main_content_readmore',\n MainInnerLink = 'main_inner_link',\n MainPOI = 'main_poi',\n MainAuthor = 'main_author',\n MainSearchAnchor = 'main_search_anchor',\n MainFollowButton = 'main_follow_button',\n MainVideoSeeMore = 'main_video_see_more',\n MainVideoInterception = 'main_video_interception',\n MainGalleryImage = 'main_gallery_image',\n MainGalleryInterception = 'main_gallery_interception',\n MainFavoriteIcon = 'main_favorite_icon',\n MainLikeIcon = 'main_like_icon',\n MainCommentIcon = 'main_comment_icon',\n MainShareIcon = 'main_share_icon',\n\n EndRecommend = 'end_recommend',\n EndSeeMore = 'end_see_more',\n\n CommentAuthor = 'comment_author',\n CommentReply = 'comment_reply',\n CommentDigg = 'comment_digg',\n CommentImage = 'comment_image',\n CommentMentionedUser = 'comment_mentioned_user',\n CommentSeeMore = 'comment_see_more',\n CommentReplySeeMore = 'comment_reply_see_more',\n /** Article ends */\n\n /** User begins **/\n UserFollowing = 'user_following',\n UserFans = 'user_fans',\n UserLikes = 'user_likes',\n AuthorFollowButton = 'author_follow_button',\n AuthorPrivateLetter = 'author_private_letter',\n AuthorTriangularArrow = 'author_triangular_arrow',\n AuthorPost = 'author_post',\n\n RelatedUser = 'related_user',\n /** User ends */\n\n /** POI begins */\n RelatedAddress = 'related_address',\n RelatedPhone = 'related_phone',\n /** POI ends */\n}\n","export const Loaders = {\n User: {\n UserPostsLoadmore: 'user-posts-loadmore',\n UserRelatedUserLoadmore: 'user-related-user-loadmore',\n },\n Article: {\n ArticleRelatedLoadmore: 'article-related-loadmore',\n ArticleCommentsLoadmore: 'article-comments-loadmore',\n ArticleCommentRepliesLoadmore: 'article-comment-replies-loadmore',\n },\n POI: {\n POIPostsLoadmore: 'poi-posts-loadmore',\n },\n Hashtag: {\n HashtagPostsLoadmore: 'hashtag-posts-loadmore',\n },\n};\n","export enum EPageType {\n Gallery = 'gallery',\n VIDEO = 'video',\n USER = 'user',\n USER_FOLLOW = 'user_follow',\n USER_TOPIC = 'user_topic',\n POI = 'poi',\n HASHTAG = 'hashtag',\n}\n\nexport const PageTypeUtils = {\n fromUrl: (url: string): EPageType | null => {\n const { pathname } = new URL(url);\n\n if (pathname.startsWith('/poi')) {\n return EPageType.POI;\n }\n if (pathname.startsWith('/topic')) {\n return EPageType.HASHTAG;\n }\n if (pathname.match(/^\\/[^\\/]+\\/follow/)) {\n return EPageType.USER_FOLLOW;\n }\n if (pathname.match(/^\\/[^\\/]+\\/topic/)) {\n return EPageType.USER_TOPIC;\n }\n\n // legacy article-i\n if (pathname.match(/^\\/article\\/i\\d+/)) {\n return EPageType.Gallery;\n }\n\n // legacy user-share\n if (pathname.match(/^\\/user\\/\\d+\\/share/)) {\n return EPageType.USER;\n }\n\n const segmentCount = pathname.split('/').filter(Boolean).length;\n if (segmentCount === 1) {\n return EPageType.USER;\n }\n if (segmentCount === 2) {\n return EPageType.Gallery;\n }\n\n return null;\n },\n};\n","import { IImage, IVideo } from 'shared/models/media';\nimport { IUserAuthInfo } from 'shared/models/user-auth-info';\nimport { EUserType, UserTypeUtil } from 'shared/models/common';\n\nexport enum ECommentPermission {\n All = 0, // 显示评论区\n Follower = 1, // 粉丝可评论\n Self = 2, // 自己可评论\n Disable = 3, // 不可评论,不显示评论区\n Friend = 4, // 好友可评论\n}\n\nexport interface GalleryLabelType {\n direction: string;\n id: string;\n imageIndex: number;\n name: string;\n type: string;\n xPct: number;\n yPct: number;\n}\n\nexport enum EArticleClass {\n GALLERY = 'Gallery',\n VIDEO = 'Video',\n ARTICLE = 'Article',\n}\n\nexport enum EWarningLabelType {\n DANGER = 101,\n DANGER_PROFESSIONAL = 102,\n COSMETIC_SURGERY = 103,\n SHOCKING = 401,\n ELECTION = 10001,\n}\n\nexport interface IIllegalInfo {\n warningLabel: string;\n warningLabelType: EWarningLabelType;\n}\n\nexport interface IArticleDetail {\n groupId: string;\n templateId?: string;\n imprId?: string;\n\n // author\n author: {\n userId: string;\n avatar: string;\n authInfo: IUserAuthInfo;\n nickName: string;\n linkName: string;\n userType: EUserType;\n };\n\n // content\n articleClass: EArticleClass;\n\n title: string;\n content: string;\n shortContent: string;\n\n // content publish time\n publishTime: number;\n modifyTime?: number;\n\n // interaction\n readCount: number;\n diggCount: number;\n favoriteCount: number;\n commentCount: number;\n\n // legacy hashtag\n forumList?: {\n id: string;\n name: string;\n }[];\n\n // poi\n locationInfo?: {\n poiId: string;\n poiName: string;\n poiArea?: string;\n };\n\n // search after read\n relatedQuery?: string;\n\n // privacy & safety\n isOnlyFollow: boolean;\n commentPermission: ECommentPermission;\n illegalInfo?: IIllegalInfo;\n}\n\nexport interface IVideoArticleDetail extends IArticleDetail {\n articleClass: EArticleClass.VIDEO;\n largeImage: IImage;\n video: IVideo;\n}\n\nexport interface IGalleryArticleDetail extends IArticleDetail {\n articleClass: EArticleClass.GALLERY;\n imageList: IImage[];\n galleryLabels: GalleryLabelType[];\n}\n\nexport interface IRichArticleDetail extends IArticleDetail {\n articleClass: EArticleClass.ARTICLE;\n largeImage: IImage;\n}\n\nexport type TArticleDetail = IVideoArticleDetail | IGalleryArticleDetail | IRichArticleDetail;\n\nexport enum EArticleUnavailableReason {\n NOT_FOUND = 'not_found',\n PRIVATE_ACCOUNT = 'private_account',\n SERVER_ERROR = 'server_error',\n}\n\nexport interface IArticleUnavailableDetail {\n groupId: string;\n unavailableReason: EArticleUnavailableReason;\n}\n\nexport const ArticleDetailUtil = {\n isAvailable: (article: TArticleDetail | IArticleUnavailableDetail): article is TArticleDetail => {\n return !('unavailableReason' in article);\n },\n getCoverImage: (article: TArticleDetail): IImage => {\n switch (article.articleClass) {\n case EArticleClass.GALLERY:\n return article.imageList[0];\n case EArticleClass.ARTICLE:\n case EArticleClass.VIDEO:\n default:\n return article.largeImage;\n }\n },\n getArticlePath: (article: TArticleDetail): string => {\n const prefix = UserTypeUtil.getLinkNamePrefix(article.author.userType);\n\n return `/${prefix}${article.author.linkName}/${article.groupId}`;\n },\n getAuthorPath: (article: TArticleDetail): string => {\n const prefix = UserTypeUtil.getLinkNamePrefix(article.author.userType);\n\n return `/${prefix}${article.author.linkName}`;\n },\n};\n","export enum EUserType {\n Unknown = 0,\n LemonLegacyUser = 1,\n LemonUpgradedUser = 2,\n TTUser = 3,\n}\n\nexport const UserTypeUtil = {\n getLinkNamePrefix: (type: EUserType): '' | '@' =>\n [EUserType.Unknown, EUserType.LemonLegacyUser].includes(type) ? '' : '@',\n getLinkNamePrefixByBelongTT: (belongTT: boolean): '' | '@' => {\n return belongTT ? '@' : '';\n },\n};\n","import { TPageLevelTraffic } from 'shared/atoms';\nimport { EPageType } from 'shared/constant/page-type';\n\nexport const PageTrafficUtil = {\n getPageIdFromTraffic: (traffic: TPageLevelTraffic): string => {\n switch (traffic.pageType) {\n case EPageType.Gallery:\n case EPageType.VIDEO:\n return traffic.groupId;\n case EPageType.HASHTAG:\n return traffic.hashtagId;\n case EPageType.POI:\n return traffic.poiId;\n case EPageType.USER:\n default:\n return traffic.userId;\n }\n },\n\n getEnterPageExtra: (traffic: TPageLevelTraffic): Record => {\n switch (traffic.pageType) {\n case EPageType.Gallery:\n return {\n enter_page_type: EPageType.Gallery,\n enter_page_id: traffic.groupId,\n };\n case EPageType.VIDEO:\n return {\n enter_page_type: EPageType.VIDEO,\n enter_page_id: traffic.groupId,\n };\n case EPageType.HASHTAG:\n return {\n enter_page_type: EPageType.HASHTAG,\n enter_page_id: traffic.hashtagId,\n };\n case EPageType.POI:\n return {\n enter_page_type: EPageType.POI,\n enter_page_id: traffic.poiId,\n };\n case EPageType.USER:\n default:\n return {\n enter_page_type: EPageType.USER,\n enter_page_id: traffic.userId,\n };\n }\n },\n};\n","import { ISharingRootTraffic } from 'shared/atoms';\n\nexport const RootTrafficUtil = {\n getShareContentExtra: (traffic: ISharingRootTraffic) => {\n return {\n share_content_type: traffic.enterPageName,\n share_content_id: traffic.enterPageId || null,\n };\n },\n};\n"],"sourceRoot":""}