{"version":3,"file":"ng-vue-router-plugin.mjs","sources":["../../src/plugins/angular-vue-router-plugin.js"],"sourcesContent":["import Vue from 'Vue';\n\nexport default function AngularVueRouterPlugin($injector) {\n    \n    if(!$injector)\n        $injector = Vue?.prototype?.$ngVue?.$injector;\n\n    if(!$injector)\n        throw new Error('Angular $injector not provided, cannot use AngularVueRouterPlugin plugin');\n\n    const $location = $injector.get('$location');\n    const $rootScope = $injector.get('$rootScope');\n    if(!$location)\n        throw new Error('Angular $location service not available, cannot use AngularVueRouterPlugin plugin');\n\n    const ngApply = (callback) => {\n        if($rootScope.$$phase) \n            callback();\n        else \n            $rootScope.$apply(callback);\n    } \n\n    var router ={\n        push ({path, query, hash}){\n            ngApply(() => {\n                if(path)  \n                    $location.path(path);\n                if(query) \n                    $location.search(query||{});\n                if(hash!==undefined) \n                    $location.hash((hash||'').replace(/^#/, ''));\n            });\n        },\n        replace(...args) {\n            ngApply(() => {\n                $location.replace();\n                this.push(...args);\n            });\n        }\n    }\n    return {\n        install(Vue, options) {\n            if(!Vue.prototype.$router)\n                Vue.prototype.$router = router;\n        }\n      }\n}"],"names":["AngularVueRouterPlugin","$injector","Vue","prototype","$ngVue","Error","$location","get","$rootScope","ngApply","callback","$$phase","$apply","router","push","path","query","hash","search","undefined","replace","args","install","options","$router"],"mappings":";AAEe,SAASA,sBAAsB,CAACC,SAAS,EAAE;EAAA;EAEtD,IAAG,CAACA,SAAS,EACTA,SAAS,GAAGC,GAAG,aAAHA,GAAG,yCAAHA,GAAG,CAAEC,SAAS,4EAAd,eAAgBC,MAAM,0DAAtB,sBAAwBH,SAAS;EAEjD,IAAG,CAACA,SAAS,EACT,MAAM,IAAII,KAAK,CAAC,0EAA0E,CAAC;EAE/F,IAAMC,SAAS,GAAGL,SAAS,CAACM,GAAG,CAAC,WAAW,CAAC;EAC5C,IAAMC,UAAU,GAAGP,SAAS,CAACM,GAAG,CAAC,YAAY,CAAC;EAC9C,IAAG,CAACD,SAAS,EACT,MAAM,IAAID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