
/*************************************************************************
 * ADOBE CONFIDENTIAL
 * ___________________
 *
 * Copyright 2019 Adobe. All Rights Reserved.
 *
 * NOTICE: All information contained herein is, and remains
 * the property of Adobe and its suppliers, if any. The intellectual
 * and technical concepts contained herein are proprietary to Adobe
 * and its suppliers and are protected by all applicable intellectual
 * property laws, including trade secret and copyright laws.
 * Dissemination of this information or reproduction of this material
 * is strictly forbidden unless prior written permission is obtained
 * from Adobe.
 **************************************************************************/

(window.webpackJsonp=window.webpackJsonp||[]).push([[0],{JdQH:function(e,t,a){"use strict";var s=a("y5v3"),o=a("zb5W"),n=a("iH74"),r=a("oj1z"),i=a("iTuP"),l=a("dxPx"),c=a("Ojs7"),f=a("J+cJ"),d=a.n(f),u=a("xPCX");class p{static normalizeItemView(e,t){let a=e||s.a.DEFAULT_ITEM_VIEW;return"grid"!==a||t.thumbnailViewEnabled?"list"!==a||t.listViewEnabled||(a="grid"):a="list",a}}const h=u.f.model("RecentFile",{identifier:u.f.maybe(u.f.union(u.f.string,u.f.null)),action:u.f.maybe(u.f.union(u.f.string,u.f.null)),thumb:u.f.maybe(u.f.union(u.f.string,u.f.null)),icon:u.f.maybe(u.f.union(u.f.string,u.f.null)),tip:u.f.maybe(u.f.union(u.f.string,u.f.null)),name:u.f.maybe(u.f.union(u.f.string,u.f.null)),lastOpened:u.f.maybe(u.f.union(u.f.number,u.f.null)),kind:u.f.maybe(u.f.union(u.f.string,u.f.null)),availableLocally:u.f.maybe(u.f.union(u.f.boolean,u.f.null)),size:u.f.maybe(u.f.union(u.f.number,u.f.null)),extension:u.f.maybe(u.f.union(u.f.string,u.f.null)),uniqueId:u.f.identifier}).volatile(e=>({contentType:null,position:-1,term:null,requestGUID:null})).views(e=>({get sortKind(){return e.kind+e.name},get filterName(){return e.name?e.name.normalize():""},get filterExtension(){return e.extension?e.extension.normalize():""}})).preProcessSnapshot(e=>({...e,extension:e.extension||e.kind||(e.name?e.name.split(".").pop():"")})).actions(e=>({setRequestGUID(t){e.requestGUID=t},updateFromSearch({contentType:t,position:a,term:s,requestGUID:o}){e.contentType=t,e.position=a,e.term=s,e.requestGUID=o}})),m=u.f.model("RecentFilePrefsStore",{thumbnailViewEnabled:!1,listViewEnabled:!1,currentItemView:s.a.DEFAULT_ITEM_VIEW,sortDirection:s.a.SORT.DESCENDING,sortItem:"lastOpened"}).preProcessSnapshot(e=>({...e,thumbnailViewEnabled:"string"==typeof e.thumbnailViewEnabled?"true"===e.thumbnailViewEnabled:e.thumbnailViewEnabled,listViewEnabled:"string"==typeof e.listViewEnabled?"true"===e.listViewEnabled:e.listViewEnabled})).volatile(e=>({filterString:""})).actions(e=>{function t(){o.a.setUserItem(s.a.LOCALSTORE_KEYS.MRU_PREFS,Object(u.d)(e))}return{setFilterString(a){e.filterString=a,t()},setSortDirection(a){e.sortDirection=a,t()},setSortItem(a){e.sortItem=a,t()},setItemView(a){(a=p.normalizeItemView(a,e))!==e.currentItemView&&(e.currentItemView=a,t())},loadPrefs(t){if(!t)return;const a=o.a.getUserItem(s.a.LOCALSTORE_KEYS.MRU_PREFS)||t;Object(u.b)(e,a),e.currentItemView=p.normalizeItemView(e.currentItemView,e)}}});let g=0;const b=u.f.model("RecentFilesStore",{prefs:u.f.optional(m,{}),items:u.f.optional(u.f.array(h),[]),artificialLength:-1}).views(e=>({get realOrArtificialLength(){return e.artificialLength<0?e.items.length:e.artificialLength}})).actions(e=>({addRecentFiles(t){e.items.replace(t.map(e=>({...e,uniqueId:`recent-${++g}`}))),e.artificialLength=-1},setArtificialLength(t){e.artificialLength=t}})),S=u.f.model("CCFile",{action:u.f.maybe(u.f.string),identifier:u.f.identifier,thumb:u.f.optional(u.f.frozen(),null),icon:u.f.maybe(u.f.string),tip:u.f.maybe(u.f.string),name:u.f.maybe(u.f.string),lastOpened:u.f.maybe(u.f.number),kind:u.f.maybe(u.f.string),availableLocally:u.f.maybe(u.f.boolean),size:u.f.number}).actions(e=>({setThumb(t){e.thumb=t}})).actions(e=>({afterCreate(){e.thumb instanceof Promise&&(e.thumb.then(e.setThumb),e.thumb=null),Object(u.e)(e,(t,a)=>{"/thumb"===t.path&&t.value instanceof Promise&&(Object(u.a)(e,a),t.value.then(e.setThumb))})}})).views(e=>({get sortKind(){return e.kind+e.name},get filterName(){return e.name?e.name.normalize():""},get filterExtension(){return""},get uniqueId(){return e.identifier}})),E=u.f.model("CCFilePrefsStore",{thumbnailViewEnabled:!0,listViewEnabled:!0,currentItemView:s.a.DEFAULT_ITEM_VIEW,sortDirection:s.a.SORT.DESCENDING,sortItem:"lastOpened"}).volatile(e=>({filterString:""})).actions(e=>{function t(){o.a.setUserItem(s.a.LOCALSTORE_KEYS.CCFILES_PREFS,Object(u.d)(e))}return{setFilterString(a){e.filterString=a,t()},setSortDirection(a){e.sortDirection=a,t()},setSortItem(a){e.sortItem=a,t()},setItemView(a){(a=p.normalizeItemView(a,e))!==e.currentItemView&&(e.currentItemView=a,t())},loadPrefs(t){if(!t)return;const a=o.a.getUserItem(s.a.LOCALSTORE_KEYS.CCFILES_PREFS)||t;Object(u.b)(e,a),e.currentItemView=p.normalizeItemView(e.currentItemView,e)}}}),I=u.f.model("CCFilesStore",{prefs:u.f.optional(E,{}),items:u.f.optional(u.f.array(S),[])}).actions(e=>({addCcFiles(t){e.items.replace(t)}})),y={shouldSort:!0,tokenize:!0,matchAllTokens:!0,threshold:.4,location:0,distance:1e3,maxPatternLength:32,minMatchCharLength:1,keys:["filterName","filterExtension"]};function P(e,t=76e3){let a,s=e?e.length:0,o=e?e[0]:null,n=Number.POSITIVE_INFINITY,r=0;if(0===s)return{href:"./images/filetypes/none.png",width:350,height:350,aspectRatio:1};for(;s--;)e[s].height&&e[s].width&&((r=e[s].height*e[s].width)>o.height*o.width&&(o=e[s]),r>t&&r<n&&(n=r,a=e[s]));return a||o}const D=u.f.model("UniversalSearchStore",{term:"",recentsTerms:u.f.optional(u.f.array(u.f.string),()=>o.a.getGlobalItem("searchTerms")||[]),recentFilesResults:u.f.optional(u.f.array(u.f.reference(h)),[]),abandoned:!1,totalSearchResults:0,requestGUID:u.f.maybeNull(u.f.string),learnResults:u.f.optional(u.f.array(u.f.frozen()),[]),learnResultsTotal:0,learnApplicableProducts:u.f.optional(u.f.array(u.f.frozen()),[]),stockResults:u.f.optional(u.f.array(u.f.frozen()),[]),stockResultsTotal:0,stockInitialCount:0,ccPhotosResults:u.f.optional(u.f.array(u.f.frozen()),[]),ccPhotosResultsTotal:0,ccPhotosInitialCount:0,ccFilesResults:u.f.optional(u.f.array(S),[]),ccFilesResultsTotal:0,ccCloudResults:u.f.optional(u.f.array(u.f.frozen()),[]),ccCloudResultsTotal:0,inAppTutorialResults:u.f.optional(u.f.array(u.f.frozen()),[]),messageTitle:"",message:"",messageState:""}).views(e=>({get recentFilesTotal(){return e.recentFilesResults.length},get maxLearnResultsToShow(){return 3}})).actions(e=>{let t=e;return{panelOpened(){t.abandoned=!1},userSearchInput(){t.abandoned=!0},panelClosed(){t.abandoned},setMessage(e){t.message=e.message,t.messageState=e.state,t.messageTitle=e.title},clearMessage(){t.message="",t.messageTitle="",t.messageState=""},clearResults(){t.ccFilesResults.clear(),t.recentFilesResults.clear(),t.learnResults.clear(),t.stockResults.clear(),t.ccPhotosResults.clear(),t.stockResultsTotal=0,t.learnResultsTotal=0,t.ccPhotosResultsTotal=0,t.ccFilesResultsTotal=0,t.ccCloudResultsTotal=0,t.requestGUID=null,t.inAppTutorialResults.clear()},addSearchTerm(e,a){t.abandoned=!1,t.term=a;const s=t.recentsTerms.indexOf(a);s>-1&&t.recentsTerms.splice(s,1),t.recentsTerms.unshift(a),t.recentsTerms.replace(t.recentsTerms.splice(0,5)),o.a.setGlobalItem("searchTerms",t.recentsTerms);const n=new d.a(e.items.slice(),y).search(a.normalize());t.recentFilesResults.replace(n.map((e,a)=>{const s=Object(u.c)(e);return s.updateFromSearch({contentType:"recentfiles",position:a,term:t.term,requestGUID:t.requestGUID}),s})),t.totalSearchResults=n.length},setRequestGuid(e){t.requestGUID=e},setMetrics(e){t.totalSearchResults=e.total_hits+t.recentFilesTotal},logRecentFilesRenderedEvent(){t.recentFilesResults&&(t.recentFilesResults.forEach(e=>{e.setRequestGUID(t.requestGUID),i.a.logRenderedEvent("search-card",e)}),i.a.logRenderedEvent("search-category",{contentType:"recentfiles",count:t.recentFilesResults.length,term:t.term,requestGUID:t.requestGUID}))},setLearnResults(e){t.learnResults=e&&e.items?e.items.slice(0,3).map((e,a)=>{const s=Object.assign({},e,{position:a,contentType:"learn",term:t.term,requestGUID:t.requestGUID});return i.a.logRenderedEvent("search-card",s),s}):[],t.learnResultsTotal=e?e.total_items:0,i.a.logRenderedEvent("search-category",{contentType:"learn",count:t.learnResultsTotal,term:t.term,requestGUID:t.requestGUID});let a=[];e&&e.items&&e.items[0]&&(a=e.items[0].learn_applicable_products||[]),t.learnApplicableProducts.replace(a)},setInAppTutorialResults(e){t.inAppTutorialResults=e},setStockInitialCount(e){t.stockInitialCount=e},setStockResults(e){let a;e&&Array.isArray(e.items)&&(e.items=e.items.filter(e=>"video"!==e.asset_type)),t.stockResults=e&&0!==e.total_items?e.items.map((e,s)=>{a=P(e._links&&e._links.rendition);const o=Object.assign({},e,{thumb:{href:a.href,width:a.width,height:a.height,aspectRatio:a.width/a.height},position:s,contentType:"stock",term:t.term,requestGUID:t.requestGUID});return i.a.logRenderedEvent("search-card",o),o}):[],t.stockResultsTotal=e?e.total_items:0,i.a.logRenderedEvent("search-category",{contentType:"stock",count:t.stockResultsTotal,term:t.term,requestGUID:t.requestGUID})},setCcPhotosInitialCount(e){t.ccPhotosInitialCount=e},setCcPhotosResults(e){if(!e)return;const a=e.items||[];let s;0===t.ccPhotosResults.length&&(t.ccPhotosResultsTotal=e.total_items,i.a.logRenderedEvent("search-category",{contentType:"ccphotos",count:t.ccPhotosResultsTotal,term:t.term,requestGUID:t.requestGUID})),t.ccPhotosResults.replace(t.ccPhotosResults.concat(a.map((e,a)=>{s=P(e._links&&e._links.rendition);const o=Object.assign({},e,{thumb:{href:s.href,rendition:s.href,width:s.width,height:s.height,id:Math.random(),aspectRatio:s.width/s.height,text:""},position:a,term:t.term,requestGUID:t.requestGUID,contentType:"ccphotos",get href(){return e._links&&e._links.source?e._links.source.href:this.largestRendition},isFullRendition:!(!e._links||!e._links.source)&&e._links.source.href.endsWith("/master"),largestRendition:P(e._links&&e._links.rendition,Number.POSITIVE_INFINITY).href});return i.a.logRenderedEvent("search-card",o),o})))},setCcFilesResults(e){t.ccFilesResults.replace([]),(e&&0!==e.total_items?e.items:[]).forEach((e,a)=>{const o=e._links.rendition&&e._links.rendition[0].href.replace("{size}",s.a.THUMBNAIL_SIZE).replace("{format}",s.a.THUMBNAIL_FORMAT),i=e._links.original.href.replace(/\/content/,"");l.a.getCCFileMetadata(i.concat("/:metadata")).then(a=>{const n=a.name,f=a.path,d=n.split(".").pop(),u=s.a.FILETYPE_KIND[d];t.addCcFile(Object.assign({},e,{action:"ccfiles",contentType:"ccfiles",name:n,identifier:f,asset_type:e.creative_cloud_asset_type,tip:r.a.prettifyFilePath(f),availableLocally:c.default.fileExists(f),thumb:o?l.a.getRenditionImageBlobUrl(o):l.a.getDefaultRenditionUrl(),extension:d,kind:u,term:t.term,requestGUID:t.requestGUID,href:i}))}).catch(e=>{n.a.logJSON("uss.ccfiles.promise error: ",e)})}),t.ccFilesResultsTotal=e?e.total_items:0,i.a.logRenderedEvent("search-category",{contentType:"ccfiles",count:t.ccFilesResultsTotal,term:t.term,requestGUID:t.requestGUID})},addCcFile(e){e&&(t.ccFilesResults.push(e),e.position=t.ccFilesResults.length-1,i.a.logRenderedEvent("search-card",e))},getMoreCcPhotos(){if(t.ccPhotosResults.length<t.ccPhotosResultsTotal){return l.a.loadCCPhotos(t.term,t.ccPhotosResults.length,100).then(e=>{t.setCcPhotosResults(e.result_sets[0])})}return Promise.resolve()},setCcCloudResults(e){t.ccCloudResults.replace(e?e.items:[]),t.ccCloudResultsTotal=e?e.total_items:0}}});var T=a("sKM9"),C=a("RQdL");const R=u.f.model("SearchComponentStore",{useCCSearchComponent:u.f.optional(u.f.boolean,!0),enableCCSearchComponent:u.f.optional(u.f.boolean,!0),showSRP:u.f.optional(u.f.boolean,!1),showSearchTakeover:u.f.optional(u.f.boolean,!1),query:u.f.optional(u.f.string,""),searchCleared:u.f.optional(u.f.boolean,!1),showSearchDropdown:u.f.optional(u.f.boolean,!0),exitSearch:u.f.optional(u.f.boolean,!1),isDownloading:u.f.optional(u.f.boolean,!1),gotDownloadError:u.f.optional(u.f.boolean,!1),hasAccessToken:u.f.optional(u.f.boolean,!1),dropdownState:u.f.optional(u.f.boolean,!1),currentAppArray:u.f.optional(u.f.array(u.f.string),[]),fetchAccessTokenAttempts:u.f.optional(u.f.number,0)}).actions(e=>({showSRPView(t){e.showSRP=t},setShowSearchTakeover(t){e.showSearchTakeover=t},setQuery(t){e.query=t},setClearSearch(t){e.searchCleared=t},setShowSearchDropdown(t){e.showSearchDropdown=t},setEnableCCSearchComponent(t){e.enableCCSearchComponent=t},setUseCCSearchComponent(t){e.useCCSearchComponent=t},setExitSearch(t){e.exitSearch=t},setDownloading(t){e.isDownloading=t},setDownloadError(t){e.gotDownloadError=t},setHaveAccessToken(t){e.hasAccessToken=t},setDropdownState(t){e.dropdownState=t},setCurrentAppArray(t){e.currentAppArray=t},setFetchAccessTokenAttempts(t){e.fetchAccessTokenAttempts=t}}));var _,v=a("JU0K");a.d(t,"c",function(){return U}),a.d(t,"d",function(){return M}),function(e){e[e.NONE=0]="NONE",e[e.TRIAL=1]="TRIAL",e[e.RETAIL_SERIALIZED=2]="RETAIL_SERIALIZED",e[e.SUBSCRIPTION=3]="SUBSCRIPTION",e[e.VOLUME_SERIALIZED=4]="VOLUME_SERIALIZED",e[e.UNKNOWN=5]="UNKNOWN"}(_||(_={}));const A=u.f.enumeration(["home","learn","ccfiles","ccphotos","custom","sync","startertemplate"]),O=u.f.model("HostData",{_identifier:u.f.optional(u.f.identifier,"HostData"),hostID:u.f.optional(u.f.string,""),tabs:u.f.optional(u.f.frozen(),{}),appVersion:u.f.maybe(u.f.string),platform:u.f.maybe(u.f.string),hasOpenDocuments:u.f.optional(u.f.boolean,!1),homeScreenVisible:u.f.optional(u.f.boolean,!0),language:u.f.optional(u.f.string,"en_US"),sessionGUID:u.f.maybe(u.f.string),buttonInfo:u.f.optional(u.f.frozen(),{}),defaultTab:u.f.maybe(u.f.string),fnftEnabled:u.f.maybe(u.f.boolean),userTrackingEnabled:u.f.maybe(u.f.boolean),usingSimData:u.f.maybe(u.f.boolean),usingDirectData:u.f.maybe(u.f.boolean)}).preProcessSnapshot(e=>({...e,buttonInfo:e.buttonInfo||{}})).actions(e=>({updateVisibility(t,a){e.homeScreenVisible=t,e.hasOpenDocuments=a},setFnftEnabled(t){e.fnftEnabled=t}})),N=u.f.model("AppPrefsStore",{currentRoute:u.f.optional(A,"home"),currentItemView:u.f.optional(u.f.map(u.f.string),{}),launchCount:0,displayCount:0,lastSession:u.f.maybeNull(u.f.union(u.f.string,u.f.boolean)),hostData:u.f.maybe(u.f.reference(O)),sessionGUID:u.f.maybe(u.f.string)}).volatile(e=>({firstRunLaunchCount:s.a.DEFAULT_FIRST_RUN_LAUNCH_COUNT,showNewDragDropUI:!1,specialPromoOverlay:!1})).actions(e=>{function t(){const t=Object.assign({},Object(u.d)(e));e.hostData&&(t.sessionGUID=e.hostData.sessionGUID),o.a.setUserItem(s.a.LOCALSTORE_KEYS.MAIN_PREFS,t)}return{setHostData(t){e.hostData=t},savePrefs(){t()},loadPrefs(){!function(){const a=o.a.getUserItem(s.a.LOCALSTORE_KEYS.MAIN_PREFS);a&&Object(u.b)(e,a),e.displayCount++,e.launchCount++,t(),console.log("***self.launchCount",e.launchCount)}()},changeLaunchCount(t){!function(t){e.launchCount=t}(t)}}}),w=u.f.model("SharedSettings",{lastModified:u.f.optional(u.f.string,""),toast:u.f.optional(u.f.map(u.f.frozen()),{}),collapsibleContainer:u.f.optional(u.f.map(u.f.frozen()),{}),presetsDropdown:u.f.optional(u.f.map(u.f.frozen()),{}),wasRedirectedToDefaultLayout:u.f.optional(u.f.map(u.f.frozen()),{}),whatsNew:u.f.optional(u.f.map(u.f.frozen()),{}),video:u.f.optional(u.f.map(u.f.frozen()),{}),survey:u.f.optional(u.f.map(u.f.frozen()),{})}),F=u.f.model("SidekickStore",{}).volatile(e=>({sidekickVisible:!1,homeExperienceOverride:null,learnExperienceOverride:null,toastOverride:null,toastIdOverride:null,whatsNewOverride:null,whatsNewIdOverride:null})).actions(e=>({toggleSidekick(t){e.sidekickVisible=t},setHomeExperienceOverride(t){e.homeExperienceOverride=t},setLearnExperienceOverride(t){e.learnExperienceOverride=t},setToastOverride(t){e.toastOverride={content:t}},setToastIdOverride(t){e.toastIdOverride=t},setWhatsNewOverride(t){e.whatsNewOverride={content:t}},setWhatsNewIdOverride(t){e.whatsNewIdOverride=t}})),L=u.f.model("MainStore",{online:navigator.onLine,radarSessionGUID:r.a.generateGUID(),radarVersion:u.f.maybe(u.f.string),avatar:u.f.maybe(u.f.string),prefs:u.f.optional(N,{}),hostData:u.f.optional(O,{}),searchStore:u.f.optional(D,{}),recentFilesStore:u.f.optional(b,{}),ccFilesStore:u.f.optional(I,{}),sophiaStore:u.f.optional(T.b,{}),sharedSettings:u.f.optional(w,{}),sidekickStore:u.f.optional(F,{}),user:u.f.optional(C.b,{}),ccxAssetPath:"",learnAssetPath:"",isDebugMode:!1,ccFilesReady:!1,sophiaReady:!1,ready:!1,messages:u.f.optional(u.f.frozen(),null),colorTheme:"dark",isLoading:!1,lastKnownSophiaData:u.f.optional(u.f.string,""),lastNGLWorkflowInProgress:u.f.maybeNull(u.f.string),searchComponent:u.f.optional(R,{})}).volatile(e=>({didViewWelcomeMessagePerSession:!1,shouldUseDefaultLayoutInFallbackMode:!1,errorMessageForDefaultLayout:"",proxyUser:"",proxyPassword:""})).views(e=>({get shouldRenderFallback(){return e.shouldUseDefaultLayoutInFallbackMode&&!e.sidekickStore.homeExperienceOverride&&!e.sidekickStore.learnExperienceOverride},get currentItemView(){switch(e.prefs.currentRoute){case"ccfiles":return e.ccFilesStore.prefs.currentItemView;case"home":return e.recentFilesStore.prefs.currentItemView;default:return e.prefs.currentItemView.get(e.prefs.currentRoute)||s.a.DEFAULT_ITEM_VIEW}},getFullAssetPath(t,a="path",s="url",o="sophia"){const n="sophia"===o?e.ccxAssetPath:e.learnAssetPath;if(t[a]&&""!==n)return`${n}/${t[a]}`;{const e=t[s];return e.startsWith("//")?`https:${e}`:e}}})).actions(e=>({updateProxySettings(t,a){e.proxyUser=t,e.proxyPassword=a},setHostData(t){Object(u.b)(e.hostData,t),e.prefs.setHostData(e.hostData),e.radarVersion=c.default.getExtensionVersion(!0).version},setSessionGuid(t){e.prefs.sessionGUID=e.hostData.sessionGUID=t.toUpperCase(),e.prefs.savePrefs()},setMessages(t){e.messages=t,e.ready=!0},setSharedSetting(t,a,o){if(e.sharedSettings[t].set(a,o),!window.cep)return;const n=new v.b(s.a.IPCEVENT.VULCAN_START_SETTINGS_REQUEST,void 0,void 0);n.setPayload(JSON.stringify({settings:{[`${t}`]:{[`${a}`]:o}},productCode:e.hostData.hostID,productVersion:e.hostData.appVersion,countryCode:e.user.UserProfile.countryCode,userId:e.user.UserProfile.userId,ccxVersion:c.default.getExtensionVersion(!0).version})),v.a.dispatchMessage(n)},patchSharedSettings(t={lastModified:""}){t.lastModified&&t.lastModified.length>0&&(e.sharedSettings.lastModified=t.lastModified),delete t.lastModified;for(let a in t){e.sharedSettings[a]||(e.sharedSettings[a]=new Map);for(let s in t[a])e.sharedSettings[a].set(s,t[a][s])}},setUserData(t){n.a.toConsole("New NGL Profile "+JSON.stringify(t,null,2)),Object(u.b)(e.user,t)},setSophiaData(t){if(!t)return;const a=Object.assign({},t);delete a.isCached,delete a.settings,e.lastKnownSophiaData=JSON.stringify(a);const s=e.sophiaStore.tutorialData;Object(u.b)(e.sophiaStore,t),e.sophiaStore.setTutorials(s),e.sophiaReady=!0,e.prefs.savePrefs()},setAvatar(t){t&&(e.avatar=t)},addCcFiles(t){e.ccFilesStore.addCcFiles(t),e.ccFilesReady=!0},setCcFilesReady(t){e.ccFilesReady=t},setOnline(t){e.online=t},navigate(t){"ccfiles"===t&&(t="home"),e.prefs.currentRoute=t,e.prefs.savePrefs()},setDebugMode(t){e.isDebugMode=t},setMessageSeenFlag(t){e.didViewWelcomeMessagePerSession=t},setShouldUseDefaultLayoutInFallbackMode(t,a="",s,o){t&&"learn"===e.prefs.currentRoute&&(e.prefs.currentRoute="home"),e.shouldUseDefaultLayoutInFallbackMode=t,e.errorMessageForDefaultLayout=a,o&&i.a.logMiscellaneousEvent("fallback",{...s,errorMessage:a})},setPotentialErrorMessageForDefaultLayout(t){e.errorMessageForDefaultLayout=e.errorMessageForDefaultLayout||t},setColorTheme(t){e.colorTheme=t},setSpecialPromoOverlay(t){e.prefs.specialPromoOverlay=t},setCCXAssetPath(t){e.ccxAssetPath=t},setLearnAssetPath(t){e.learnAssetPath=t},setLoading(t){e.isLoading=t},setLastNGLWorkflowInProgress(t){e.lastNGLWorkflowInProgress=t}})),U=L.create();function M(e){return t=>e(U,t)}},RQdL:function(e,t,a){"use strict";a.d(t,"a",function(){return s}),a.d(t,"b",function(){return n});var s,o=a("xPCX");!function(e){e[e.NONE=0]="NONE",e[e.TRIAL=1]="TRIAL",e[e.RETAIL_SERIALIZED=2]="RETAIL_SERIALIZED",e[e.SUBSCRIPTION=3]="SUBSCRIPTION",e[e.VOLUME_SERIALIZED=4]="VOLUME_SERIALIZED",e[e.FRL=5]="FRL",e[e.UNKNOWN=6]="UNKNOWN"}(s||(s={}));const n=o.f.model("User",{RelationshipProfile:o.f.optional(o.f.array(o.f.model("RelationshipProfile",{appEntitlementStatus:o.f.optional(o.f.enumeration("Entitlement",["TRIAL","SUBSCRIPTION","PERPETUAL","EXPIRED","DENIED"]),"DENIED"),workflowInProgress:o.f.optional(o.f.enumeration("Workflow",["NONE","HYBRID","INAPP"]),"NONE"),activationType:o.f.optional(o.f.enumeration("Activation",["NAMED_USER","FRL_ONLINE","FRL_ISOLATED","FRL_LAN","LAB_NAMED_USER","FRL_CONNECTED"]),"NAMED_USER"),profileGenerationTimestamp:o.f.optional(o.f.number,-1),licenseExpiryTimestamp:o.f.optional(o.f.number,-1),billingStatus:o.f.optional(o.f.enumeration("BillingStatus",["NORMAL","BILL_FAILURE","AUTH_FAILURE","CC_EXPIRED","PAYMENT_INSTRUMENT_MISSING"]),"NORMAL"),usedForLegacyProfile:o.f.optional(o.f.boolean,!1)})),[]),UserProfile:o.f.optional(o.f.model("UserProfile",{firstName:o.f.optional(o.f.string,""),lastName:o.f.optional(o.f.string,""),accountType:o.f.optional(o.f.string,""),countryCode:o.f.optional(o.f.string,""),userId:o.f.optional(o.f.string,""),displayName:o.f.optional(o.f.string,"")}),{}),LegacyProfile:o.f.optional(o.f.model("LegacyProfile",{licenseType:o.f.optional(o.f.number,s.UNKNOWN)}),{}),isNGL:o.f.optional(o.f.boolean,!0)}).volatile(e=>({originalUserShown:!1,chicletHidden:!1})).views(e=>({get isUserAvailable(){return e.UserProfile.userId.length>0},get isEnterprise(){return"type1"!==e.UserProfile.accountType},get isFRL(){const t=e.RelationshipProfile.find(e=>e.usedForLegacyProfile);return!(!t||"NAMED_USER"===t.activationType||"LAB_NAMED_USER"===t.activationType)},get subscriptionStatus(){return e.LegacyProfile.licenseType===s.TRIAL?"trial":"paid"},get legacyProfile(){return e.RelationshipProfile.find(e=>e.usedForLegacyProfile)}})).actions(e=>({setChicletHidden(){e.chicletHidden=!0},setLicenseType(t){e.LegacyProfile.licenseType=t},setAppEntitlementStatus(t){const a=e.legacyProfile;a&&(a.appEntitlementStatus=t)},setBillingStatus(t){const a=e.legacyProfile;a&&(a.billingStatus=t)},markOriginalUserShown(){e.originalUserShown=!0}}))},dxPx:function(e,t,a){"use strict";var s=a("ZN6I"),o=a("y5v3"),n=a("he0X"),r=a("zUbE"),i=a("digs"),l=a("iH74");const c={default:{scope:["stock","learn","creative_cloud"],learn_creator_type:["adobe_support"],limit:30},PHXS:{scope:["stock","learn","lightroom","creative_cloud"],asset_type:["image","document","collection","dcx_composite","dcx_element"],learn_applicable_products:["Photoshop"]},ILST:{stock_image_type:["vector_ai_or_eps"],asset_type:["image","document","collection","dcx_composite","dcx_element"],learn_applicable_products:["Illustrator"]},AEFT:{scope:["learn","creative_cloud"],learn_applicable_products:["After Effects"]},PPRO:{scope:["learn","creative_cloud"],learn_applicable_products:["Adobe Premiere Pro"]},IDSN:{asset_type:["image","document","collection","dcx_composite","dcx_element"],learn_applicable_products:["InDesign"]},MUSE:{asset_type:["image","document","collection","dcx_composite","dcx_element"],learn_applicable_products:["Muse"]},DRWV:{asset_type:["image","document","collection","dcx_composite","dcx_element"],learn_applicable_products:["Dreamweaver"]},BROWSER:{asset_type:["image","document","collection","dcx_composite","dcx_element"],scope:["stock","learn","lightroom","creative_cloud"]}},f={getBody:e=>Object.assign({},{q:e,file_name_extension:o.a.SUPPORTED_FILETYPE[n.default.data.hostID],locale:n.default.data.language},c.default,c[n.default.data.hostID]),get url(){return s.a.stage?"https://adobesearch-stage.adobe.io/universal-search/v2/search":"https://adobesearch.adobe.io/universal-search/v2/search"},query:e=>{const t={url:f.url,method:"POST",json:!0,body:f.getBody(e),retries:3,headers:{"Content-Type":"application/vnd.adobe.search-request+json","x-api-key":"AdobeSearchService1","x-product":n.default.data.hostID+"/"+n.default.data.appVersion,"x-product-location":"CCXInAppWelcomeStart"}};return i.a.requestWithAccessToken(t,!0).then(e=>(e.body.requestGUID=e.headers["x-request-id"],Promise.resolve(e.body)))},getCCFiles:()=>{const e={url:f.url,method:"POST",json:!0,body:{limit:50,file_name_extension:o.a.SUPPORTED_FILETYPE[n.default.data.hostID],scope:["creative_cloud"]},retries:3,headers:{"Content-Type":"application/vnd.adobe.search-request+json","x-api-key":"AdobeSearchService1","x-product":n.default.data.hostID+"/"+n.default.data.appVersion,"x-product-location":"CCXInAppWelcomeStart"}};return i.a.requestWithAccessToken(e,!0).then(e=>e.body)},getDefaultRenditionUrl:()=>"PHXS"===n.default.data.hostID||"ILST"===n.default.data.hostID||"IDSN"===n.default.data.hostID?o.a.DEFAULT_THUMBNAIL_PS_AI_ID:o.a.DEFAULT_THUMBNAIL_OTHER,getRenditionImageBlobUrl:e=>f.getImageBlobURL(e).catch(()=>(l.a.logJSON("getRenditionImageBlobUrl: Failed to get a thumbnail image for ",e),f.getDefaultRenditionUrl())),loadCCPhotos:(e="",t=0,a=50)=>{const s={url:f.url,method:"POST",json:!0,body:{q:e,scope:["lightroom"],start_index:t,limit:a},headers:{"Content-Type":"application/vnd.adobe.search-request+json","x-api-key":"AdobeSearchService1","x-product":n.default.data.hostID+"/"+n.default.data.appVersion,"x-product-location":"CCXInAppWelcomeStart"}};return i.a.requestWithAccessToken(s).then(e=>Promise.resolve(e.body))},getImageBlobURL:e=>f.getImageBlob(e).then(e=>Promise.resolve(URL.createObjectURL(e))),getImageBlob:e=>{const t={method:"GET",url:e,responseType:"arraybuffer",withCredentials:!1,crossDomain:!0,headers:{"x-api-key":"PhotoshopInAppSearch"}};return i.a.requestWithAccessToken(t).then(e=>{const t=new Blob([e.body],{type:e.headers["content-type"]});return Promise.resolve(t)})},getCCFileMetadata:e=>{const t={method:"GET",url:e,headers:{"x-api-key":"AdobeSearchService1","x-product-location":"CCXInAppWelcomeStart"}};return i.a.requestWithAccessToken(t).then(e=>{const t=JSON.parse(e.body);let a=r.default.separatorsToSystem(t.path,n.default.data.hostID);return a=a.replace("files",n.default.ccfiles.rootFolder),t.path=a,Promise.resolve(t)})}},d={query:e=>new Promise((e,t)=>{mockTestData.mockFederer.query?e(mockTestData.mockFederer.query):e({})}),getRenditionImageBlobUrl:e=>new Promise((e,t)=>{mockTestData.mockFederer.getRenditionImageBlobUrl?e(mockTestData.mockFederer.getRenditionImageBlobUrl):e("")}),loadCCPhotos:(e="",t=0,a=50)=>new Promise((e,t)=>{e({})}),getImageBlobURL:e=>new Promise((e,t)=>{mockTestData.mockFederer.getImageBlobURL?e(mockTestData.mockFederer.getImageBlobURL):e("")}),getImageBlob:e=>{},getCCFileMetadata:e=>new Promise((e,t)=>{mockTestData.mockFederer.getCCFileMetadata?e(mockTestData.mockFederer.getCCFileMetadata):e([])})};t.a=class{static getInstance(){return this._instance||(window.localStorage.getItem("mockTestDataPath")?(l.a.toConsole("Mocking Federer"),this._instance=d):this._instance=f),this._instance}}.getInstance()},hBUl:function(e,t,a){"use strict";a.d(t,"a",function(){return v});var s=a("iH74"),o=a("bq/Q"),n=a("zUbE"),r=a("oj1z"),i=a("Ojs7"),l=a("JdQH"),c=a("JU0K"),f=a("iTuP");const d="sophia.data:",u="learn.data:",p="ccxprocess.FirstMileRequest",h="ccxprocess.FirstMileResponse",m="ccxprocess.FirstMileProgress",g="ccxprocess.TutorialRequest",b="ccxprocess.TutorialResponse",S=4e3,E=4e3,I=4e3,y="ccxprocess.TutorialUsageMarker",P="ccxprocess.FirstMileUsageMarker",D="ccxprocess.StartSettingsGetRequest",T="ccxprocess.StartSettingsGetResponse";let C;function R(e,t){let a=null;if(!e)return a;const o=window.cep.fs.readFile(e);if(0===o.err)try{a=JSON.parse(o.data)}catch(o){s.a.toConsole(`${t} Failed to read JSON file with path [${e}], error=${JSON.stringify(o)}`),a=null}else 3===o.err?s.a.toConsole(`${t} File does not exist [${e}]`):s.a.toConsole(`${t} Failed to read JSON file with path [${e}], error code=${o.err}`);return a}var _=0;class v{generateBasePayload(e={requestId:r.a.generateGUID()}){return{...{params:{productCode:l.c.hostData.hostID,productVersion:l.c.hostData.appVersion,productLanguage:l.c.hostData.language,countryCode:l.c.user.UserProfile.countryCode,ccxVersion:i.default.getExtensionVersion(!0).version,subscriptionStatus:l.c.user.subscriptionStatus},analytics:{"event.context_guid":l.c.hostData.radarSessionGUID},version:1},...e}}acquireData(e,t,a=!1){let i,l;_++,o.a.set(o.a.TIMERS.SOPHIA_DATA+_);const u=new Date,g=function(t,a){clearTimeout(i),c.a.removeMessageListener(c.b.TYPE_PREFIX+m,I.handler,null),c.a.removeMessageListener(c.b.TYPE_PREFIX+h,E.handler,null),t?(s.a.toConsole(`${d} ${t}`),f.a.logErrorEvent("sophia",{error:{type:"server",desc:t.toString()}})):o.a.measure(o.a.TIMERS.SOPHIA_DATA+_);const n=Date.now()-u.getTime();s.a.toConsole(`${d} It costs ${n} ms to get response from CCXProcess.`),e(t,a)};if(!window.__adobe_cep__)return g("CCX Process is not installed.",{_isGeneratedDefaultData:!0,surfaces:{},expirationDTS:"2018-01-01T12:00:00.000+00:00",analyticsParams:{responseGUID:"ffffffff-ffff-ffff-ffff-ffffffffffff",requestId:"ffffffff-ffff-ffff-ffff-ffffffffffff"}});const b=r.a.generateGUID(),E={},I={};E.handler=function(e){const t=c.a.getPayload(e);let a,o;try{o=JSON.parse(t),s.a.toConsole(`${d} Receiving ${h} [${o.requestId}], path is ${o.path}, parsedData: ${JSON.stringify(o)}`)}catch(e){return s.a.toConsole(`${d} Invalid JSON string: ${t}`),void f.a.logErrorEvent("sophia",{error:{type:"server",desc:e.toString()}})}if(o&&o.requestId===b){let e;if(o.path){let e=o.path.lastIndexOf("/");-1===e&&(e=o.path.lastIndexOf("\\"));const t=o.path.substring(0,e);(a=R(o.path,d)).ccxAssetPath=`file://${t.replace(/\\/gi,"/")}`,a.src=o.path,s.a.toConsole(`${d} ${JSON.stringify(a)}`)}else e=`path is missing, parsedData: ${JSON.stringify(o)}`,a={_isGeneratedDefaultData:!0,surfaces:{},expirationDTS:"2018-01-01T12:00:00.000+00:00",analyticsParams:{responseGUID:"ffffffff-ffff-ffff-ffff-ffffffffffff",requestId:"ffffffff-ffff-ffff-ffff-ffffffffffff"}};g(e,a||{_isGeneratedDefaultData:!0,surfaces:{},expirationDTS:"2018-01-01T12:00:00.000+00:00",analyticsParams:{responseGUID:"ffffffff-ffff-ffff-ffff-ffffffffffff",requestId:"ffffffff-ffff-ffff-ffff-ffffffffffff"}})}},I.handler=function(e){const t=c.a.getPayload(e);let a,o;try{o=JSON.parse(t),s.a.toConsole(`${d} Receiving ${m} [${o.requestId}], path is ${o.path}, parsedData: ${JSON.stringify(o)}`)}catch(e){return s.a.toConsole(`${d} Invalid JSON string: ${t}`),void f.a.logErrorEvent("sophia",{error:{type:"server",desc:e.toString()}})}if(o&&o.requestId===b){if(!o.path)return void(l=`path is missing, parsedData: ${JSON.stringify(o)}`);if(o.path&&o.complete&&o.complete.length>0){for(let e of o.complete)if(e.toLowerCase().includes("home")){let e=o.path.lastIndexOf("/");-1===e&&(e=o.path.lastIndexOf("\\"));const t=o.path.substring(0,e);(a=R(o.path,d)).ccxAssetPath=`file://${t.replace(/\\/gi,"/")}`,a.src=o.path,s.a.toConsole(`${d} ${JSON.stringify(a)}`),g(null,a||{_isGeneratedDefaultData:!0,surfaces:{},expirationDTS:"2018-01-01T12:00:00.000+00:00",analyticsParams:{responseGUID:"ffffffff-ffff-ffff-ffff-ffffffffffff",requestId:"ffffffff-ffff-ffff-ffff-ffffffffffff"}})}}else l=o.path&&o.started&&o.started.length>0?"Downloading on the fly. Waiting for data completion.":"Download not yet started."}},c.a.addMessageListener(c.b.TYPE_PREFIX+h,E.handler,null),c.a.addMessageListener(c.b.TYPE_PREFIX+m,I.handler,null);let y=this.generateBasePayload({urgent:!0,requestId:b});y=JSON.stringify(y);const P=new c.b(c.b.TYPE_PREFIX+p,void 0,void 0);P.setPayload(y),c.a.dispatchMessage(P),s.a.toConsole(`${d} Sending ${p} [${b}] with payload: ${y}`),i=setTimeout(()=>{if(!n.default.isCCXProcessInstalled())return g("CCX Process is not installed.",{_isGeneratedDefaultData:!0,surfaces:{},expirationDTS:"2018-01-01T12:00:00.000+00:00",analyticsParams:{responseGUID:"ffffffff-ffff-ffff-ffff-ffffffffffff",requestId:"ffffffff-ffff-ffff-ffff-ffffffffffff"}});n.default.launchCCXProcess(),g(l||"Sophia data timeout",{_isGeneratedDefaultData:!0,surfaces:{},expirationDTS:"2018-01-01T12:00:00.000+00:00",analyticsParams:{responseGUID:"ffffffff-ffff-ffff-ffff-ffffffffffff",requestId:"ffffffff-ffff-ffff-ffff-ffffffffffff"}})},S)}acquireLearnData(e,t){o.a.set(o.a.TIMERS.LEARN_DATA);const a=new Date,n=function(t,n){t||!n?(s.a.toConsole(`${u} ${t}`),f.a.logErrorEvent("learn",{error:{type:"server",desc:t?t.toString():`Missing Learn Data: ${JSON.stringify(n)}`}})):o.a.measure(o.a.TIMERS.LEARN_DATA);const r=Date.now()-a.getTime();s.a.toConsole(`${u} Fetch Learn data in ${r}ms`),e(t,n)};if(!window.__adobe_cep__)return n("CCX Process is not installed.",null);const i=r.a.generateGUID(),l={handler:function(e){const t=c.a.getPayload(e);let a,o;try{o=JSON.parse(t),s.a.toConsole(`${u} Got ${b}[${o.requestId}@${o.path}`)}catch(e){return void s.a.toConsole(`${u} Invalid JSON string: ${t}`)}if(o&&o.requestId===i){let e;if(clearTimeout(C),o.path){let e=o.path.lastIndexOf("/");-1===e&&(e=o.path.lastIndexOf("\\"));const t=o.path.substring(0,e);(a=R(o.path,u)).assetPath=`file://${t.replace(/\\/gi,"/")}`,a.src=o.path,s.a.toConsole(`${u} ${JSON.stringify(a)}`)}else e=`path is missing, parsedData: ${JSON.stringify(o)}`,a=null;c.a.removeMessageListener(c.b.TYPE_PREFIX+b,l.handler,null),n(e,a)}}};c.a.addMessageListener(c.b.TYPE_PREFIX+b,l.handler,null);let d=this.generateBasePayload({requestId:i});d=JSON.stringify(d);const p=new c.b(c.b.TYPE_PREFIX+g,void 0,void 0);p.setPayload(d),c.a.dispatchMessage(p),s.a.toConsole(`${u} Sending ${g}[${i}] with ${d}`),C=setTimeout(()=>{c.a.removeMessageListener(c.b.TYPE_PREFIX+b,l.handler,null),n("Learn data timeout",null)},E)}markUsage(){if(!i.default.available)return;let e,t=this.generateBasePayload({updateLastUseTime:!0});switch(t=JSON.stringify(t),l.c.prefs.currentRoute){case"home":e=P;break;case"learn":e=y}if(e){const a=new c.b(c.b.TYPE_PREFIX+e,void 0,void 0);a.setPayload(t),c.a.dispatchMessage(a)}}acquireSettings(e,t){if(!i.default.available)return;let a=null;const s=(t,s)=>{clearTimeout(o),c.a.removeMessageListener(c.b.TYPE_PREFIX+T,a),e(t,s)};let o=null;const n=r.a.generateGUID(),l=new c.b(c.b.TYPE_PREFIX+D);l.setPayload(JSON.stringify({requestId:n})),a=e=>{const t=JSON.parse(c.a.getPayload(e));t.requestId===n&&s(null,t.settings)},c.a.addMessageListener(c.b.TYPE_PREFIX+T,a,null),o=setTimeout(()=>s(new Error("CCXP timed out")),I),c.a.dispatchMessage(l)}}},he0X:function(e,t,a){"use strict";a.r(t);var s=a("Ojs7"),o=a("iH74");function n(e,t){switch(e){case"userTrackingEnabled":case"fnftEnabled":"string"==typeof t&&(t="true"===t||"1"===t);break;case"shortcut":t=t.replace(/Cmd\+/,"⌘")}return t}var r={readLocalJSONFile:function(e){let t=null;if(s.default.available&&e){const a=window.cep.fs.readFile(e);if(0===a.err)try{t=JSON.parse(a.data)}catch(e){t=null,o.a.toConsole(e)}else 3===a.err?o.a.toConsole("Attempt to read JSON file failed, file does not exist ["+e+"]"):o.a.toConsole("Attempt to read JSON file failed with path ["+e+"], error code="+a.err)}return t},fnftDataReceiver:function(e,t){return t=n(e,t)},startDataReceiver:function(e,t){switch(e){case"thumbnailViewEnabled":case"listViewEnabled":"string"==typeof t&&(t="true"===t||"1"===t);break;case"size":isNaN(t)||(t=parseInt(t,10));break;case"thumb":t&&(t="data:image/jpeg;base64,"===t?"":t.replace(/\n/g,""));break;case"icon":if(t.indexOf("SP_Preset")<0&&t.indexOf("SP_QuickStart")<0)switch(t){case"aep":case"pr_proj_primary":case"pr_convert_premiere_clip":t="CCX_Start_DefaultThumb_Pr_Ae";break;case"ai":case"psd":case"id":case"id_library":case"id_book":t="CCX_Start_DefaultThumb_Ps_Ai_Id";break;default:t="CCX_Start_DefaultThumb_other"}break;case"dontShowAgain":"string"==typeof t&&(t="true"===t||"1"===t);break;case"secondsLeftInTrial":case"appStartClockTime":"string"==typeof t&&(t=parseInt(t,10));break;case"lastOpened":t=isNaN(t)?new Date(t).getTime():parseInt(t,10);break;default:t=n(e,t)}return t}},i=a("bq/Q"),l=a("hBUl"),c=a("digs"),f=a("y5v3"),d=a("SUPi"),u=a.n(d);class p{acquireData(e){if(i.a.set(i.a.TIMERS.SOPHIA_DATA),window.localStorage.getItem("mockTestDataPath")){const t=mockTestData.mockSophia;t.ccxAssetPath="",this._formatData(t),e(null,t)}else{const t=-1!==window.location.search.indexOf("experimentMode")?"sophia/experiment.json":"sophia/data.json";c.a.readPlaceholderJSONData(t).then(t=>{i.a.measure(i.a.TIMERS.SOPHIA_DATA),this._formatData(t),e(null,t)}).catch(t=>{i.a.measure(i.a.TIMERS.SOPHIA_DATA),e(null,{cards:[],ccxAssetPath:"",cardControl:[],expirationDTS:"2018-01-01T12:00:00.000+00:00",analyticsParams:{responseGUID:"ffffffff-ffff-ffff-ffff-ffffffffffff",requestId:"ffffffff-ffff-ffff-ffff-ffffffffffff"}})})}}acquireLearnData(e,t){c.a.readPlaceholderJSONData("sophia/learn.json").then(t=>{e(null,t)})}acquireSettings(e,t){e(null,{})}_formatData(e){const t=e&&e.cardControl?e.cardControl.length:0,a={};for(let s=0;s<t;++s){const t=e.cardControl[s];let o="";a[t.modeID]=t,t.cardOrder.forEach(a=>{t.modeID===f.a.SOPHIA_CONTAINER.TRIAL_CARD&&(e.cards[a].backgroundFillColor=parseInt(e.cards[a].backgroundFillColor,16).toString(16)),o+=""!==o?","+e.cards[a].cardID:e.cards[a].cardID}),t.containerAnalyticsParams&&t.containerAnalyticsParams.forEach(a=>{a.requestGUID=e.analyticsParams.requestId||null,a.responseGUID=e.analyticsParams.responseGUID||null,a.surfaceId=a.surfaceId||t.modeID,a.experienceId=u()(o)})}e.cardControl=a}}var h=a("ZN6I"),m=a("oj1z"),g=a("yXNv"),b=a("zUbE"),S=a("dxPx"),E=a("cneo"),I=a("JU0K"),y=a("JdQH"),P=function(e,t,a,s){var o,n=arguments.length,r=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,a):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,s);else for(var i=e.length-1;i>=0;i--)(o=e[i])&&(r=(n<3?o(r):n>3?o(t,a,r):o(t,a))||r);return n>3&&r&&Object.defineProperty(t,a,r),r},D=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};const T="00000000-0000-0000-0000-000000000000",C="files",R="accc.files.getCloudsListRequest",_="adbproduct.files.getCloudsListResponse",v="sync.in.request.job.getpath",A="sync.out.response.job.getpath",O="sync.in.request.observer.create",N="sync.out.notify.job.status",w='<?xml version="1.0" encoding="utf-8"?><message>',F="</message>",L='<?xml version="1.0" encoding="utf-8"?><request>',U="</request>",M={psd:"Photoshop",psb:"Photoshop",ai:"Illustrator",ait:"Illustrator Template",pdf:"PDF",indd:"InDesign Document",indt:"InDesign Template",indl:"InDesign Asset Library",indb:"InDesign Book",prproj:"Premiere Pro Project",muse:"Muse",png:"PNG",jpeg:"JPEG",jpg:"JPEG",tiff:"TIFF",tif:"TIFF",gif:"GIF",bmp:"BMP",eps:"Encapsulated PostScript"},x=["indl","indb","idml"],k={PHXS:!0,ILST:!0,IDSN:!0};function V(e){let t="";return Object.keys(e).forEach(a=>{t+="<"+a+">"+e[a]+"</"+a+">"}),w+t+F}class G{constructor(){this.syncing=!1,this.online=!0,this._updateFn=null,this._syncInProgress=!1,this._haveSyncedAtLeastOnce=!1}configure(e){this._updateFn=e;const t=y.c.user.UserProfile.countryCode,a=g.a.regionFromCountryCode(t&&""!==t?t:"US");this._pathRequestUrlPrefix="https://cc-"+a+"1-"+h.a.environment+".adobesc.com/api/v1/collections/",this._startCCFilesNotification()}_startCCFilesNotification(){if(!s.default.available)return;const e=V({requestid:m.a.generateGUID(),type:O}),t=new I.b(I.b.TYPE_PREFIX+O,void 0,void 0);t.setPayload(e),I.a.dispatchMessage(t),I.a.addMessageListener(I.b.TYPE_PREFIX+N,this._handleCCFilesSync.bind(this),void 0)}_stopCCFilesNotification(){I.a&&I.a.removeMessageListener(I.b.TYPE_PREFIX+N,this._handleCCFilesSync,void 0)}_handleCCFilesSync(e){const t=I.a.getPayload(e),a=(new DOMParser).parseFromString(t,"text/xml").getElementsByTagName("minorstate")[0].childNodes[0].nodeValue;this._syncInProgress||"complete"!==a||(o.a.toConsole("ccfiles.sync: update request from CoreSync"),this.sync())}_getCCFilesRootFolder(){return new Promise((e,t)=>{I.a.addMessageListener(I.b.TYPE_PREFIX+_,function a(s){try{I.a.removeMessageListener(I.b.TYPE_PREFIX+_,a,void 0);const o=I.a.getPayload(s),n=(new DOMParser).parseFromString(o,"text/xml").getElementsByTagName("cloud"),r=n.length||0;if(r){let a="",s=!0;for(let e=0;e<r;++e){const t=n.item(e).getElementsByTagName("id")[0].childNodes[0].nodeValue;s="on"===n.item(e).getElementsByTagName("syncPref")[0].childNodes[0].nodeValue,t===T&&(a=window.unescape(n.item(e).getElementsByTagName("folderLocation")[0].childNodes[0].nodeValue))}const o=ne.data.hostID;if(b.default.isWindowsOS()&&("PHXS"===o||"PPRO"===o||"AEFT"===o)){let e="";"PHXS"===o?(e=a.split("\\").join("/"),a="file://"+e):"PPRO"!==o&&"AEFT"!==o||(e=a.split("\\").join("\\\\"),a=e)}""!==a?e(a):t(new Error(s?"Unable to fetch root folder":"CC-Files sync is disabled"))}else t(new Error("Unable to fetch root folder, no clouds"))}catch(e){t(e)}}.bind(this),void 0);let a="";const s={"request-id":m.a.generateGUID()};Object.keys(s).forEach(e=>{a+="<"+e+">"+s[e]+"</"+e+">"});const o=new I.b(I.b.TYPE_PREFIX+R,void 0,void 0);o.setPayload(L+a+U),I.a.dispatchMessage(o)})}sync(){this._syncInProgress||(this._syncInProgress=!0,this._haveSyncedAtLeastOnce||(this.syncing=!0),this._getCCFilesRootFolder().then(e=>(this.rootFolder=e,S.a.getCCFiles().then(e=>{const t=e.result_sets[0],a=[];return t.items.forEach(e=>{if(!e._links.rendition)return;const t={action:"ccfiles",identifier:e.asset_id.replace(/^.*:/,""),name:e.asset_name,lastOpened:e.modify_date,size:e.size,renditionUrl:e._links.rendition[0].href.replace("{size}",f.a.THUMBNAIL_SIZE).replace("{format}",f.a.THUMBNAIL_FORMAT)};isNaN(e.modify_date)&&(t.lastOpened=new Date(e.modify_date).getTime()),a.push(t)}),a}))).then(e=>(function(e,t,a){return new Promise((o,n)=>{let r=0;const i=[],l={};a.length||o(a),I.a.addMessageListener(I.b.TYPE_PREFIX+A,function e(c){try{const f=I.a.getPayload(c),d=(new DOMParser).parseFromString(f,"text/xml"),u=d.getElementsByTagName("requestid")[0].childNodes[0].nodeValue;u||n(new Error("Bad CC_FILES_PATH_RESPONSE"));const p=l[u],h=a[p];if(h||n(new Error("Bad CC_FILES_PATH_RESPONSE")),d.getElementsByTagName("path").length&&-1===d.getElementsByTagName("path")[0].childNodes[0].nodeValue.indexOf("/archive")){const e=d.getElementsByTagName("path")[0].childNodes[0].nodeValue;if("signedout"===d.getElementsByTagName("status")[0].childNodes[0].nodeValue)return void n(new Error("Authorization error: signed out"));!b.default.isWindowsOS()||"PPRO"!==ne.data.hostID&&"AEFT"!==ne.data.hostID?b.default.isWindowsOS()&&"ILST"===ne.data.hostID?h.identifier=t+e.split("/").join("\\"):h.identifier=t+e:h.identifier=t+e.split("/").join("\\\\");const a=h.identifier.split(".").pop().toLowerCase();if(h.kind=M[a]?M[a]:a,e.split("/").pop()&&(h.name=e.split("/").pop(),h.tip=t+(b.default.isWindowsOS()?e.split("/").join("\\"):e)),h.availableLocally=s.default.fileExists(h.identifier),k[ne.data.hostID]){const e=h.name.split(".").pop();let t;!t&&x.indexOf(e)>-1&&(t=S.a.getDefaultRenditionUrl()),h.thumb=t||S.a.getRenditionImageBlobUrl(h.renditionUrl)}else h.thumb=S.a.getDefaultRenditionUrl()}else i.push(p);if(++r>=a.length){I.a.removeMessageListener(I.b.TYPE_PREFIX+A,e,void 0);for(let e=i.length-1;e>=0;e--)a.splice(i[e],1);o(a)}}catch(e){n(e)}},void 0);const c=y.c.user.UserProfile.userId;for(let t=0;t<a.length;t+=1){const s=a[t],o=m.a.generateGUID();l[o]=t;const n=V({requestid:o,userid:c,cloudid:T,job:C,type:v,url:e+s.identifier}),r=new I.b(I.b.TYPE_PREFIX+v,void 0,void 0);r.setPayload(n),I.a.dispatchMessage(r)}})})(this._pathRequestUrlPrefix,this.rootFolder,e)).then(e=>{this.online=!0,this._updateFn&&this._updateFn(e),this.syncing=!1,this._syncInProgress=!1,this._haveSyncedAtLeastOnce=!0}).catch(e=>{this.online=!1,o.a.logJSON("ccfiles sync error: ",e.message),this._updateFn&&this._updateFn([]),this.syncing=!1,this._syncInProgress=!1}))}}P([E.u,D("design:type",Object)],G.prototype,"syncing",void 0),P([E.u,D("design:type",Object)],G.prototype,"rootFolder",void 0),P([E.u,D("design:type",Object)],G.prototype,"online",void 0);var q=function(e,t,a,s){var o,n=arguments.length,r=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,a):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,s);else for(var i=e.length-1;i>=0;i--)(o=e[i])&&(r=(n<3?o(r):n>3?o(t,a,r):o(t,a))||r);return n>3&&r&&Object.defineProperty(t,a,r),r},j=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};class X{constructor(){this.syncing=!1,this.rootFolder=null,this.online=!0}configure(e){o.a.toConsole("configure was called with updateFn: "+e),this._configuration={updateFn:e},o.a.logJSON("ccfiles.configuration:",this._configuration)}sync(){o.a.toConsole("sync was called");new Promise((e,t)=>{mockTestData.mockCCFiles?e(mockTestData.mockCCFiles.cards):e([])}).then(e=>{this._configuration.updateFn&&this._configuration.updateFn(e)})}}q([E.u,j("design:type",Object)],X.prototype,"syncing",void 0),q([E.u,j("design:type",Object)],X.prototype,"rootFolder",void 0),q([E.u,j("design:type",Object)],X.prototype,"online",void 0);var J,B,H,$=a("zb5W"),z=a("sKM9"),W=function(e,t,a,s){var o,n=arguments.length,r=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,a):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,s);else for(var i=e.length-1;i>=0;i--)(o=e[i])&&(r=(n<3?o(r):n>3?o(t,a,r):o(t,a))||r);return n>3&&r&&Object.defineProperty(t,a,r),r},Y=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};let K;K=p;class Z{get showSearch(){return!0}initCCFiles(){this.ccfiles=window.localStorage.getItem("mockTestDataPath")?new X:new G}goBackToFile(){s.default.closeExtensionOnStatus("true")}addVisibilityListener(){}getHostAdapter(e){return e.usingSimData?new p:e.usingDirectData?new K:new l.a}getSophiaDataRaw(e,t=!1){return new Promise((t,a)=>{this.getHostAdapter(e).acquireData((e,a,s)=>{e&&this.mainStore.setPotentialErrorMessageForDefaultLayout(e),a&&a.surfaces&&a.surfaces[f.a.SOPHIA_SURFACEID.HOME]?($.a.setGlobalItem("sophiaParamsV2",this._sophiaCacheParams),$.a.setGlobalItem("sophiaDataV2",a),this.mainStore.setCCXAssetPath(a.ccxAssetPath)):($.a.setGlobalItem("sophiaParamsV2",void 0),$.a.setGlobalItem("sophiaDataV2",void 0)),t(a)},e)})}getSettings(e){return new Promise((t,a)=>{this.getHostAdapter(e).acquireSettings((e,s)=>{s?t(s):a(e)},e)})}getLearnData(e){return new Promise((t,a)=>{this.getHostAdapter(e).acquireLearnData((e,s)=>{s?(this.mainStore.setLearnAssetPath(s.assetPath),t(s)):a(e)},e)})}get _sophiaCacheParams(){return JSON.stringify({productLanguage:this.data.language,countryCode:this.mainStore.user.UserProfile.countryCode,subscriptionStatus:this.mainStore.user.subscriptionStatus,ccxVersion:s.default.getExtensionVersion(!0).version,userId:this.mainStore.user.UserProfile.userId,learnSplit:!0})}async getSophiaData(e,t=!1,a="",s=!1){if(!s&&!t&&$.a.getGlobalItem("sophiaParamsV2")===this._sophiaCacheParams){const t=$.a.getGlobalItem("sophiaDataV2")||{};if(t&&t.surfaces&&t.surfaces[f.a.SOPHIA_SURFACEID.HOME]||new Date(t.expirationDTS)<new Date){let s=await this.getSophiaDataRaw(Object.assign({activeSrc:a},e));return s.surfaces&&!s.surfaces[f.a.SOPHIA_SURFACEID.HOME]&&t.surfaces&&t.surfaces[f.a.SOPHIA_SURFACEID.HOME]?(this.mainStore.setCCXAssetPath(t.ccxAssetPath),t):(this.mainStore.setCCXAssetPath(s.ccxAssetPath),s)}return this.mainStore.setCCXAssetPath(t.ccxAssetPath),t.isCached=!0,t}return await this.getSophiaDataRaw(Object.assign({activeSrc:a},e),s)}getData(){return Promise.reject("not implemented")}openMRU(e,t){}defaultNewDocument(){}releaseFileReference(e){}openCustomItem(e){}openPlaceDialog(){this.openDocument.apply(this,arguments)}openCCFilesDocument(e,t){}openDVATeamProject(){}defaultNewDVATeamProject(){}openRushProject(){}openDocument(e,t=!1,a=(e=>{})){}openPathWithXMP(e,t,a,s=(e=>{})){}handleStatusChange(e){return Promise.reject("not implemented")}checkForSurface(e){return!!this.sophiaStore&&this.sophiaStore.checkForSurface(e)}getSophiaCardAnalytics(e,t){return void 0===t?{}:this.sophiaStore&&this.sophiaStore.checkForSurface(e)?this.sophiaStore.getContainerAnalyticsParams(e,t):{}}commonStatusChangeHandler(e,t){switch(e){case"updateShortcutKey":{const e=this.data.buttonInfo[t.buttonID]||null;e&&(e.shortcut=t.shortcut.replace(/Cmd\+/,"⌘"));break}case"updateFNFTPref":{let e=t||!1;"string"==typeof e&&(e="true"===e||"1"===e),this.data.setFnftEnabled(e);break}}}updateMRUFileSize(e){e&&e.forEach(e=>{isNaN(e.size)||(e.size=m.a.createFileSizeString(e.size))})}triggerIPCAction(e,t){s.default.sendEvent(e,t)}}Z._mruCallbackPending=!1,W([E.u,Y("design:type","function"==typeof(J=void 0!==y.IHostDataStore&&y.IHostDataStore)?J:Object)],Z.prototype,"data",void 0),W([E.u,Y("design:type","function"==typeof(B=void 0!==y.IMainStore&&y.IMainStore)?B:Object)],Z.prototype,"mainStore",void 0),W([E.u,Y("design:type","function"==typeof(H=void 0!==z.ISophiaStore&&z.ISophiaStore)?H:Object)],Z.prototype,"sophiaStore",void 0),W([E.u,Y("design:type",Object)],Z.prototype,"ccfiles",void 0);class Q extends Z{getData(e="PHXS"){return new Promise((t,a)=>{i.a.set(i.a.TIMERS.APPDATA);const s=e.toLowerCase()+"-host.json";c.a.readPlaceholderJSONData("appdata/"+s,r.startDataReceiver).then(e=>{if(i.a.measure(i.a.TIMERS.APPDATA),e.platform=b.default.isWindowsOS()?"win":"mac",e.tabs&&e.tabs.constructor===Array){const t=e.tabs.length;if(t){const a={};for(let s=0;s<t;++s){const t=e.tabs[s];"recentlib"!==t.type&&(a[t.type]=t)}a.ccfiles||(a.ccfiles={type:"ccfiles",label:"listview_ccfiles_tab_label",listViewEnabled:!1,thumbnailViewEnabled:!0,list:[]}),e.tabs=a}}if(window.location.search&&-1!==window.location.search.indexOf("recents=")){const t=window.location.search.match(/recents=(\d+)/)[1];e.tabs.recentfile.list=e.tabs.recentfile.list.splice(0,t)}t(e)}).catch(e=>{i.a.measure(i.a.TIMERS.APPDATA),o.a.toConsole(e),a(e)})})}handleStatusChange(e,t="PHXS"){return new Promise((a,s)=>{if("updateMRUList"===e.statusEvent){const e=t.toLowerCase()+"-host-updated.json";c.a.readPlaceholderJSONData("appdata/"+e,r.startDataReceiver).then(e=>{if(e.tabs&&e.tabs.constructor===Array){const t=e.tabs.length;if(t){const a={};for(let s=0;s<t;++s){const t=e.tabs[s];"recentlib"!==t.type&&(a[t.type]=t)}a.ccfiles||(a.ccfiles={type:"ccfiles",label:"listview_ccfiles_tab_label",listViewEnabled:!1,thumbnailViewEnabled:!0,list:[]}),e.tabs=a}}a(e.tabs.recentfile.list)}).catch(e=>{o.a.toConsole(e),s(e)})}})}}var ee=a("qVAS"),te=a("iTuP");class ae extends Z{getData(){return new Promise((e,t)=>{"ILST"===s.default.applicationID?s.default.evalExtendScript("createJSON().call(this);",e):e()}).then(()=>new Promise((e,t)=>{i.a.set(i.a.TIMERS.APPDATA),s.default.evalExtendScript('CCXHostBridge.getUserJSONData("'+s.default.applicationID+'")',a=>{try{i.a.measure(i.a.TIMERS.APPDATA);const s=JSON.parse(a,r.startDataReceiver);s.tabs.splice(1,0,{type:"ccfiles",label:"listview_ccfiles_tab_label",listViewEnabled:!0,thumbnailViewEnabled:"AEFT"!==s.hostID&&"PPRO"!==s.hostID&&"MUSE"!==s.hostID&&"DRWV"!==s.hostID,list:[]});const o=s.tabs.length;if(o){const e={};for(let t=0;t<o;++t){const a=s.tabs[t];a.list||(a.list=[]),"recentlib"!==a.type&&(e[a.type]=a)}s.tabs=e}s.startVersion=window.appVersionNumber,$.a.setGlobalItem("hostdata",s),e(s)}catch(e){t(e)}})}))}defaultNewDocument(){switch(this.data.hostID){case"ILST":case"IDSN":if(this.data.fnftEnabled){const e=(new Date).getTime();ee.a.logEvent("fnftCategory","performance","fnftStart"),o.a.toConsole("Cmd-N loading starts at: "+e),s.default.sendEvent(f.a.IPCEVENT.FNFTSTARTTIME,e.toString())}s.default.sendEvent(f.a.IPCEVENT.EXECUTEMENUCMD,f.a.MENUCMD_ACTION.NEW_DOCUMENT);break;case"AEFT":s.default.evalExtendScript("AEFTBridge.createDefaultDocument()",s.default.closeExtensionOnStatus);break;default:s.default.sendEvent(f.a.IPCEVENT.EXECUTEMENUCMD,f.a.MENUCMD_ACTION.NEW_DOCUMENT)}}openDocument(e,t=!1,a=(e=>{})){e||("AEFT"!==this.data.hostID?s.default.sendEvent(f.a.IPCEVENT.EXECUTEMENUCMD,f.a.MENUCMD_ACTION.OPEN_FILE_DIALOG):s.default.evalExtendScript("AEFTBridge.openDocumentWithUI()",s.default.closeExtensionOnStatus))}openMRU(e,t){const a=e.identifier;s.default.sendEvent(f.a.IPCEVENT.OPENRECENTFILE,a)}openCustomItem(e){s.default.sendEvent(f.a.IPCEVENT.EXECUTEMENUCMD,e.identifier)}defaultNewDVATeamProject(){te.a.logClickedEvent("new-team-project"),s.default.sendEvent(f.a.IPCEVENT.EXECUTEMENUCMD,f.a.MENUCMD_ACTION.NEW_TEAMPROJECT)}openDVATeamProject(){te.a.logClickedEvent("open-team-project"),s.default.sendEvent(f.a.IPCEVENT.EXECUTEMENUCMD,f.a.MENUCMD_ACTION.OPEN_TEAMPROJECT)}openRushProject(){te.a.logClickedEvent("open-rush-project"),s.default.sendEvent(f.a.IPCEVENT.EXECUTEMENUCMD,f.a.MENUCMD_ACTION.OPEN_RUSHPROJECT)}updateVisibilty(e){s.default.evalExtendScript("app.documents.length > 0",e=>{s.default.evalExtendScript("app.homeScreenVisible",t=>this.data.updateVisibility(JSON.parse(t),JSON.parse(e)))})}addVisibilityListener(){s.default.addEventListener("com.adobe.ccx.start.homeScreenVisibilityChanged",this.updateVisibilty.bind(this))}openCCFilesDocument(e,t){const a=e.identifier;let n=JSON.stringify({path:[a]});b.default.isWindowsOS()&&"PPRO"===this.data.hostID&&(n='{"path":["'+a+'"]}'),o.a.toConsole("CC-Files :: opening "+a),"AEFT"!==this.data.hostID?this.openDroppedFiles(n):s.default.evalExtendScript('AEFTBridge.openDocumentWithPath("'+a+'")',s.default.closeExtensionOnStatus)}openDroppedFiles(e){e&&s.default.sendEvent(f.a.IPCEVENT.OPENDROPFILES,e)}openPlaceDialog(){"AEFT"===this.data.hostID?s.default.evalExtendScript("AEFTBridge.placeDocument(null)",e=>{"true"===e&&window.__adobe_cep__.closeExtension()}):this.openDocument.apply(this,arguments)}handleStatusChange(e){let t;return new Promise((a,s)=>{try{switch((t="string"==typeof e.data?JSON.parse(e.data):e.data).statusEvent){case"updateMRUList":if(t.statusData){let e=[];$.a.getUserItem(f.a.LOCALSTORE_KEYS.MAIN_PREFS);try{e=JSON.parse(JSON.stringify(t.statusData),r.startDataReceiver)}catch(e){s(e)}'[""]'===JSON.stringify(e)&&(e=[]),o.a.logJSON("mru.data:",e);const n=$.a.getGlobalItem("hostdata");n&&(n.tabs.recentfile.list=e,$.a.setGlobalItem("hostdata",n)),a(e)}break;default:this.commonStatusChangeHandler(t.statusEvent,t.statusData),a()}}catch(e){s(e)}})}}const se=1936028772;class oe extends Z{constructor(){super(),window.addLateLoadCallBack(()=>{s.default.sendEvent("com.adobe.PhotoshopLoseFocus",null),s.default.sendEvent("com.adobe.PhotoshopRegisterEvent",se.toString()),s.default.addEventListener("com.adobe.PhotoshopJSONCallback"+s.default.extensionID,this.handleStatusChange.bind(this))})}_getDefaultTabs(e){return{recentfile:{type:"recentfile",label:"listview_recentfiles_tab_label",listViewEnabled:!0,thumbnailViewEnabled:!0,list:e},ccfiles:{type:"ccfiles",label:"listview_ccfiles_tab_label",listViewEnabled:!0,thumbnailViewEnabled:!0,list:[]},ccphotos:{type:"ccphotos",label:"listview_ccphotos_tab_label",listViewEnabled:!0,thumbnailViewEnabled:!0,list:[]}}}getMru(){this.mruList=$.a.getGlobalItem(f.a.LOCALSTORE_KEYS.MRU_LIST);const e={};return this.mruList&&this.mruList.forEach(t=>{t.thumb&&(e[t.tip]=t.lastOpened)}),JSON.stringify(e)}updateMru(e){const t={};return this.mruList=this.mruList||$.a.getGlobalItem(f.a.LOCALSTORE_KEYS.MRU_LIST),this.mruList&&this.mruList.forEach(e=>{t[e.tip]=e.thumb}),e.forEach(e=>{"PRE_EXISTING"===e.thumb&&(e.thumb=t[e.tip])}),delete this.mruList,$.a.setGlobalItem(f.a.LOCALSTORE_KEYS.MRU_LIST,e),e}updateVisibilty(){o.a.toConsole("Received visibility changed event"),s.default.evalExtendScript("app.documents.length > 0",e=>{s.default.evalExtendScript("PHXSBridge.getHomescreenVisibility()",t=>{o.a.toConsole(`Updating visiblity to ${t} and hasOpenDocuments to ${e} `),this.data.updateVisibility(JSON.parse(t),JSON.parse(e))})})}addVisibilityListener(){s.default.evalExtendScript("app.stringIDToTypeID('homeScreenVisibilityChanged')",e=>{s.default.addEventListener("com.adobe.PhotoshopJSONCallback"+s.default.extensionID,this.updateVisibilty.bind(this)),s.default.sendEvent("com.adobe.PhotoshopRegisterEvent",e),o.a.toConsole(`Created visibility listener using event id ${e}`)})}getData(){return new Promise((e,t)=>{s.default.evalExtendScript("createJSON().call(this);",()=>{s.default.evalExtendScript(`PHXSBridge.getCCXUserJSON(undefined, ${this.getMru()})`,a=>{try{i.a.measure(i.a.TIMERS.APPDATA),console.log(s.default.applicationID+" host:"+a);const o=JSON.parse(a,r.startDataReceiver);this.updateMru(o.recentFiles.list),o.tabs=this._getDefaultTabs(o.recentFiles.list||[]),o.startVersion=window.appVersionNumber,$.a.setGlobalItem("hostdata",o),e(o)}catch(e){t(e)}})})})}getPipMethodString(e,t){let a=s.default.extensionID.replace("com.adobe.","")+" "+e;return t&&(a+=" "+t),a}defaultNewDocument(){s.default.sendEvent(f.a.IPCEVENT.LOADEXTENSION,"com.adobe.ccx.fnft"),s.default.evalExtendScript("PHXSBridge.createDocumentFromTemplate()",e=>{s.default.closeExtensionOnStatus(e)})}openDocument(e,t=!1,a=(e=>{})){if(e){const o=`PHXSBridge.openDocumentWithPath(\n\t\t\t\t"${e}",\n\t\t\t\t"${this.getPipMethodString("open.ccphoto")}",\n\t\t\t\t"${Boolean(t)}"\n\t\t\t)`;s.default.evalExtendScript(o,e=>{s.default.closeExtensionOnStatus(e),a("true"===e.toLowerCase())})}else{const e=this.getPipMethodString("open.dialog");s.default.evalExtendScript('PHXSBridge.openDocumentWithUI("'+e+'")',e=>{s.default.closeExtensionOnStatus(e),a("true"===e.toLowerCase())})}}openPathWithXMP(e,t,a,o=(e=>{})){const n=this.getPipMethodString("open.dialog","ACR"),r=`PHXSBridge.openWithACR(\n\t\t\t${JSON.stringify(e)},\n\t\t\t${JSON.stringify(t)},\n\t\t\t${a},\n\t\t\t${JSON.stringify(n)}\n\t\t)`;s.default.evalExtendScript(r,e=>{s.default.closeExtensionOnStatus(e),o("true"===e.toLowerCase())})}openMRU(e,t){const a=e.identifier,o=this.getPipMethodString("recent",t);s.default.evalExtendScript('PHXSBridge.openDocumentWithMRUIdentifier("'+a+'","'+o+'")',s.default.closeExtensionOnStatus)}openCCFilesDocument(e,t){const a=e.identifier,n=this.getPipMethodString("ccfiles",t);o.a.toConsole("CC-Files :: opening "+a),s.default.evalExtendScript('PHXSBridge.openDocumentWithPath("'+a+'","'+n+'")',s.default.closeExtensionOnStatus)}openDroppedFiles(e){if(e){const t=this.getPipMethodString("drag.drop");s.default.evalExtendScriptWithParams("PHXSBridge.openDroppedDocument",e,t,s.default.closeExtensionOnStatus)}}handleStatusChange(e){let t;e.data=e.data.replace(/'/g,'"');const a=e.data.match(/^ver1,/)?JSON.parse(e.data.replace(/^ver1,/,"")):null;return new Promise((o,n)=>{if(a&&a.eventID&&a.eventData)return 1936028772===a.eventID&&a.eventData.to&&a.eventData.to._obj&&"generalPreferences"===a.eventData.to._obj&&void 0!==a.eventData.to.useClassicFileNewDialog&&(this.data.fnftEnabled=!a.eventData.to.useClassicFileNewDialog),o();try{t="string"==typeof e.data?JSON.parse(e.data):e.data}catch(e){n(e)}switch(t.statusEvent){case"updateMRUList":if(!this._mruCallbackPending){this._mruCallbackPending=!0;$.a.getUserItem(f.a.LOCALSTORE_KEYS.MAIN_PREFS);s.default.evalExtendScript(`PHXSBridge.getRecentFiles(false, ${this.getMru()})`,e=>{try{const t=JSON.parse(e,r.startDataReceiver);this.updateMru(t.list),this._mruCallbackPending=!1;const a=$.a.getGlobalItem("hostdata");a&&(a.tabs.recentfile.list=t.list,$.a.setGlobalItem("hostdata",a)),o(t.list)}catch(e){this._mruCallbackPending=!1,n(e)}})}break;default:o(),this.commonStatusChangeHandler(t.statusEvent,t.statusData)}})}releaseFileReference(e){s.default.evalExtendScript(`PHXSBridge.releaseFileReference("${e}")`,s.default.closeExtensionOnStatus)}setActiveDocumentTitle(e){s.default.evalExtendScript(`PHXSBridge.setActiveDocumentTitle("${e}")`,s.default.closeExtensionOnStatus)}}var ne=t.default=class{static getInstance(){if(!this._instance)if(s.default.available)switch(s.default.applicationID){case"PHXS":this._instance=new oe;break;default:this._instance=new ae}else this._instance=new Q;return this._instance}}.getInstance()},sKM9:function(e,t,a){"use strict";a.d(t,"b",function(){return r});var s=a("xPCX"),o=a("y5v3");s.f.model("SophiaCardData",{cardType:s.f.maybeNull(s.f.string),cardID:s.f.maybeNull(s.f.string),backgroundImage:s.f.maybeNull(s.f.string),backgroundFillColor:s.f.maybeNull(s.f.string),startDTS:s.f.maybeNull(s.f.string),endDTS:s.f.maybeNull(s.f.string),bodyCopy:s.f.maybeNull(s.f.string),ctaLabel:s.f.maybeNull(s.f.string),actionURL:s.f.maybeNull(s.f.string),urlLinkType:s.f.maybeNull(s.f.string),defaultURL:s.f.maybeNull(s.f.string),urlAppendAnalyticsParams:s.f.maybeNull(s.f.boolean),urlApplyAdobeAuthentication:s.f.maybeNull(s.f.boolean),searchLabel:s.f.maybeNull(s.f.string),backgroundImageLocalpath:s.f.maybeNull(s.f.string),footnote:s.f.maybeNull(s.f.string),eventAction:s.f.maybeNull(s.f.string),eventData:s.f.maybeNull(s.f.string),containerAnalyticsParams:s.f.optional(s.f.frozen(),null),fontColor:s.f.maybeNull(s.f.string),position:s.f.maybeNull(s.f.number),workflow:s.f.maybeNull(s.f.string),daysLeft:s.f.maybeNull(s.f.number),promoID:s.f.maybeNull(s.f.string),content:s.f.optional(s.f.frozen(),null),tutorials:s.f.optional(s.f.frozen(),null)}).preProcessSnapshot(e=>({...e,urlAppendAnalyticsParams:"string"==typeof e.urlAppendAnalyticsParams?"true"===e.urlAppendAnalyticsParams:e.urlAppendAnalyticsParams,urlApplyAdobeAuthentication:"string"==typeof e.urlApplyAdobeAuthentication?"true"===e.urlApplyAdobeAuthentication:e.urlApplyAdobeAuthentication})).actions(e=>({setContainerAnalyticsParams(t){e.containerAnalyticsParams=t},setWorkflow(t){e.workflow=t},setPosition(t){e.position=t},setFontColor(t){e.fontColor=t},setBackgroundFillColor(t){e.backgroundFillColor=t},setDaysLeft(t){e.daysLeft=t}}));const n=(e,t,a=!0)=>{const s=e.tutorialData&&e.tutorialData.surfaces&&e.tutorialData.surfaces[o.a.SOPHIA_SURFACEID.TUTORIALS]&&e.tutorialData.surfaces[o.a.SOPHIA_SURFACEID.TUTORIALS].containers;let n=a?[]:{};return Array.isArray(s)?(s.forEach(e=>{if(e&&e.content&&Array.isArray(e.content.tutorials)&&e.content.tutorials.length>0){const s=e.content.tutorials[0];if(s.metadata&&Array.isArray(s.metadata.platforms)){const r=s.metadata.platforms.includes(o.a.LEARN_PLATFORMS.IN_APP[0])||s.metadata.platforms.includes(o.a.LEARN_PLATFORMS.IN_APP[1]);"web"!==t||r?"app"===t&&r&&(n=a?e.content.tutorials:e.containerAnalyticsData):n=a?e.content.tutorials:e.containerAnalyticsData}}}),n):n},r=s.f.model("SophiaStore",{surfaces:s.f.optional(s.f.frozen(),{}),analyticsParams:s.f.optional(s.f.frozen(),null),appLaunchBucket:s.f.maybe(s.f.string),derivedAppLaunchBucket:s.f.maybe(s.f.string),derivedPersona:s.f.maybe(s.f.string),derivedSkill:s.f.maybe(s.f.string),expirationDTS:s.f.maybe(s.f.string),hvaFlow:s.f.maybe(s.f.string),persona:s.f.maybe(s.f.string),version:s.f.maybe(s.f.number),ccxVersion:s.f.maybe(s.f.string),bonusLaunch:s.f.maybe(s.f.boolean),isCached:s.f.optional(s.f.boolean,!1),src:s.f.optional(s.f.string,""),tutorialData:s.f.optional(s.f.frozen(),{})}).views(e=>({checkForSurface:t=>!(!e.surfaces||!e.surfaces[t])})).views(e=>({getContentForSurface(t,a=0){const s=e.surfaces[t];return s&&s.containers&&s.containers[a]},getContainerAnalyticsParams(t,a=0){const s=e.surfaces[t];return s&&s.containers&&s.containers[a]&&s.containers[a].containerAnalyticsData},get webTutorials(){return n(e,"web")},get hasThirdPartyContent(){return this.webTutorials.some(({metadata:e})=>e.source&&e.source.third_party)},get appTutorials(){return n(e,"app")},get webAnalytics(){return n(e,"web",!1)},get appAnalytics(){return n(e,"app",!1)}})).actions(e=>({setTutorials(t){e.tutorialData=t}}))}}]);