if (self.CavalryLogger) { CavalryLogger.start_js(["uHwK+"]); } __d("KaiOSAppMigrationEvent",[],(function(a,b,c,d,e,f){e.exports=Object.freeze({COMPLETED_ROUNDTRIP:"completed_roundtrip",HIT_JIO_HOME_GEN_DELEGATE:"hit_jio_home_gen_delegate",HIT_JIO_STARTUP_GEN_DELEGATE:"hit_jio_startup_gen_delegate",DELEGATE_TO_MIGRATION_RESPONSE:"delegate_to_migration_response",DELEGATE_TO_JIO_HOME:"delegate_to_jio_home",RESPOND_WITH_MIGRATION:"respond_with_migration",DELEGATE_TO_MINDEX:"delegate_to_mindex",REDIRECT_TO_MINDEX:"redirect_to_mindex",COMPLETED_BROWSER_IFRAME_INIT:"completed_browser_iframe_init",MIGRATION_STATUS_CHECKED:"migration_status_checked"})}),null); __d("KaiOSSendMessageUtil",["Event"],(function(a,b,c,d,e,f){"use strict";__p&&__p();a=function(){__p&&__p();function a(){this.$1=!1,this.$2=null,this.$3()}var c=a.prototype;c.$3=function(){var a=this;this.$2=b("Event").listen(window,"beforeunload",function(){a.$1=!0,a.$2&&(a.$2.remove(),a.$2=null)})};c.postMessage=function(a,b,c,d){if(a&&b&&!this.$1){var e=new Map();e.set(g.Action,b);c&&e.set(g.ActionPayload,c);d!=null&&e.set(g.CallbackID,d);a.postMessage(e,"*")}};return a}();var g={Type:Object.freeze({HANDLE_BACK:"handle_back",MESSAGE_RECEIVED:"received",OPEN_URL:"open_url",REGISTER_PUSH:"register_push",SCREEN_ORIENTATION_LOCK:"screen_orientation_lock",UNREGISTER_PUSH:"unregister_push",CHECK_FOR_PUSH_UPDATE:"check_for_push_update",PUSH_UPDATE_COMPLETED:"push_update_completed",SET_VOLUME:"set_volume",FBT_STRINGS:"fbt_strings",CONFIG_RESPONSE:"config_response",FETCH_MSISDN:"fetch_msisdn",GET_CONTACTS:"get_contacts",TOGGLE_SPATIAL_NAV:"toggle_spatial_nav",LITE_MIGRATION_STATUS:"lite_migration_status"}),Action:"action",ActionPayload:"payload",CallbackID:"callback_id",_singletonImpl:new a(),postMessage:function(a,b,c,d){g._singletonImpl.postMessage(a,b,c,d)}};e.exports=g}),null); __d("KaiOSConnectionHelper",["KaiOSSendMessageUtil"],(function(a,b,c,d,e,f){"use strict";__p&&__p();var g="app://m.facebook.com";a=function(){__p&&__p();function a(){this.hostWindow=null,this.resolveOnConnect=null}var c=a.prototype;c.receiveMessage=function(a){if(!a||a.origin!==g||!a.source)return!1;if(a.data==="ping"){this.hostWindow||(this.hostWindow=a.source,b("KaiOSSendMessageUtil").postMessage(this.hostWindow,b("KaiOSSendMessageUtil").Type.MESSAGE_RECEIVED));a=this.resolveOnConnect;a&&(a(),this.resolveOnConnect=null)}return!0};return a}();c=new a();e.exports=c}),null); __d("KaiOSControllerConfig",[],(function(a,b,c,d,e,f){"use strict";a={};e.exports=a}),null); __d("KaiOSLoggedOutPushUriParamConstants",[],(function(a,b,c,d,e,f){e.exports=Object.freeze({EXIT_ON_BACK_PARAM:"exit_on_back"})}),null); __d("URLSearchParams",[],(function(a,b,c,d,e,f){__p&&__p();var g=/\+/g,h=/[!\'()*]/g,i=/%20/g;function j(a){return encodeURIComponent(a).replace(i,"+").replace(h,function(a){return"%"+a.charCodeAt(0).toString(16)})}function k(a){return decodeURIComponent(a).replace(g," ")}var l=typeof Symbol==="function"?Symbol.iterator:"@@iterator";a=function(){"use strict";__p&&__p();function a(a){a===void 0&&(a="");a=a;a[0]==="?"&&(a=a.substr(1));this.$1=a.length?a.split("&").map(function(a){a=a.split("=");var b=a[0];a=a[1];return[k(b),k(a)]}):[]}var b=a.prototype;b.append=function(a,b){this.$1.push([a,String(b)])};b["delete"]=function(a){for(var b=0;b=e.length)break;h=e[f++]}else{f=e.next();if(f.done)break;h=f.value}h=h;h.mutationObserver!=null&&h.mutationObserver.release()}h=c.newContextState!=null?c.newContextState:a.menuContext==null?g.NO_CONTEXT:g.MENU_CONTEXT;return{contextStack:[],menuContext:a.menuContext,contextState:h}}return a}};e.exports=a}),null); __d("HighlightNodeMutation",["MutationUtils","SpatialNavControllerUtils","SpatialNavScrollUtils","SpatialNavTreeNodeUtils"],(function(a,b,c,d,e,f){"use strict";__p&&__p();a={mutateState:function(a,c){__p&&__p();var d=b("SpatialNavControllerUtils").getContextFromState(a);if(d==null)return a;var e=d.currentNode;c=c.targetElement;if(e.getHTMLElement()===c)return a;c=b("SpatialNavTreeNodeUtils").findNodeForElement(c,b("SpatialNavTreeNodeUtils").getRootNode(e));if(c==null)return a;b("SpatialNavScrollUtils").scrollToNodeIfNecessary(c,d.config);e&&(e.getHTMLElement().blur(),b("MutationUtils").unhighlightNode(e));b("MutationUtils").maybeFocusNode(c);b("MutationUtils").highlightNode(c);return b("MutationUtils").getNewControllerState(a,c)}};e.exports=a}),null); __d("InteractWithNodeMutation",["KaiOSHTMLElementUtils","MutationUtils","SpatialNavTreeNodeUtils","getActiveElement"],(function(a,b,c,d,e,f){"use strict";__p&&__p();function g(a){return a instanceof HTMLSelectElement||a instanceof HTMLInputElement&&a.type==="date"}a={mutateState:function(a,c){var d=c.node.getHTMLElement();g(d)&&b("MutationUtils").focusAndTagElement(d);b("KaiOSHTMLElementUtils").isTextfieldInput(d)&&b("getActiveElement")(document)!==d&&b("MutationUtils").focusAndTagElement(d);if(b("SpatialNavTreeNodeUtils").shouldClickChildInstead(c.node)){c=b("KaiOSHTMLElementUtils").getFirstLink(d);c!=null&&c.click()}else d.click();return a}};e.exports=a}),null); __d("MoveToNodeMutation",["MutationUtils","SpatialNavControllerUtils","SpatialNavScrollUtils"],(function(a,b,c,d,e,f){"use strict";__p&&__p();a={mutateState:function(a,c){__p&&__p();var d=c.currentNode;c=c.nextNode;var e=b("SpatialNavControllerUtils").getContextFromState(a);if(e==null)return a;b("SpatialNavScrollUtils").scrollToNodeIfNecessary(c,e.config);d.getHTMLElement().blur();b("MutationUtils").maybeFocusNode(c);b("MutationUtils").unhighlightNode(d);b("MutationUtils").highlightNode(c);return b("MutationUtils").getNewControllerState(a,c)}};e.exports=a}),null); __d("PopContextMutation",["MutationUtils","SpatialNavControllerTypes","SpatialNavControllerUtils"],(function(a,b,c,d,e,f){"use strict";__p&&__p();var g=b("SpatialNavControllerTypes").SpatialNavContextState;a={mutateState:function(a){b("MutationUtils").unhighlightStackContext(a);var c=a.contextStack.length<=1&&a.contextState===g.CONTEXT_STACK?g.NO_CONTEXT:a.contextState,d=a.contextStack.length;if(c===g.CONTEXT_STACK&&d>=2){d=a.contextStack[d-2].currentNode;b("MutationUtils").highlightNode(d)}d=b("SpatialNavControllerUtils").getStackContextFromState(a);d!=null&&d.mutationObserver!=null&&d.mutationObserver.release();return{contextStack:a.contextStack.slice(0,-1),menuContext:a.menuContext,contextState:c}}};e.exports=a}),null); __d("SpatialNavDOMMutationObserver",["SpatialNavMutationSpecTypes"],(function(a,b,c,d,e,f){"use strict";__p&&__p();var g={attributes:!0,attributeFilter:["style"],attributeOldValue:!0,childList:!0,subtree:!0},h=new RegExp(/display:\s*none/);a=function(){__p&&__p();function a(a,c,d,e){__p&&__p();var f=this;this.$5=function(a){__p&&__p();var c=f.$2,d=f.$3,e=f.$4;if(c==null||d==null)return;var g=[];for(var a=a,h=Array.isArray(a),i=0,a=h?a:a[typeof Symbol==="function"?Symbol.iterator:"@@iterator"]();;){var j;if(h){if(i>=a.length)break;j=a[i++]}else{i=a.next();if(i.done)break;j=i.value}j=j;var k=j.target;if(!(k instanceof HTMLElement))continue;if(j.type==="attributes"){if(f.$6(j))g.push({domMutationType:"ADD",addedElement:k});else if(f.$7(j)){var l=k.parentNode;l instanceof HTMLElement&&g.push({domMutationType:"REMOVE",removedElement:k,removedElementParent:l})}}else if(j.type==="childList"){for(var l=j.removedNodes,m=Array.isArray(l),n=0,l=m?l:l[typeof Symbol==="function"?Symbol.iterator:"@@iterator"]();;){var o;if(m){if(n>=l.length)break;o=l[n++]}else{n=l.next();if(n.done)break;o=n.value}o=o;o instanceof HTMLElement&&g.push({domMutationType:"REMOVE",removedElement:o,removedElementParent:k})}for(var o=j.addedNodes,n=Array.isArray(o),m=0,o=n?o:o[typeof Symbol==="function"?Symbol.iterator:"@@iterator"]();;){if(n){if(m>=o.length)break;l=o[m++]}else{m=o.next();if(m.done)break;l=m.value}k=l;k instanceof HTMLElement&&g.push({domMutationType:"ADD",addedElement:k})}}}g.length!==0&&d([{mutationType:b("SpatialNavMutationSpecTypes").REBUILD_PARTIAL_TREE,pathType:c,domMutations:g,highlightNext:e}])};this.$2=c;this.$3=d;this.$4=e;this.$1=new MutationObserver(this.$5);this.$1.observe(a,g)}var c=a.prototype;c.release=function(){this.$1!=null&&this.$1.disconnect(),this.$1=null,this.$2=null,this.$3=null};c.$6=function(a){var b=a.oldValue;a=a.target;return b!=null&&h.test(b)&&a instanceof HTMLElement&&a.style.display===""};c.$7=function(a){var b=a.oldValue;a=a.target;return(b==null||!h.test(b))&&a instanceof HTMLElement&&a.style.display==="none"};return a}();e.exports=a}),null); __d("PushContextMutation",["fbt","HierarchicalTreeOptimizer","KaiOSSpatialNavPath","KaiOSSpatialNavTraverserKind","MutationUtils","SpatialNavControllerTypes","SpatialNavControllerUtils","SpatialNavDOMMutationObserver","SpatialNavScrollUtils","SpatialNavTreeBuilder","SpatialNavTreeNodeUtils","qex"],(function(a,b,c,d,e,f,g){"use strict";__p&&__p();var h=b("SpatialNavControllerTypes").SpatialNavContextState;function i(a,c,d){b("SpatialNavScrollUtils").scrollToNodeIfNecessary(c,d);d=b("SpatialNavControllerUtils").getStackContextFromState(a);d!=null&&d.currentNode.getHTMLElement().blur();b("MutationUtils").maybeFocusNode(c);b("MutationUtils").highlightNode(c)}a={mutateState:function(a,c){__p&&__p();var d=b("SpatialNavTreeBuilder").buildSpatialNavTree(c.rootElement);if(d==null)return a;var e=null;c.config.focusMenuElementOnFirst!=null&&(e=b("SpatialNavTreeNodeUtils").findMenuNodeFromElement(c.config.focusMenuElementOnFirst,d));e==null&&(e=c.config.pathType===b("KaiOSSpatialNavPath").BOTTOM_SHEET||c.config.pathType===b("KaiOSSpatialNavPath").LIKE_REACTION_FLYOUT||c.config.pathType===b("KaiOSSpatialNavPath").MOVERLAY?b("SpatialNavTreeNodeUtils").getFirstHighlightableNode(d):b("SpatialNavTreeNodeUtils").getFirstHighlightableNodeInViewport(d));if(e==null)return a;var f=h.CONTEXT_STACK;a.contextState===h.MENU_CONTEXT&&a.menuContext!=null&&b("SpatialNavTreeNodeUtils").getRootNode(a.menuContext.currentNode).getHTMLElement()!==c.rootElement?f=h.MENU_CONTEXT:(b("MutationUtils").unhighlightStackContext(a),i(a,e,c.config));c.traverser.traverserName===b("KaiOSSpatialNavTraverserKind").HIERARCHICAL&&c.config.validateTree===!0&&b("HierarchicalTreeOptimizer").validateTreeStructure(d);d=null;c.config.observeDOMChanges===!0&&(d=new(b("SpatialNavDOMMutationObserver"))(c.rootElement,c.config.pathType,c.stateUpdateFunction,c.config.highlightNext));if(c.config.pathType===b("KaiOSSpatialNavPath").FRIENDS_TAB&&f===h.CONTEXT_STACK&&b("qex")._("816772")){var j=g._("Select");j={detail:{centerButtonText:j}};b("SpatialNavControllerUtils").updateSoftkeyTray(j)}else{j={detail:{centerButtonText:""}};b("SpatialNavControllerUtils").updateSoftkeyTray(j)}return{contextStack:[].concat(a.contextStack,[{currentNode:e,traverser:c.traverser,config:c.config,mutationObserver:d}]),menuContext:a.menuContext,contextState:f}}};e.exports=a}),null); __d("SpatialNavTreeUpdater",["KaiOSHTMLElementUtils","SpatialNavigationAttribute","SpatialNavScrollUtils","SpatialNavTreeBuilder","SpatialNavTreeNodeUtils"],(function(a,b,c,d,e,f){"use strict";__p&&__p();function g(a,c){c=c.parentNode;a=a.getHTMLElement().parentNode;var d=null,e=null;while(c!=null&&c!==a&&c!==document&&c instanceof HTMLElement&&(d==null||e==null))c.hasAttribute(b("SpatialNavigationAttribute").SCROLL_PARENT)&&(d==null&&(d=b("SpatialNavScrollUtils").isVScrollParent(c)?c:null),e==null&&(e=b("SpatialNavScrollUtils").isHScrollParent(c)?c:null)),c=c.parentNode;return{hScrollParent:e,vScrollParent:d}}function h(a,c){__p&&__p();a=g(a,c);c=b("SpatialNavTreeBuilder").buildSpatialNavTree(c,a.hScrollParent,a.vScrollParent);a=[];for(var c=c.getChildren(),d=Array.isArray(c),e=0,c=d?c:c[typeof Symbol==="function"?Symbol.iterator:"@@iterator"]();;){var f;if(d){if(e>=c.length)break;f=c[e++]}else{e=c.next();if(e.done)break;f=e.value}f=f;f.setParent(null);a.push(f)}return a}function i(a,c){c=c;while(c!=null&&c!==document&&c instanceof HTMLElement){if(c===a.getHTMLElement()&&b("KaiOSHTMLElementUtils").isVisible(c)||b("KaiOSHTMLElementUtils").isSpatialNavElement(c))return b("SpatialNavTreeNodeUtils").findNodeForElement(c,a);c=c.parentNode}return null}a={maybeAddNodes:function(a,b){__p&&__p();var c=h(a,b);if(c.length===0)return[];a=i(a,b.parentNode);if(a==null)return[];var d=a.getChildren(),e;for(e=0;e=f.length)break;e=f[d++]}else{d=f.next();if(d.done)break;e=d.value}e=e;e.setParent(a)}return c},maybeRemoveNodes:function(a,c,d,e){__p&&__p();a=i(a,d);d={removedNodes:[],removedCurrentNode:!1,closestPrevNode:null,closestNextNode:null};if(a==null)return d;a=a.getChildren();var f=0,g;for(g=0;g=0;c--){var d=a[c];if(d.config.pathType===b)return d}return null}function h(a,c){if(c==null)return b("SpatialNavTreeNodeUtils").getFirstHighlightableNode(a);else{a=b("SpatialNavTreeNodeUtils").getNextNodeFiltered(c,function(a){return!b("SpatialNavTreeNodeUtils").isFocusTransparent(a)});return(a=a)!=null?a:c}}a={mutateState:function(a,c){__p&&__p();var d=g(a,c.pathType);if(d==null)return a;var e=b("SpatialNavTreeNodeUtils").getRootNode(d.currentNode),f=!1,i=null,j=null;for(var k=c.domMutations,l=Array.isArray(k),m=0,k=l?k:k[typeof Symbol==="function"?Symbol.iterator:"@@iterator"]();;){var n;if(l){if(m>=k.length)break;n=k[m++]}else{m=k.next();if(m.done)break;n=m.value}n=n;switch(n.domMutationType){case"ADD":b("SpatialNavTreeUpdater").maybeAddNodes(e,n.addedElement);break;case"REMOVE":n=b("SpatialNavTreeUpdater").maybeRemoveNodes(e,n.removedElement,n.removedElementParent,d.currentNode);n.removedCurrentNode&&(i=n.closestPrevNode,j=n.closestNextNode,f=!0);break;default:}}if(!f)return a;n=null;c.highlightNext===!0&&j!==null?n=j:n=h(e,i);m=a.contextStack;l=m.indexOf(d);if(l===-1||n==null)return a;k=d.currentNode;b("MutationUtils").moveToNewNode(k,n,d.config);f=k.getParent();if(f!=null&&f.getPrimaryChildOverride()===k){c=n.getParent()===f?n:null;f.setPrimaryChildOverride(c)}d.traverser.traverserName===b("KaiOSSpatialNavTraverserKind").HIERARCHICAL&&d.config.validateTree===!0&&b("HierarchicalTreeOptimizer").validateTreeStructure(e);j=[].concat(m.slice(0,l),[babelHelpers["extends"]({},d,{currentNode:n})],m.slice(l+1));return babelHelpers["extends"]({},a,{contextStack:j})}};e.exports=a}),null); __d("RemoveContextMutation",["MutationUtils","SpatialNavControllerTypes","SpatialNavTreeNodeUtils"],(function(a,b,c,d,e,f){"use strict";__p&&__p();var g=b("SpatialNavControllerTypes").SpatialNavContextState;a={mutateState:function(a,c){__p&&__p();if(a.contextStack==null||a.contextStack.length===0)return a;for(var d=a.contextStack.length-1;d>=0;d--){var e=a.contextStack[d],f=e.currentNode,h=b("SpatialNavTreeNodeUtils").getRootNode(f).getHTMLElement(),i=a.contextStack[d].config.pathType;if(h===c.rootElement||i===c.pathType){f.getHTMLElement().blur();b("MutationUtils").unhighlightNode(f);h=a.contextStack.length===1&&a.contextState===g.CONTEXT_STACK?g.NO_CONTEXT:a.contextState;e.mutationObserver!=null&&e.mutationObserver.release();return{contextStack:a.contextStack.slice(0,d).concat(a.contextStack.slice(d+1)),menuContext:a.menuContext,contextState:h}}}return a}};e.exports=a}),null); __d("SwitchContextMutation",["MutationUtils","SpatialNavControllerTypes","SpatialNavControllerUtils","SpatialNavScrollUtils"],(function(a,b,c,d,e,f){"use strict";__p&&__p();var g=b("SpatialNavControllerTypes").SpatialNavContextState;a={mutateState:function(a,c){__p&&__p();if(a.contextState===c.switchToContextState)return a;var d={contextStack:a.contextStack,menuContext:a.menuContext,contextState:c.switchToContextState},e=b("SpatialNavControllerUtils").getContextFromState(d);if(c.switchToContextState!==g.NO_CONTEXT&&e==null)return a;a=c.currentNode;a!=null&&(a.getHTMLElement().blur(),b("MutationUtils").unhighlightNode(a));if(e!=null){a=c.nextNode!=null?c.nextNode:e.currentNode;b("SpatialNavScrollUtils").scrollToNodeIfNecessary(a,e.config);b("MutationUtils").maybeFocusNode(a);b("MutationUtils").highlightNode(a);d=b("MutationUtils").getNewControllerState(d,a)}return d}};e.exports=a}),null); __d("SpatialNavMutator",["BuildMenuMutation","ClearContextMutation","HighlightNodeMutation","InteractWithNodeMutation","MoveToNodeMutation","PopContextMutation","PushContextMutation","RebuildPartialTreeMutation","RebuildTreeMutation","RemoveContextMutation","SpatialNavMutationSpecTypes","SwitchContextMutation"],(function(a,b,c,d,e,f){"use strict";__p&&__p();var g=b("RebuildTreeMutation").RebuildTreeMutation,h={mutateState:function(a,b){var c=a;b.forEach(function(a){c=h._applyMutation(c,a)});return c},_applyMutation:function(a,c){__p&&__p();switch(c.mutationType){case b("SpatialNavMutationSpecTypes").PUSH_CONTEXT:return b("PushContextMutation").mutateState(a,c);case b("SpatialNavMutationSpecTypes").POP_CONTEXT:return b("PopContextMutation").mutateState(a);case b("SpatialNavMutationSpecTypes").MOVE_TO_NODE:return b("MoveToNodeMutation").mutateState(a,c);case b("SpatialNavMutationSpecTypes").INTERACT_WITH_NODE:return b("InteractWithNodeMutation").mutateState(a,c);case b("SpatialNavMutationSpecTypes").REBUILD_TREE:return g.mutateState(a,c);case b("SpatialNavMutationSpecTypes").BUILD_MENU:return b("BuildMenuMutation").mutateState(a,c);case b("SpatialNavMutationSpecTypes").HIGHLIGHT_NODE:return b("HighlightNodeMutation").mutateState(a,c);case b("SpatialNavMutationSpecTypes").SWITCH_CONTEXT:return b("SwitchContextMutation").mutateState(a,c);case b("SpatialNavMutationSpecTypes").CLEAR_CONTEXT:return b("ClearContextMutation").mutateState(a,c);case b("SpatialNavMutationSpecTypes").REMOVE_CONTEXT:return b("RemoveContextMutation").mutateState(a,c);case b("SpatialNavMutationSpecTypes").REBUILD_PARTIAL_TREE:return b("RebuildPartialTreeMutation").mutateState(a,c);default:return a}}};e.exports=h}),null); __d("SpatialNavPathUtils",["KaiOSSpatialNavPath","URI"],(function(a,b,c,d,e,f){"use strict";var g=Object.freeze({"/":b("KaiOSSpatialNavPath").NEWSFEED,"/kaiosapp/jio/home":b("KaiOSSpatialNavPath").NEWSFEED,"/kaiosapp/jio/home/startup":b("KaiOSSpatialNavPath").NEWSFEED,"/home.php":b("KaiOSSpatialNavPath").NEWSFEED,"/index.php":b("KaiOSSpatialNavPath").NEWSFEED,"/friends/center/kaios":b("KaiOSSpatialNavPath").FRIENDS_TAB,"/notifications.php":b("KaiOSSpatialNavPath").NOTIFICATION,"/kaiosapp/playground":b("KaiOSSpatialNavPath").PLAYGROUND,"/kaiosapp/playground/visibility":b("KaiOSSpatialNavPath").PLAYGROUND_VISIBILITY,"/login/save-device":b("KaiOSSpatialNavPath").SAVE_DEVICE_PAGE});a={getSpatialNavPathType:function(a){a=new(b("URI"))(a).getPath();a.length>1&&a[a.length-1]==="/"&&(a=a.slice(0,a.length-1));return g[a]!=null?g[a]:b("KaiOSSpatialNavPath").NONE}};e.exports=a}),null); __d("SpatialNavController",["fbt","Promise","regeneratorRuntime","DataStore","KaiOSConnectionHelper","KaiOSSendMessageUtil","KaiOSSpatialNavEvents","KaiOSSpatialNavPath","KaiOSSpatialNavTraverserKind","MFlyout","MOverlay","MutationUtils","RebuildTreeMutation","SpatialNavControllerUtils","SpatialNavigationAttribute","SpatialNavMutationSpecTypes","SpatialNavMutator","SpatialNavPathUtils","SpatialNavScrollUtils","SpatialNavTreeNodeUtils","Stratcom","SubscriptionsHandler","URI","promiseDone","SpatialNavControllerTypes"],(function(a,b,c,d,e,f,g){"use strict";__p&&__p();var h=b("RebuildTreeMutation").RebuildHighlightConfig,i=new Map([["nav_mode","spatial"]]),j=new Map([["nav_mode","cursor"]]),k=b("SpatialNavControllerTypes").SpatialNavContextState;a=function(){__p&&__p();function a(){__p&&__p();var a=this;this.$1=!1;this.$3=null;this.$4=null;this.$5=!1;this.$9=function(c,d){d===void 0&&(d=!1),b("promiseDone")(b("Promise").resolve().then(function(a){var c=this;this.$2=b("SpatialNavMutator").mutateState(this.$2,a);a.forEach(function(a){a.mutationType===b("SpatialNavMutationSpecTypes").PUSH_CONTEXT&&b("Stratcom").invoke(b("KaiOSSpatialNavEvents").INIT_COMPLETE),c.$12(a,c.$2)&&d&&c.enableSpatialNav()})}.bind(a,c)))};this.$2={contextStack:[],menuContext:null,contextState:k.NO_CONTEXT}}var c=a.prototype;c.enableSpatialNav=function(){this.$6(i),this.$1=!0,this.$7(),this.$8()};c.disableSpatialNav=function(a){__p&&__p();var c;return b("regeneratorRuntime").async(function(d){while(1)switch(d.prev=d.next){case 0:this.$6(j);this.$1=!1;this.$3!=null&&this.$3.release();d.next=5;return b("regeneratorRuntime").awrap(this.getCurrentState());case 5:c=d.sent,a&&this.clearContext(c.contextState,k.NO_CONTEXT);case 7:case"end":return d.stop()}},null,this)};c.disableSpatialNavForAll=function(){this.disableSpatialNav(!1),this.clearContext(k.MENU_CONTEXT),this.clearContext(k.CONTEXT_STACK)};c.isSpatialNavEnabled=function(){return this.$1};c.setupNavOnContainer=function(a,c,d){d===void 0&&(d=!1);var e=b("SpatialNavControllerUtils").getTraverserFromType(c.traverserType);c.isMenu===!0?this.$9([{mutationType:b("SpatialNavMutationSpecTypes").BUILD_MENU,rootElement:a,traverser:e,config:c}],d):this.$9([{mutationType:b("SpatialNavMutationSpecTypes").PUSH_CONTEXT,rootElement:a,traverser:e,config:c,stateUpdateFunction:this.$9}],d)};c.$6=function(a){b("KaiOSSendMessageUtil").postMessage(b("KaiOSConnectionHelper").hostWindow,b("KaiOSSendMessageUtil").Type.TOGGLE_SPATIAL_NAV,a)};c.rebuildSpatialNavTree=function(a){this.$9([{mutationType:b("SpatialNavMutationSpecTypes").REBUILD_TREE,highlightConfig:a}])};c.handleFocusChange=function(a){if(b("DataStore").get(a,b("MutationUtils").SPATIAL_NAV_ELEMENT_FOCUS_KEY,!1)){b("DataStore").remove(a,b("MutationUtils").SPATIAL_NAV_ELEMENT_FOCUS_KEY);return}this.$9([{mutationType:b("SpatialNavMutationSpecTypes").HIGHLIGHT_NODE,targetElement:a}])};c.getCurrentState=function(){var a=this;return b("regeneratorRuntime").async(function(c){while(1)switch(c.prev=c.next){case 0:return c.abrupt("return",b("Promise").resolve().then(function(){return a.$2}));case 1:case"end":return c.stop()}},null,this)};c.$10=function(){var a;return b("regeneratorRuntime").async(function(c){while(1)switch(c.prev=c.next){case 0:c.next=2;return b("regeneratorRuntime").awrap(this.getCurrentState());case 2:a=c.sent;return c.abrupt("return",b("SpatialNavControllerUtils").getContextFromState(a));case 4:case"end":return c.stop()}},null,this)};c.getCurrentStackContext=function(){var a;return b("regeneratorRuntime").async(function(c){while(1)switch(c.prev=c.next){case 0:c.next=2;return b("regeneratorRuntime").awrap(this.getCurrentState());case 2:a=c.sent;return c.abrupt("return",b("SpatialNavControllerUtils").getContextFromState(a,k.CONTEXT_STACK));case 4:case"end":return c.stop()}},null,this)};c.getCurrentContextState=function(){var a;return b("regeneratorRuntime").async(function(c){while(1)switch(c.prev=c.next){case 0:c.next=2;return b("regeneratorRuntime").awrap(this.getCurrentState());case 2:a=c.sent;return c.abrupt("return",a.contextState);case 4:case"end":return c.stop()}},null,this)};c.handleKeyDown=function(a){__p&&__p();var c,d,e,f,g;return b("regeneratorRuntime").async(function(h){__p&&__p();while(1)switch(h.prev=h.next){case 0:h.next=2;return b("regeneratorRuntime").awrap(this.getCurrentState());case 2:c=h.sent;d=b("SpatialNavControllerUtils").getContextFromState(c);if(!(d==null)){h.next=6;break}return h.abrupt("return");case 6:e=null;h.t0=a.key;h.next=h.t0==="ArrowLeft"?10:h.t0==="ArrowRight"?12:h.t0==="ArrowUp"?14:h.t0==="ArrowDown"?19:h.t0==="Enter"?24:26;break;case 10:e=d.traverser.onLeft;return h.abrupt("break",26);case 12:e=d.traverser.onRight;return h.abrupt("break",26);case 14:if(!b("SpatialNavScrollUtils").shouldScrollUpInTheSameNode(d.currentNode)){h.next=17;break}b("SpatialNavScrollUtils").scrollUpInTheSameNodeBySmallIncrement();return h.abrupt("return");case 17:e=d.traverser.onUp;return h.abrupt("break",26);case 19:if(!b("SpatialNavScrollUtils").shouldScrollDownInTheSameNode(d.currentNode)){h.next=22;break}b("SpatialNavScrollUtils").scrollDownInTheSameNodeBySmallIncrement();return h.abrupt("return");case 22:e=d.traverser.onDown;return h.abrupt("break",26);case 24:e=d.traverser.onCenterSoftKey;return h.abrupt("break",26);case 26:if(!(e!=null)){h.next=36;break}f=e(d);if(!(f.length!==0)){h.next=32;break}this.$9(f);h.next=36;break;case 32:h.next=34;return b("regeneratorRuntime").awrap(this.$11(c,a.key));case 34:g=h.sent,g.length!==0&&this.$9(g);case 36:case"end":return h.stop()}},null,this)};c.popContext=function(){this.$9([{mutationType:b("SpatialNavMutationSpecTypes").POP_CONTEXT}])};c.removeContextByElement=function(a){this.$9([{mutationType:b("SpatialNavMutationSpecTypes").REMOVE_CONTEXT,rootElement:a}])};c.removeContextByPath=function(a){this.$9([{mutationType:b("SpatialNavMutationSpecTypes").REMOVE_CONTEXT,pathType:a}])};c.clearContext=function(a,c){this.$9([{mutationType:b("SpatialNavMutationSpecTypes").CLEAR_CONTEXT,contextStateToClear:a,newContextState:c}])};c.switchContext=function(a,c,d){__p&&__p();var e;return b("regeneratorRuntime").async(function(f){__p&&__p();while(1)switch(f.prev=f.next){case 0:f.next=2;return b("regeneratorRuntime").awrap(this.getCurrentState());case 2:e=f.sent;if(!(a===k.MENU_CONTEXT&&e.menuContext==null||a===k.CONTEXT_STACK&&e.contextStack.length===0)){f.next=5;break}return f.abrupt("return");case 5:this.$9([{mutationType:b("SpatialNavMutationSpecTypes").SWITCH_CONTEXT,switchToContextState:a,currentNode:c,nextNode:d}]);case 6:case"end":return f.stop()}},null,this)};c.$12=function(a,c){return a.mutationType===b("SpatialNavMutationSpecTypes").PUSH_CONTEXT||a.mutationType===b("SpatialNavMutationSpecTypes").BUILD_MENU&&c.contextState===k.MENU_CONTEXT};c.$11=function(a,c){__p&&__p();var d,e,f,g;return b("regeneratorRuntime").async(function(h){__p&&__p();while(1)switch(h.prev=h.next){case 0:d=a.menuContext;if(!(a.contextState===k.MENU_CONTEXT&&d!=null&&c==="ArrowDown")){h.next=21;break}e=location.href;if(!(e!=null)){h.next=10;break}f=new(b("URI"))(e).getQueryData().soft;if(!(f==="search")){h.next=10;break}b("MutationUtils").unhighlightNode(d.currentNode);d.currentNode.getHTMLElement().blur();this.disableSpatialNav(!1);return h.abrupt("return",[]);case 10:if(!(a.contextStack.length!==0)){h.next=15;break}b("SpatialNavControllerUtils").updateCenterSoftkey(a,k.CONTEXT_STACK);return h.abrupt("return",[{mutationType:b("SpatialNavMutationSpecTypes").SWITCH_CONTEXT,switchToContextState:k.CONTEXT_STACK,currentNode:d.currentNode}]);case 15:this.disableSpatialNav(!1);h.next=18;return b("regeneratorRuntime").awrap(this.switchContext(k.NO_CONTEXT,d.currentNode));case 18:return h.abrupt("return",[]);case 19:h.next=26;break;case 21:if(!(a.contextState===k.CONTEXT_STACK&&a.contextStack.length===1&&(c==="ArrowUp"||c==="ArrowLeft"))){h.next=26;break}if(!(d!=null)){h.next=26;break}b("SpatialNavControllerUtils").updateCenterSoftkey(a,k.MENU_CONTEXT);g=b("SpatialNavTreeNodeUtils").getSelectedMenuNode(b("SpatialNavTreeNodeUtils").getRootNode(d.currentNode));return h.abrupt("return",[{mutationType:b("SpatialNavMutationSpecTypes").SWITCH_CONTEXT,switchToContextState:k.MENU_CONTEXT,currentNode:a.contextStack[a.contextStack.length-1].currentNode,nextNode:g}]);case 26:return h.abrupt("return",[]);case 27:case"end":return h.stop()}},null,this)};c.$7=function(){__p&&__p();var a=this;this.$3!=null&&this.$3.release();this.$3=new(b("SubscriptionsHandler"))();this.$3.addSubscriptions(b("Stratcom").listen([b("KaiOSSpatialNavEvents").REFRESH,"m:more_item_automatic:items_loaded"],null,function(b){b=b.getData();Object.prototype.hasOwnProperty.call(h,b)||(b=null);a.rebuildSpatialNavTree(b)}),b("Stratcom").listen("Layer:show",null,function(c){__p&&__p();if(a.isSpatialNavEnabled()==!1)return;c=c.getData();if(c instanceof b("MOverlay"))a.setupNavOnContainer(c.getRoot(),{traverserType:b("KaiOSSpatialNavTraverserKind").LINEAR,pathType:b("KaiOSSpatialNavPath").MOVERLAY});else if(c instanceof b("MFlyout"))if(c.config.contextSigil==="like-reaction-flyout")a.setupNavOnContainer(c.getContentRoot(),{traverserType:b("KaiOSSpatialNavTraverserKind").HORIZONTAL,pathType:b("KaiOSSpatialNavPath").LIKE_REACTION_FLYOUT,optionalCallback:function(a){return function(){a.isShown()&&typeof a.hide==="function"&&a.hide()}}(c),wrapAround:!1});else if(b("SpatialNavControllerUtils").isBottomSheetFlyout(c)){c.getContentRoot().setAttribute(b("SpatialNavigationAttribute").SCROLL_PARENT,!0);a.setupNavOnContainer(c.getContentRoot(),{traverserType:b("KaiOSSpatialNavTraverserKind").LINEAR,pathType:b("KaiOSSpatialNavPath").BOTTOM_SHEET,backKeyCallback:function(a){return function(){a.isShown()&&typeof a.hide==="function"&&a.hide()}}(c)});c=g._("Close");c={detail:{leftButtonText:c,leftButtonEvent:"close_bottom_sheet"}};b("SpatialNavControllerUtils").updateSoftkeyTray(c)}}),b("Stratcom").listen("m:layer:hide",null,function(a){__p&&__p();var c,d,e,f,g,h;return b("regeneratorRuntime").async(function(i){__p&&__p();while(1)switch(i.prev=i.next){case 0:c=a.getData();d=null;c instanceof b("MFlyout")?d=c.getContentRoot():c instanceof b("MOverlay")&&(d=c.getRoot());i.next=5;return b("regeneratorRuntime").awrap(this.getCurrentState());case 5:e=i.sent;f=b("SpatialNavControllerUtils").getStackContextFromState(e);if(!(f==null)){i.next=9;break}return i.abrupt("return");case 9:g=b("SpatialNavTreeNodeUtils").getRootNode(f.currentNode),c instanceof b("MOverlay")&&d===g.getHTMLElement()?this.popContext():c instanceof b("MFlyout")&&(d!==null&&d===g.getHTMLElement()&&(h=b("SpatialNavControllerUtils").isBottomSheetFlyout(c),(c.config.contextSigil==="like-reaction-flyout"||h)&&(this.popContext(),h&&b("Stratcom").invoke(b("KaiOSSpatialNavEvents").RESTORE_TRAY))));case 11:case"end":return i.stop()}},null,this)}.bind(this)),b("Stratcom").listen(b("KaiOSSpatialNavEvents").NAVIGATE,null,function(b){a.handleKeyDown(b.getData())}))};c.$8=function(){if(this.$4!=null)return;this.$4=new(b("SubscriptionsHandler"))();this.$4.addSubscriptions(b("Stratcom").listen(["m:history:change","m:history:change-default"],null,this.$13.bind(this)),b("Stratcom").listen("m:page:unload",null,this.$14.bind(this)))};c.$13=function(a){__p&&__p();var c=this;return b("regeneratorRuntime").async(function(d){__p&&__p();while(1)switch(d.prev=d.next){case 0:return d.abrupt("return",b("Promise").resolve().then(function(){__p&&__p();c.$5&&(c.$5=!1,b("Stratcom").invoke(b("KaiOSSpatialNavEvents").RESTORE_TRAY));var d=a.getData();if(d.soft==="composer"||d.soft==="search"){c.disableSpatialNav(!1);if(d.soft==="search"){var e={detail:{rightButtonText:""}};b("SpatialNavControllerUtils").updateSoftkeyTray(e);c.$5=!0}return}e=c.$2;if(e.contextState===k.MENU_CONTEXT){c.$1||c.$15();return}var f=b("SpatialNavPathUtils").getSpatialNavPathType(d.path);if(d.soft==null&&e.contextStack!=null&&e.contextStack.length>0){d=e.contextStack[e.contextStack.length-1].config;d.pathType===b("KaiOSSpatialNavPath").BOTTOM_SHEET&&d.backKeyCallback?d.backKeyCallback():d.pathType===b("KaiOSSpatialNavPath").LIKE_REACTION_FLYOUT&&d.optionalCallback&&d.optionalCallback();d.pathType===f?c.$1||c.$15():c.disableSpatialNav(!1)}}));case 1:case"end":return d.stop()}},null,this)};c.$14=function(a){a=a.getData();a=b("SpatialNavPathUtils").getSpatialNavPathType(a.path);a!==b("KaiOSSpatialNavPath").NONE&&this.removeContextByPath(a)};c.$15=function(){var a;return b("regeneratorRuntime").async(function(c){while(1)switch(c.prev=c.next){case 0:c.next=2;return b("regeneratorRuntime").awrap(this.$10());case 2:a=c.sent,a&&(this.enableSpatialNav(),b("MutationUtils").highlightNode(a.currentNode),b("MutationUtils").maybeFocusNode(a.currentNode));case 4:case"end":return c.stop()}},null,this)};c.interceptBackKey=function(){var a;return b("regeneratorRuntime").async(function(c){while(1)switch(c.prev=c.next){case 0:c.next=2;return b("regeneratorRuntime").awrap(this.$10());case 2:a=c.sent,a&&a.config&&a.config.backKeyCallback&&a.config.backKeyCallback();case 4:case"end":return c.stop()}},null,this)};c.scrollToTop=function(){__p&&__p();var a,c,d,e;return b("regeneratorRuntime").async(function(f){__p&&__p();while(1)switch(f.prev=f.next){case 0:f.next=2;return b("regeneratorRuntime").awrap(this.$10());case 2:a=f.sent;if(!(a==null)){f.next=5;break}return f.abrupt("return");case 5:c=a.currentNode;d=b("SpatialNavTreeNodeUtils").getRootNode(c);e=b("SpatialNavTreeNodeUtils").getFirstHighlightableNode(d);if(!(e==null)){f.next=10;break}return f.abrupt("return");case 10:this.$9([{mutationType:b("SpatialNavMutationSpecTypes").MOVE_TO_NODE,currentNode:c,nextNode:e}]);case 11:case"end":return f.stop()}},null,this)};return a}();e.exports=new a()}),null); __d("KaiOSMenuHandler",["csx","cx","fbt","regeneratorRuntime","CSS","DOM","Event","KaiOSSoftkeyTrayLogger","KaiOSSpatialNavEvents","KaiOSSpatialNavPath","KaiOSSpatialNavTraverserKind","MViewport","SpatialNavController","SpatialNavControllerTypes","SpatialNavTreeNodeUtils","Stratcom","URI"],(function(a,b,c,d,e,f,g,h,i){"use strict";__p&&__p();var j=b("SpatialNavControllerTypes").SpatialNavContextState;a=function(){__p&&__p();function a(){__p&&__p();var a=this;this.menuShown=!1;this.showPageSoftkeyTray=!1;this.toggleMenuVisibility=function(a,c){var d=b("MViewport").getScrollTop();if(d<=0)return;if(c)a.style.top="0px",a.classList.add("float");else{c=-Math.min(d,a.clientHeight);a.style.top=c+"px";a.classList.remove("float")}};this.$1=function(b){a.showFloatingMenu()};this.$2=function(c){var d=a.leftButtonElement;c=c.getData().path;if(a.menuShown&&d!=null){var e=null;c!=null&&(e=new(b("URI"))(c).getQueryData().soft);c=new CustomEvent("kaios_close_menu",{detail:{focusFirstNode:e!=="search"}});d.dispatchEvent(c);b("MViewport").scrollToTop()}};this.$3=function(c){__p&&__p();c=c.detail;var d=c.leftButtonText;if(d!=null){a.showPageSoftkeyTray||b("DOM").show(a.softkeyTrayContainer);var e=c.leftButtonEvent,f=c.leftButtonLoggingId;f=b("DOM").create("div",{className:"_6ykc",id:f},d);b("DOM").replace(a.leftButtonElement,f);a.leftButtonElement=f;e!=null&&b("Event").listen(f,"click",function(b){b=new CustomEvent(e);window.dispatchEvent(b);a.restorePageTray()})}d=c.rightButtonText;if(d!=null){var g=c.rightButtonEvent;f=c.rightButtonLoggingId;f=b("DOM").create("div",{className:"_6ykd",id:f},d);b("DOM").replace(a.rightButtonElement,f);a.rightButtonElement=f;g!=null&&b("Event").listen(f,"click",function(a){a=new CustomEvent(g);window.dispatchEvent(a)})}d=c.centerButtonText;if(d!=null&&a.centerButtonElement!=null&&d!=a.centerButtonElement.textContent){f=b("DOM").create("div",{className:"_7gvg"},d);b("DOM").replace(a.centerButtonElement,f);a.centerButtonElement=f}};this.$4=function(b){a.restorePageTray()}}var c=a.prototype;c.handleKeyEvents=function(a){__p&&__p();if(this.softkeyTrayContainer==null||this.softkeyTrayContainer.style.display!=""||this.viewportElement!=null&&this.viewportElement.style.display!="")return!1;switch(a.key){case"SoftLeft":a=this.leftButtonElement;if(a!=null){a.click();b("KaiOSSoftkeyTrayLogger").logSoftkeyTrayButtonClicked(a.getAttribute("id"));return!0}break;case"SoftRight":a=this.rightButtonElement;if(a!=null){a.click();b("KaiOSSoftkeyTrayLogger").logSoftkeyTrayButtonClicked(a.getAttribute("id"));return!0}break;case"Backspace":case"BrowserBack":case"ArrowUp":case"ArrowDown":if(this.menuShown&&this.leftButtonElement!=null){this.leftButtonElement.click();return!0}break}return!1};c.showFloatingMenu=function(){var a=this.menuContainerElement;a!=null&&(this.menuShown=!0,this.toggleMenuVisibility(a,!0),this.maybeSetupSpatialNavV2(),this.updateBackgroundOverlayVisibility(!0),this.setupCloseMenuButton())};c.maybeSetupSpatialNavV2=function(){__p&&__p();var a,c,d,e,f;return b("regeneratorRuntime").async(function(g){__p&&__p();while(1)switch(g.prev=g.next){case 0:a=this.menuContainerElement;if(!(a==null)){g.next=3;break}return g.abrupt("return");case 3:g.next=5;return b("regeneratorRuntime").awrap(b("SpatialNavController").getCurrentState());case 5:c=g.sent,this.prevSpatialNavContextState=c.contextState,d=null,this.prevSpatialNavContextState===j.MENU_CONTEXT&&c.menuContext!=null?d=c.menuContext.currentNode.getHTMLElement():(e=a.getElementsByClassName("popoverOpen"),e.length!==0&&(d=e[0])),f={traverserType:b("KaiOSSpatialNavTraverserKind").HORIZONTAL,pathType:b("KaiOSSpatialNavPath").MENU,isMenu:!1,disableScrollToNode:!0,focusMenuElementOnFirst:d,wrapAround:!0},b("SpatialNavController").setupNavOnContainer(a,f,!0);case 11:case"end":return g.stop()}},null,this)};c.setupCloseMenuButton=function(){__p&&__p();var a=this,c=this.leftButtonElement,d=this.rightButtonElement,e=this.centerButtonElement,f=b("DOM").create("div",{className:"_6ykc",id:"kaios_tray_menu_close"},i._("Close"));b("DOM").replace(this.leftButtonElement,f);this.leftButtonElement=f;var g=b("DOM").create("div"),h=b("DOM").create("div");b("DOM").replace(this.rightButtonElement,g);this.rightButtonElement=g;b("DOM").replace(this.centerButtonElement,h);this.centerButtonElement=h;b("Event").listen(f,"click",function(b){a.hideMenu(),a.swapButtons(f,c,g,d,h,e)});b("Event").listen(f,"kaios_close_menu",function(b){b=b.detail;var i=!0;typeof b==="object"&&("focusFirstNode"in b&&(i=b.focusFirstNode));a.hideMenu(i);a.swapButtons(f,c,g,d,h,e)})};c.hideMenu=function(a){__p&&__p();var c,d,e,f;return b("regeneratorRuntime").async(function(g){__p&&__p();while(1)switch(g.prev=g.next){case 0:a===void 0&&(a=!1);c=this.menuContainerElement;if(!c){g.next=32;break}this.menuShown=!1;this.toggleMenuVisibility(c,!1);g.next=7;return b("regeneratorRuntime").awrap(b("SpatialNavController").getCurrentStackContext());case 7:d=g.sent;if(!(d==null)){g.next=12;break}this.prevSpatialNavContextState=null;this.updateBackgroundOverlayVisibility(!1);return g.abrupt("return");case 12:e=d.currentNode;f=b("SpatialNavTreeNodeUtils").getRootNode(e);if(!(f.getHTMLElement()!==c)){g.next=19;break}b("SpatialNavController").removeContextByElement(c);this.prevSpatialNavContextState=null;this.updateBackgroundOverlayVisibility(!1);return g.abrupt("return");case 19:b("SpatialNavController").popContext();g.t0=this.prevSpatialNavContextState;g.next=g.t0===j.CONTEXT_STACK?23:g.t0===j.MENU_CONTEXT?25:g.t0===j.NO_CONTEXT?28:30;break;case 23:a&&b("SpatialNavController").scrollToTop();return g.abrupt("break",30);case 25:b("SpatialNavController").switchContext(j.MENU_CONTEXT,null,e);b("SpatialNavController").enableSpatialNav();return g.abrupt("break",30);case 28:b("SpatialNavController").disableSpatialNav(!0);return g.abrupt("break",30);case 30:this.prevSpatialNavContextState=null,this.updateBackgroundOverlayVisibility(!1);case 32:case"end":return g.stop()}},null,this)};c.swapButtons=function(a,c,d,e,f,g){b("DOM").replace(a,c),b("DOM").replace(d,e),b("DOM").replace(f,g),this.leftButtonElement=c,this.rightButtonElement=e,this.centerButtonElement=g};c.updateBackgroundOverlayVisibility=function(a){this.backgroundElement&&(a?this.backgroundElement.classList.add("shown"):this.backgroundElement.classList.remove("shown"))};c.restorePageTray=function(){this.showPageSoftkeyTray||b("DOM").hide(this.softkeyTrayContainer),b("DOM").replace(this.leftButtonElement,this.pageLeftButtonElement),b("DOM").replace(this.rightButtonElement,this.pageRightButtonElement),this.leftButtonElement=this.pageLeftButtonElement,this.rightButtonElement=this.pageRightButtonElement};c.restoreMenuOnInitIfShown=function(){this.menuShown&&this.hideMenu()};c.setupSoftKeyElements=function(a,b,c,d,e){this.backgroundElement=a,this.menuContainerElement=b,this.menuRootElement=c,this.softkeyTrayContainer=d,this.viewportElement=e};c.setupLeftButton=function(a){this.leftButtonElement=a,this.pageLeftButtonElement=a};c.setupMenuButton=function(a){this.setupLeftButton(a),this.menuShown=!1,b("Event").listen(a,"click",this.$1)};c.setupRightButton=function(a){this.rightButtonElement=a,this.pageRightButtonElement=a};c.setupCenterButton=function(a){this.centerButtonElement=a};c.setupHistoryListener=function(){b("Stratcom").listen("history:change",null,this.$2)};c.setupNavigationUpdateListener=function(){b("Event").listen(window,b("KaiOSSpatialNavEvents").UPDATE_TRAY,this.$3)};c.setupRestoreTrayListener=function(){b("Stratcom").listen(b("KaiOSSpatialNavEvents").RESTORE_TRAY,null,this.$4)};c.setupSoftKeyTrayShowHideListener=function(){var a=this;b("Stratcom").listen(b("KaiOSSpatialNavEvents").HIDE_TRAY,null,function(){if(!a.softkeyTrayContainer)return;b("CSS").addClass(a.softkeyTrayContainer,"_7hj_")});b("Stratcom").listen(b("KaiOSSpatialNavEvents").SHOW_TRAY,null,function(){if(!a.softkeyTrayContainer)return;b("CSS").removeClass(a.softkeyTrayContainer,"_7hj_")})};return a}();c={impl:new a(),setup:function(a){var c=document.querySelector("._6yui"),d=document.querySelector("._6ywo"),e=document.querySelector("._6usn"),f=document.getElementById("viewport"),g=document.getElementById("kaios_tray");this.impl.showPageSoftkeyTray=a;a||b("DOM").hide(g);this.impl.setupSoftKeyElements(c,d,e,g,f)},initForPage:function(a,b,c,d,e){this.setup(e),this.impl.setupNavigationUpdateListener(),this.impl.setupSoftKeyTrayShowHideListener(),this.impl.setupLeftButton(a),this.impl.setupCenterButton(d),this.impl.setupRightButton(b)},initForMenu:function(a){this.impl.restoreMenuOnInitIfShown(),this.impl.setupMenuButton(a),this.impl.setupHistoryListener(),this.impl.setupRestoreTrayListener(),this.impl.updateBackgroundOverlayVisibility(!1)},handleKeyEvents:function(a){return this.impl.handleKeyEvents(a)},initExperimentValues:function(a){this.impl.shouldUseSpatialnavV2=a.shouldUseSpatialnavV2}};e.exports=c}),null); __d("KaiOSNavigatorUtils",["KaiOSConnectionHelper","KaiOSSendMessageUtil"],(function(a,b,c,d,e,f){"use strict";var g=new Map([["nav_mode","spatial"]]),h=new Map([["nav_mode","cursor"]]);function i(a){b("KaiOSSendMessageUtil").postMessage(b("KaiOSConnectionHelper").hostWindow,b("KaiOSSendMessageUtil").Type.TOGGLE_SPATIAL_NAV,a)}a={showCursor:function(){i(h)},hideCursor:function(){i(g)}};e.exports=a}),null); __d("KaiOSKeyEventHandlers",["KaiOSConnectionHelper","KaiOSControllerConfig","KaiOSControllerUtils","KaiOSHTMLElementUtils","KaiOSMenuHandler","KaiOSNavigatorUtils","KaiOSSendMessageUtil","MViewport","SpatialNavController","SpatialNavControllerUtils","URI","isLinkshimURI"],(function(a,b,c,d,e,f){"use strict";__p&&__p();function a(a){__p&&__p();if(b("KaiOSControllerConfig").fullScreenVideoHandler&&b("KaiOSControllerConfig").fullScreenVideoHandler.handleClickEvent(a)){a.preventDefault();a.stopPropagation();return}var c=a.target,d=null;c&&c.tagName==="A"?d=c.href:c&&c.parentElement&&c.parentElement.tagName==="A"?d=c.parentElement.href:c&&c.parentElement&&c.parentElement.parentElement&&c.parentElement.parentElement.tagName==="A"&&(d=c.parentElement.parentElement.href);c=new(b("URI"))(d);var e=d!=null&&d!==""&&!/\.facebook.com$/i.test(c.getDomain());d!=null&&(b("isLinkshimURI")(c)||e)&&(b("KaiOSControllerUtils").openUrl(d),a.preventDefault(),a.stopPropagation())}function g(a){return b("KaiOSControllerConfig").appVersion!=null&&!b("SpatialNavController").isSpatialNavEnabled()&&b("KaiOSHTMLElementUtils").isTextfieldInput(a.target)}function c(a){g(a)?b("KaiOSNavigatorUtils").hideCursor():b("SpatialNavController").isSpatialNavEnabled()&&a.target instanceof HTMLElement&&b("SpatialNavController").handleFocusChange(a.target)}function d(a){g(a)?b("KaiOSNavigatorUtils").showCursor():(a.target instanceof HTMLTextAreaElement||a.target instanceof HTMLInputElement)&&b("SpatialNavController").isSpatialNavEnabled()&&b("KaiOSNavigatorUtils").hideCursor()}function f(a){__p&&__p();if(b("KaiOSMenuHandler").handleKeyEvents(a)||b("KaiOSControllerConfig").fullScreenVideoHandler&&b("KaiOSControllerConfig").fullScreenVideoHandler.handleKeyDownEvent(a)){a.preventDefault();a.stopPropagation();return}switch(a.key){case"Backspace":if(m())break;case"BrowserBack":h(a);break;case"Enter":i(a);break;case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"ArrowDown":j(a);break}}function h(a){b("SpatialNavController").isSpatialNavEnabled()&&b("SpatialNavControllerUtils").shouldInterceptBackKey(a)?(a.preventDefault(),a.stopPropagation(),b("SpatialNavController").interceptBackKey()):document.fullscreenElement?(document.exitFullscreen(),a.preventDefault(),a.stopPropagation()):b("KaiOSControllerUtils").keyDownEventHandledByRegPage(a.key)?(a.preventDefault(),a.stopPropagation()):b("KaiOSControllerUtils").isOnHomeOrConfPage()&&b("MViewport").getScrollTop()>5?(a.preventDefault(),a.stopPropagation(),b("SpatialNavController").isSpatialNavEnabled()==!0?b("SpatialNavController").scrollToTop():b("MViewport").scrollTo(0,0)):!b("KaiOSControllerUtils").isOnHomeOrConfPage()&&!b("KaiOSControllerUtils").shouldExitOnBackForLoggedOutPush()&&(b("KaiOSSendMessageUtil").postMessage(b("KaiOSConnectionHelper").hostWindow,b("KaiOSSendMessageUtil").Type.HANDLE_BACK),a.preventDefault(),a.stopPropagation())}function i(a){b("KaiOSControllerConfig").appVersion!=null&&a.target.type=="textarea"?(a.target.blur(),a.preventDefault(),a.stopPropagation()):j(a)}function j(a){b("SpatialNavController").isSpatialNavEnabled()&&!k(a)&&(a.preventDefault(),b("SpatialNavController").handleKeyDown(a))}function k(a){__p&&__p();var b=!1,c=l();switch(a.key){case"ArrowLeft":b=(a=c.shouldOverrideLeft)!=null?a:!1;break;case"ArrowRight":b=(a=c.shouldOverrideRight)!=null?a:!1;break;case"ArrowUp":b=(a=c.shouldOverrideUp)!=null?a:!1;break;case"ArrowDown":b=(a=c.shouldOverrideDown)!=null?a:!1;break;case"Enter":b=(a=c.shouldOverrideCSK)!=null?a:!1;break}return b}function l(){var a=document.activeElement;if(a instanceof HTMLInputElement&&b("KaiOSHTMLElementUtils").isTextfieldInput(a))return{shouldOverrideLeft:!0,shouldOverrideRight:!0};return a instanceof HTMLElement&&b("KaiOSHTMLElementUtils").isFileUploadElement(a)?{shouldOverrideCSK:!0}:{}}function m(){var a=document.activeElement;if(a&&a instanceof HTMLInputElement)return!0;else return!1}e.exports={interceptClick:a,handleTextfieldFocus:c,handleTextfieldBlur:d,handleKeyDown:f}}),null); __d("XExternalShareComposerController",["XController"],(function(a,b,c,d,e,f){e.exports=b("XController").create("/kaiosapp/composer/",{csid:{type:"String"},length:{type:"Int"}})}),null); __d("KaiOSShareHandler",["XAsyncRequest","XExternalShareComposerController"],(function(a,b,c,d,e,f){"use strict";__p&&__p();a={handle:function(a){if(a===void 0)return;var c=Math.min(a.length,3),d=new FormData();for(var e=0;e=h){this.$10=!0;return!0}return!1};c.$16=function(a){if(this.$19())return;b("goURI")(a)};c.$14=function(){this.$4||(this.$4={app_referrer:"",app:"",country:""}),b("BanzaiLogger").create({signal:!0,delay:1e3}).log("DirectDownloadLoggerConfig",{event:b("DirectDownloadEvents").logged_out_banner_upgrade_button_click,app_referrer:this.$4.app_referrer,app:this.$4.app,country:this.$4.country})};return a}();e.exports=a}),null);